Re-enable tests on mappingservice.implementation 48/36548/1
authorLorand Jakab <lojakab@cisco.com>
Tue, 22 Mar 2016 11:10:27 +0000 (13:10 +0200)
committerLorand Jakab <lojakab@cisco.com>
Tue, 22 Mar 2016 11:10:27 +0000 (13:10 +0200)
We forgot to reactivate them after the YANG model migration. Many of the
tests still have to be adapted, they are now set to @Ignore.

Change-Id: I9a1a6e1bf31ca3e025f4573fa40bd7ab6ede14d7
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
mappingservice/implementation/pom.xml
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/authentication/LispAuthenticationTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapResolverTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServerTest.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/lisp/MappingServiceTest.java

index 056e8aa65553b0060112c6c91685e2e6ac00e742..f30b16b89c1c82ef0c35cc21df64a366551537a3 100644 (file)
     </dependency>
   </dependencies>
 
-  <build>
-    <!-- Temporarily disable compiling non-generated code, like serializers, which won't build for now -->
-    <plugins>
-      <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>default-testCompile</id>
-            <phase>test-compile</phase>
-            <goals>
-              <goal>testCompile</goal>
-            </goals>
-            <configuration>
-              <skip>true</skip>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
   <!--
       Maven Site Configuration
 
index 9bf034de9fd093de3e585ec6d2332bb22504938d..f61cd668efb3f20522cfa3cbbe35421febdbac07 100644 (file)
@@ -29,10 +29,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev15090
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkeyBuilder;
 
 public class LispAuthenticationTest extends BaseTestCase {
-    private static final MappingAuthkey PASSWORD =
-            new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build();
-    private static final MappingAuthkey WRONG_PASSWORD =
-            new MappingAuthkeyBuilder().setKeyType(1).setKeyString("wrongPassword").build();
+    private static final String PASSWORD = "password";
+    private static final String WRONG_PASSWORD = "wrongPassword";
+
     private static final Eid EID = LispAddressUtil.asIpv4PrefixEid("153.16.254.1/32");
 
     @Test
@@ -54,7 +53,7 @@ public class LispAuthenticationTest extends BaseTestCase {
                 + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 "
                 + "ff 00 00 05 00 01 c0 a8 88 0a"), null);
 
-        assertFalse(LispAuthenticationUtil.validate(mapRegister, EID, PASSWORD));
+        assertFalse(validate(mapRegister, EID, 1, PASSWORD));
     }
 
     @Test
@@ -75,8 +74,8 @@ public class LispAuthenticationTest extends BaseTestCase {
                 + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 "
                 + "ff 00 00 05 00 01 c0 a8 88 0a"), null);
 
-        assertTrue(LispAuthenticationUtil.validate(mapRegister, EID, PASSWORD));
-        assertFalse(LispAuthenticationUtil.validate(mapRegister, EID, WRONG_PASSWORD));
+        assertTrue(validate(mapRegister, EID, 1, PASSWORD));
+        assertFalse(validate(mapRegister, EID, 1, WRONG_PASSWORD));
     }
 
     @Test
@@ -104,8 +103,8 @@ public class LispAuthenticationTest extends BaseTestCase {
                                 + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 "
                                 + "ff 00 00 05 00 01 c0 a8 88 0a"), null);
 
-        assertTrue(LispAuthenticationUtil.validate(mapRegister, EID, PASSWORD));
-        assertFalse(LispAuthenticationUtil.validate(mapRegister, EID, WRONG_PASSWORD));
+        assertTrue(validate(mapRegister, EID, 2, PASSWORD));
+        assertFalse(validate(mapRegister, EID, 2, WRONG_PASSWORD));
     }
 
     @Test
@@ -126,8 +125,8 @@ public class LispAuthenticationTest extends BaseTestCase {
                 + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 "
                 + "ff 00 00 05 00 01 c0 a8 88 0a"), null);
 
-        assertTrue(LispAuthenticationUtil.validate(mapRegister, EID, PASSWORD));
-        assertTrue(LispAuthenticationUtil.validate(mapRegister, EID, WRONG_PASSWORD));
+        assertTrue(validate(mapRegister, EID, 0, PASSWORD));
+        assertTrue(validate(mapRegister, EID, 0, WRONG_PASSWORD));
     }
 
     // @Test
@@ -187,4 +186,9 @@ public class LispAuthenticationTest extends BaseTestCase {
                 "password"));
 
     }
+
+    private static boolean validate(MapRegister mapRegister, Eid eid, int keyId, String password) {
+        MappingAuthkey key = new MappingAuthkeyBuilder().setKeyType(keyId).setKeyString(password).build();
+        return LispAuthenticationUtil.validate(mapRegister, eid, key);
+    }
 }
index 033f6c493b8262bb37df7efb0f97753583daad71..b5a03e466e3875d1ee746b1a371fe9f36b15b897 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Map;
 import org.jmock.api.Invocation;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.lispflowmapping.implementation.LispMappingService;
 import org.opendaylight.lispflowmapping.implementation.MappingService;
@@ -77,6 +78,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__ReplyWithSingleLocator() throws Exception {
         mapRequest = getDefaultMapRequestBuilder();
         mapRequest.getEidItem().add(new EidItemBuilder().setEid(v4Address).build());
@@ -111,6 +113,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__VerifyBasicFields() throws Exception {
         mapRequest = getDefaultMapRequestBuilder();
         mapRequest.getEidItem().add(new EidItemBuilder().setEid(v4Address).build());
@@ -136,6 +139,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__VerifyMask() throws Exception {
         mapRequest = getDefaultMapRequestBuilder();
         mapRequest.getEidItem().add(new EidItemBuilder().setEid(v4Address).build());
@@ -157,6 +161,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__VerifyMaskIPv6() throws Exception {
         mapRequest = getDefaultMapRequestBuilder();
         mapRequest.getEidItem().add(new EidItemBuilder().setEid(v6Address).build());
@@ -179,6 +184,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__VerifyMaskIPv6NoMatch() throws Exception {
         mapRequest = getDefaultMapRequestBuilder();
         mapRequest.getEidItem().add(new EidItemBuilder().setEid(v6Address).build());
@@ -199,6 +205,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest_VerifyNativelyForwardAuthorized() {
         MapRequest mr = getDefaultMapRequest();
 
@@ -212,6 +219,7 @@ public class MapResolverTest extends BaseTestCase {
         assertEquals(Action.NativelyForward, eidToLocators.getAction());
     }
 
+    @Ignore
     private MapReply getNativelyForwardMapReply(MapRequest mr, Map<String, MappingRecord> result) {
         allowing(dao).get(wany(Eid.class));
         ret(result);
@@ -229,6 +237,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__VerifyMaskNoMatch() throws Exception {
         mapRequest = getDefaultMapRequestBuilder();
         mapRequest.getEidItem().add(new EidItemBuilder().setEid(v4Address).build());
@@ -250,6 +259,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__ReplyWithMultipleLocators() throws Exception {
 
         mapRequest = getDefaultMapRequestBuilder();
@@ -281,6 +291,7 @@ public class MapResolverTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRequest__MultipleEIDs() throws Exception {
 
         mapRequest = getDefaultMapRequestBuilder();
index 80ac732f64fc35b8fc99e6c55d440e8d93c68a4d..c426b26c27a8097e4d5d255f15ac649fceed6c18 100644 (file)
@@ -16,6 +16,7 @@ import junitx.framework.ArrayAssert;
 
 import org.jmock.api.Invocation;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.lispflowmapping.implementation.LispMappingService;
 import org.opendaylight.lispflowmapping.implementation.MappingService;
@@ -112,6 +113,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegister__NonSetMBit() throws Exception {
         mapRegisterBuilder.setWantMapNotify(false);
 
@@ -125,6 +127,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__ValidNotifyEchoesRegister() throws Exception {
         mapRegisterBuilder.getMappingRecordItem().add(new MappingRecordItemBuilder().setMappingRecord(
                 getDefaultMappingRecordBuilder().setEid(new EidBuilder().setAddressType(NoAddressAfi.class).setAddress(
@@ -143,6 +146,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__CloneNotOwnYouClown() throws Exception {
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
         mapRegisterBuilder.setWantMapNotify(true);
@@ -170,6 +174,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__ValidMask() throws Exception {
         int mask = 16;
         Eid newEid = LispAddressUtil.asIpv4PrefixEid(eidIpv4String + "/" + mask);
@@ -195,6 +200,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegister__NonMaskable() throws Exception {
         int mask = 16;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
@@ -221,6 +227,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegister__ZeroMask() throws Exception {
         int mask = 0;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
@@ -247,6 +254,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIPv4__ZeroMask() throws Exception {
         int mask = 0;
         Eid newEid = LispAddressUtil.asIpv4PrefixEid(eidIpv4String + "/" + mask);
@@ -272,6 +280,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__ValidMask32() throws Exception {
         int mask = 32;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
@@ -296,7 +305,8 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
-    public void handleMapRegisterIpv6__ValidMask96() throws Exception {
+    @Ignore
+   public void handleMapRegisterIpv6__ValidMask96() throws Exception {
         int mask = 96;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
         Eid addr = LispAddressUtil.asIpv6PrefixEid(eidIpv6String + "/" + mask);
@@ -322,6 +332,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv6__ZeroMask() throws Exception {
         int mask = 0;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
@@ -348,6 +359,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv6__ValidMask48() throws Exception {
         int mask = 48;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
@@ -374,6 +386,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv6__ValidMask128() throws Exception {
         int mask = 128;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
@@ -400,6 +413,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIPV4AndIpv6__ValidMask96() throws Exception {
         int mask = 96;
         mapRegisterBuilder = getDefaultMapRegisterBuilder();
@@ -433,6 +447,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegister__MultipleRLOCs() throws Exception {
         addDefaultPutAndGetExpectations(eid);
 
@@ -465,6 +480,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegister__MultipleTypes() throws Exception {
         addDefaultPutAndGetExpectations(eid);
 
@@ -500,6 +516,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegister__TestOverwrite() throws Exception {
         addDefaultPutAndGetExpectations(eid);
 
@@ -544,6 +561,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegister__MultipleEIDs() throws Exception {
         addDefaultPutAndGetExpectations(eid);
 
@@ -580,6 +598,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__CheckWrongPassword() throws Exception {
 
         addGetExpectations(LispAddressUtil.asIpv4PrefixEid("153.16.254.1"), 0, 31, "bla");
@@ -588,6 +607,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__CheckNoPasswordAndThenPassword() throws Exception {
 
         addGetExpectations(LispAddressUtil.asIpv4PrefixEid("153.16.254.1"), 0, 25, "password");
@@ -599,6 +619,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__CheckNoPassword() throws Exception {
 
         addGetExpectations(LispAddressUtil.asIpv4PrefixEid("153.16.254.1/32"), 30, 0, "password");
@@ -607,6 +628,7 @@ public class MapServerTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleMapRegisterIpv4__CheckNoreturn() throws Exception {
 
         addGetExpectations(LispAddressUtil.asIpv4PrefixEid("153.16.254.1/32"));
index 12b7a2e692cfb7f595c8d8e78fb12c3f22aba8d8..08dc14739173ac45f6182c49a62dbdc1fac1c4a5 100644 (file)
@@ -14,6 +14,7 @@ import java.util.Arrays;
 
 import org.jmock.api.Invocation;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.lispflowmapping.implementation.MappingService;
 import org.opendaylight.lispflowmapping.implementation.MappingSystem;
@@ -69,6 +70,7 @@ public class MappingServiceTest extends BaseTestCase {
 
     @SuppressWarnings("unchecked")
     @Test
+    @Ignore
     public void handleAddAuthenticationKey() throws Exception {
         MappingAuthkey authKey = new MappingAuthkeyBuilder().setKeyType(1).setKeyString("pass").build();
         MappingEntry<MappingAuthkey> keyMappingEntry = new MappingEntry<>(SubKeys.AUTH_KEY, authKey);
@@ -81,6 +83,7 @@ public class MappingServiceTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleGetAuthenticationKey() throws Exception {
         Eid key = getDefaultKey();
         oneOf(dao).getSpecific(weq(key), with(SubKeys.AUTH_KEY));
@@ -100,6 +103,7 @@ public class MappingServiceTest extends BaseTestCase {
     }
 
     @Test
+    @Ignore
     public void handleRemoveAuthenticationKey() throws Exception {
         Eid key = getDefaultKey();
         addDsbeRemoveKeyExpectation();