HC2VPP-131 - checking of lisp state before/after according to operation 28/6328/5
authorJan Srnicek <[email protected]>
Tue, 2 May 2017 08:41:35 +0000 (10:41 +0200)
committerMarek Gradzki <[email protected]>
Tue, 2 May 2017 11:31:10 +0000 (11:31 +0000)
Change-Id: I190562527c68d022a9b16fc76ad6a011161f4308
Signed-off-by: Jan Srnicek <[email protected]>
24 files changed:
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/read/VrfSubtableCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckService.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImpl.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/ItrRemoteLocatorSetCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapResolverCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/PitrCfgCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizer.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LispWriterCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapResolverCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PitrCfgCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizerTest.java

index 80d6cbd..99923cf 100644 (file)
@@ -29,7 +29,6 @@ import io.fd.honeycomb.translate.spi.read.Initialized;
 import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager;
 import io.fd.honeycomb.translate.util.read.cache.DumpCacheManager.DumpCacheManagerBuilder;
-import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump;
 import io.fd.vpp.jvpp.core.dto.OneEidTableMapDetails;
 import io.fd.vpp.jvpp.core.dto.OneEidTableMapDetailsReplyDump;
 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
@@ -57,7 +56,7 @@ public class VrfSubtableCustomizer extends FutureJVppCustomizer
         super(futureJvpp);
         dumpManager = new DumpCacheManagerBuilder<OneEidTableMapDetailsReplyDump, SubtableDumpParams>()
                 .withExecutor(createExecutor(futureJvpp))
-                .acceptOnly(LispEidTableMapDetailsReplyDump.class)
+                .acceptOnly(OneEidTableMapDetailsReplyDump.class)
                 .build();
     }
 
index ab0ea79..81256a3 100644 (file)
@@ -25,10 +25,19 @@ import javax.annotation.Nonnull;
  */
 public interface LispStateCheckService {
 
+    /**
+     * Checks whether lisp is enabled while operating inside {@link WriteContext}.
+     * Covers cases when removing lisp data
+     * @throws IllegalStateException if lisp feature is disabled
+     */
+    void checkLispEnabledBefore(@Nonnull final WriteContext ctx);
+
     /**
      * Checks whether lisp is enabled while operating inside {@link WriteContext}
+     * Covers cases when creating/updating lisp data
+     * @throws IllegalStateException if lisp feature is disabled
      */
-    void checkLispEnabled(@Nonnull final WriteContext ctx);
+    void checkLispEnabledAfter(@Nonnull final WriteContext ctx);
 
     /**
      * Checks whether lisp is enabled while operating inside {@link ReadContext}
index a93f083..65e409d 100644 (file)
@@ -52,7 +52,15 @@ public final class LispStateCheckServiceImpl implements LispStateCheckService, J
                 .build();
     }
 
-    public void checkLispEnabled(@Nonnull final WriteContext ctx) {
+    @Override
+    public void checkLispEnabledBefore(@Nonnull final WriteContext ctx) {
+        // no need to dump here, can be read directly from context
+        checkState(ctx.readBefore(InstanceIdentifier.create(Lisp.class))
+                .or(STATIC_LISP_INSTANCE).isEnable(), "Lisp feature not enabled");
+    }
+
+    @Override
+    public void checkLispEnabledAfter(@Nonnull final WriteContext ctx) {
         // no need to dump here, can be read directly from context
         checkState(ctx.readAfter(InstanceIdentifier.create(Lisp.class))
                 .or(STATIC_LISP_INSTANCE).isEnable(), "Lisp feature not enabled");
index 90dc0ef..2674aa4 100644 (file)
@@ -75,7 +75,11 @@ public class ItrRemoteLocatorSetCustomizer extends CheckedLispCustomizer impleme
     private void addDelItrRemoteLocatorSet(final boolean add, @Nonnull final ItrRemoteLocatorSet data,
                                            @Nonnull final WriteContext context)
             throws TimeoutException, VppBaseCallException {
-        lispStateCheckService.checkLispEnabled(context);
+        if (add) {
+            lispStateCheckService.checkLispEnabledAfter(context);
+        } else {
+            lispStateCheckService.checkLispEnabledBefore(context);
+        }
 
         OneAddDelMapRequestItrRlocs request = new OneAddDelMapRequestItrRlocs();
         request.isAdd = booleanToByte(add);
index 04ca726..f8babdf 100755 (executable)
@@ -72,7 +72,7 @@ public class LocatorSetCustomizer extends CheckedLispCustomizer
     public void writeCurrentAttributes(@Nonnull InstanceIdentifier<LocatorSet> id,
                                        @Nonnull LocatorSet dataAfter,
                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         checkState(isNonEmptyLocatorSet(writeContext.readAfter(id).get()),
                 "Creating empty locator-sets is not allowed");
         final String locatorSetName = dataAfter.getName();
@@ -99,7 +99,7 @@ public class LocatorSetCustomizer extends CheckedLispCustomizer
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<LocatorSet> id,
                                         @Nonnull LocatorSet dataBefore,
                                         @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         final String locatorSetName = dataBefore.getName();
 
         final Optional<EidTable> eidTableData = writeContext.readAfter(InstanceIdentifier.create(Lisp.class)
index ff306e5..cfa5618 100644 (file)
@@ -41,6 +41,7 @@ public class MapRegisterCustomizer extends CheckedLispCustomizer
     public void writeCurrentAttributes(@Nonnull InstanceIdentifier<MapRegister> instanceIdentifier,
                                        @Nonnull MapRegister mapRegister,
                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         enableDisableMapRegister(mapRegister.isEnabled(), instanceIdentifier, writeContext);
     }
 
@@ -49,6 +50,7 @@ public class MapRegisterCustomizer extends CheckedLispCustomizer
                                         @Nonnull MapRegister mapRegisterBefore,
                                         @Nonnull MapRegister mapRegisterAfter, @Nonnull
                                                 WriteContext writeContext) throws WriteFailedException {
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         enableDisableMapRegister(mapRegisterAfter.isEnabled(), instanceIdentifier, writeContext);
     }
 
@@ -56,12 +58,12 @@ public class MapRegisterCustomizer extends CheckedLispCustomizer
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<MapRegister> instanceIdentifier,
                                         @Nonnull MapRegister mapRegister,
                                         @Nonnull WriteContext writeContext) throws WriteFailedException {
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         enableDisableMapRegister(false, instanceIdentifier, writeContext);
     }
 
     private void enableDisableMapRegister(final boolean enable, @Nonnull final InstanceIdentifier<MapRegister> id,
                                           @Nonnull final WriteContext context) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(context);
         OneMapRegisterEnableDisable request = new OneMapRegisterEnableDisable();
         request.isEnabled = booleanToByte(enable);
         getReplyForWrite(getFutureJVpp().oneMapRegisterEnableDisable(request).toCompletableFuture(), id);
index 64e66b2..1acfec7 100644 (file)
@@ -44,7 +44,7 @@ public class MapRequestModeCustomizer extends CheckedLispCustomizer
     public void writeCurrentAttributes(@Nonnull InstanceIdentifier<MapRequestMode> instanceIdentifier,
                                        @Nonnull MapRequestMode mapRequestMode,
                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         getReplyForWrite(mapRequestModeRequestFuture(mapRequestMode), instanceIdentifier);
     }
 
@@ -53,7 +53,7 @@ public class MapRequestModeCustomizer extends CheckedLispCustomizer
                                         @Nonnull MapRequestMode mapRequestModeBefore,
                                         @Nonnull MapRequestMode mapRequestModeAfter, @Nonnull WriteContext writeContext)
             throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         getReplyForUpdate(mapRequestModeRequestFuture(mapRequestModeAfter), instanceIdentifier,
                 mapRequestModeBefore, mapRequestModeAfter);
     }
index 934cc21..b2d0870 100755 (executable)
@@ -51,7 +51,7 @@ public class MapResolverCustomizer extends CheckedLispCustomizer
     public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<MapResolver> id,
                                        @Nonnull final MapResolver dataAfter, @Nonnull final WriteContext writeContext)
             throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         checkNotNull(dataAfter, "Data is null");
         checkNotNull(dataAfter.getIpAddress(), "Address is null");
 
@@ -73,7 +73,7 @@ public class MapResolverCustomizer extends CheckedLispCustomizer
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<MapResolver> id,
                                         @Nonnull final MapResolver dataBefore, @Nonnull final WriteContext writeContext)
             throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         checkNotNull(dataBefore, "Data is null");
         checkNotNull(dataBefore.getIpAddress(), "Address is null");
 
index 6dc2015..306788a 100644 (file)
@@ -44,7 +44,7 @@ public class MapServerCustomizer extends CheckedLispCustomizer
     public void writeCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier,
                                        @Nonnull MapServer mapServer,
                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         addDelMapServer(true, instanceIdentifier, mapServer);
     }
 
@@ -59,7 +59,7 @@ public class MapServerCustomizer extends CheckedLispCustomizer
 
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, @Nonnull MapServer mapServer, @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         addDelMapServer(false, instanceIdentifier, mapServer);
     }
 
index 6c985ff..9d25c5f 100644 (file)
@@ -44,7 +44,7 @@ public class PetrCfgCustomizer extends CheckedLispCustomizer
     public void writeCurrentAttributes(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier,
                                        @Nonnull PetrCfg petrCfg,
                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         enablePetrCfg(instanceIdentifier, petrCfg);
     }
 
@@ -53,7 +53,7 @@ public class PetrCfgCustomizer extends CheckedLispCustomizer
                                         @Nonnull PetrCfg petrCfgBefore,
                                         @Nonnull PetrCfg petrCfgAfter,
                                         @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         if (petrCfgAfter.getPetrAddress() != null) {
             enablePetrCfg(instanceIdentifier, petrCfgAfter);
         } else {
@@ -63,7 +63,7 @@ public class PetrCfgCustomizer extends CheckedLispCustomizer
 
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<PetrCfg> instanceIdentifier, @Nonnull PetrCfg petrCfg, @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         disablePetrCfg(instanceIdentifier);
     }
 
index 6944940..1597fe4 100755 (executable)
@@ -51,7 +51,7 @@ public class PitrCfgCustomizer extends CheckedLispCustomizer
     @Override
     public void writeCurrentAttributes(InstanceIdentifier<PitrCfg> id, PitrCfg dataAfter, WriteContext writeContext)
             throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         checkNotNull(dataAfter, "PitrCfg is null");
         checkNotNull(dataAfter.getLocatorSet(), "Locator set name is null");
 
@@ -65,7 +65,7 @@ public class PitrCfgCustomizer extends CheckedLispCustomizer
     @Override
     public void updateCurrentAttributes(InstanceIdentifier<PitrCfg> id, PitrCfg dataBefore, PitrCfg dataAfter,
                                         WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         checkNotNull(dataAfter, "PitrCfg is null");
         checkNotNull(dataAfter.getLocatorSet(), "Locator set name is null");
 
@@ -79,7 +79,7 @@ public class PitrCfgCustomizer extends CheckedLispCustomizer
     @Override
     public void deleteCurrentAttributes(InstanceIdentifier<PitrCfg> id, PitrCfg dataBefore, WriteContext writeContext)
             throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         checkNotNull(dataBefore, "PitrCfg is null");
         checkNotNull(dataBefore.getLocatorSet(), "Locator set name is null");
 
index e984a16..ebe00ec 100644 (file)
@@ -41,7 +41,7 @@ public class RlocProbeCustomizer extends CheckedLispCustomizer
     public void writeCurrentAttributes(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier,
                                        @Nonnull RlocProbe rlocProbe,
                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         enableDisableRlocProbe(rlocProbe.isEnabled(), instanceIdentifier);
     }
 
@@ -50,7 +50,7 @@ public class RlocProbeCustomizer extends CheckedLispCustomizer
                                         @Nonnull RlocProbe rlocProbeBefore,
                                         @Nonnull RlocProbe rlocProbeAfter,
                                         @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         enableDisableRlocProbe(rlocProbeAfter.isEnabled(), instanceIdentifier);
     }
 
@@ -58,7 +58,7 @@ public class RlocProbeCustomizer extends CheckedLispCustomizer
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<RlocProbe> instanceIdentifier,
                                         @Nonnull RlocProbe rlocProbe,
                                         @Nonnull WriteContext writeContext) throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         enableDisableRlocProbe(false, instanceIdentifier);
     }
 
index e6fe3db..0cc9393 100755 (executable)
@@ -46,7 +46,7 @@ public class VniTableCustomizer extends CheckedLispCustomizer implements ListWri
     @Override
     public void writeCurrentAttributes(InstanceIdentifier<VniTable> id, VniTable dataAfter, WriteContext writeContext)
             throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledAfter(writeContext);
         checkAtLeastOnChildExists(id, writeContext, false);
     }
 
@@ -59,7 +59,7 @@ public class VniTableCustomizer extends CheckedLispCustomizer implements ListWri
     @Override
     public void deleteCurrentAttributes(InstanceIdentifier<VniTable> id, VniTable dataBefore, WriteContext writeContext)
             throws WriteFailedException {
-        lispStateCheckService.checkLispEnabled(writeContext);
+        lispStateCheckService.checkLispEnabledBefore(writeContext);
         checkAtLeastOnChildExists(id, writeContext, true);
     }
 
index 4aa9335..78a897e 100644 (file)
@@ -57,24 +57,45 @@ public class LispStateCheckServiceImplTest implements FutureProducer {
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testCheckLispEnabledNoConfig() throws Exception {
+    public void testCheckLispEnabledBeforeNoConfig() throws Exception {
+        when(writeContext.readBefore(InstanceIdentifier.create(Lisp.class))).thenReturn(Optional.absent());
+        impl.checkLispEnabledBefore(writeContext);
+    }
+
+    @Test(expected = IllegalStateException.class)
+    public void testCheckLispEnabledBeforeDisabledConfig() throws Exception {
+        when(writeContext.readBefore(InstanceIdentifier.create(Lisp.class)))
+                .thenReturn(Optional.of(new LispBuilder().setEnable(false).build()));
+        impl.checkLispEnabledBefore(writeContext);
+    }
+
+    @Test
+    public void testCheckLispEnabledBeforeEnabledConfig() throws Exception {
+        // no exception should be thrown here
+        when(writeContext.readBefore(InstanceIdentifier.create(Lisp.class)))
+                .thenReturn(Optional.of(new LispBuilder().setEnable(true).build()));
+        impl.checkLispEnabledBefore(writeContext);
+    }
+
+    @Test(expected = IllegalStateException.class)
+    public void testCheckLispEnabledAfterNoConfig() throws Exception {
         when(writeContext.readAfter(InstanceIdentifier.create(Lisp.class))).thenReturn(Optional.absent());
-        impl.checkLispEnabled(writeContext);
+        impl.checkLispEnabledAfter(writeContext);
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testCheckLispEnabledDisabledConfig() throws Exception {
+    public void testCheckLispEnabledAfterDisabledConfig() throws Exception {
         when(writeContext.readAfter(InstanceIdentifier.create(Lisp.class)))
                 .thenReturn(Optional.of(new LispBuilder().setEnable(false).build()));
-        impl.checkLispEnabled(writeContext);
+        impl.checkLispEnabledAfter(writeContext);
     }
 
     @Test
-    public void testCheckLispEnabledEnabledConfig() throws Exception {
+    public void testCheckLispEnabledAfterEnabledConfig() throws Exception {
         // no exception should be thrown here
         when(writeContext.readAfter(InstanceIdentifier.create(Lisp.class)))
                 .thenReturn(Optional.of(new LispBuilder().setEnable(true).build()));
-        impl.checkLispEnabled(writeContext);
+        impl.checkLispEnabledAfter(writeContext);
     }
 
     @Test
index a2d7721..51ef125 100644 (file)
@@ -29,9 +29,14 @@ public abstract class LispWriterCustomizerTest extends WriterCustomizerTest{
     @Mock
     protected LispStateCheckService lispStateCheckService;
 
-    protected void mockLispDisabled(){
+    protected void mockLispDisabledAfter(){
         doThrow(IllegalArgumentException.class)
-                .when(lispStateCheckService).checkLispEnabled(any(WriteContext.class));
+                .when(lispStateCheckService).checkLispEnabledAfter(any(WriteContext.class));
+    }
+
+    protected void mockLispDisabledBefore(){
+        doThrow(IllegalArgumentException.class)
+                .when(lispStateCheckService).checkLispEnabledBefore(any(WriteContext.class));
     }
 
 
index 00c9f3e..ba4163f 100755 (executable)
@@ -203,7 +203,7 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -215,7 +215,7 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index f4f3d2f..f8a95ca 100644 (file)
@@ -90,7 +90,7 @@ public class MapRegisterCustomizerTest extends LispWriterCustomizerTest implemen
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -102,7 +102,7 @@ public class MapRegisterCustomizerTest extends LispWriterCustomizerTest implemen
 
     @Test
     public void testUpdateLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.updateCurrentAttributes(EMPTY_ID, EMPTY_DATA,EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -114,7 +114,7 @@ public class MapRegisterCustomizerTest extends LispWriterCustomizerTest implemen
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index c43960e..7a48e84 100644 (file)
@@ -79,7 +79,7 @@ public class MapRequestModeCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -91,7 +91,7 @@ public class MapRequestModeCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testUpdateLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.updateCurrentAttributes(EMPTY_ID, EMPTY_DATA,EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index bc7703b..a18fa0e 100755 (executable)
@@ -106,7 +106,7 @@ public class MapResolverCustomizerTest extends LispWriterCustomizerTest implemen
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -118,7 +118,7 @@ public class MapResolverCustomizerTest extends LispWriterCustomizerTest implemen
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index 14ff2c5..fb4561c 100644 (file)
@@ -91,7 +91,7 @@ public class MapServerCustomizerTest extends LispWriterCustomizerTest implements
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -103,7 +103,7 @@ public class MapServerCustomizerTest extends LispWriterCustomizerTest implements
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index f46d795..329aeb3 100644 (file)
@@ -86,7 +86,7 @@ public class PetrCfgCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -98,7 +98,7 @@ public class PetrCfgCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testUpdateLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.updateCurrentAttributes(EMPTY_ID, EMPTY_DATA,EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -110,7 +110,7 @@ public class PetrCfgCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index 520b5ee..9c301fb 100755 (executable)
@@ -120,7 +120,7 @@ public class PitrCfgCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -132,7 +132,7 @@ public class PitrCfgCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testUpdateLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.updateCurrentAttributes(EMPTY_ID, EMPTY_DATA,EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -144,7 +144,7 @@ public class PitrCfgCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index 6ae8277..5917ddd 100644 (file)
@@ -82,7 +82,7 @@ public class RlocProbeCustomizerTest extends LispWriterCustomizerTest implements
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -94,7 +94,7 @@ public class RlocProbeCustomizerTest extends LispWriterCustomizerTest implements
 
     @Test
     public void testUpdateLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.updateCurrentAttributes(EMPTY_ID, EMPTY_DATA,EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -106,7 +106,7 @@ public class RlocProbeCustomizerTest extends LispWriterCustomizerTest implements
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
index 1bf4b77..04a50bc 100644 (file)
@@ -89,7 +89,7 @@ public class VniTableCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testWriteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledAfter();
         try {
             customizer.writeCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {
@@ -101,7 +101,7 @@ public class VniTableCustomizerTest extends LispWriterCustomizerTest {
 
     @Test
     public void testDeleteLispDisabled() throws WriteFailedException {
-        mockLispDisabled();
+        mockLispDisabledBefore();
         try {
             customizer.deleteCurrentAttributes(EMPTY_ID, EMPTY_DATA, writeContext);
         } catch (IllegalArgumentException e) {