Update adaptors to sodium 56/110156/4
authorDan Timoney <dtimoney@att.com>
Tue, 14 Jul 2020 12:55:33 +0000 (08:55 -0400)
committerDan Timoney <dtimoney@att.com>
Mon, 3 Aug 2020 19:29:50 +0000 (19:29 +0000)
Update sli/adaptors to OpenDaylight Sodium release.  2 changes were
needed:

- mdsal-resource : needed to add unimplemented abstract methods in
inner anonymous BundleContext class in test case.
- resource-assignment: needed to correct unit test problems that were
ignored in earlier versions of h2

Change-Id: Ice63bfce64768e46c4376db55e3e9e97d0b934ad
Issue-ID: CCSDK-2551
Signed-off-by: Dan Timoney <dtimoney@att.com>
.gitignore
aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java
features/ccsdk-ansible-adapter/pom.xml
features/ccsdk-saltstack-adapter/pom.xml
mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestMdsalResourceActivator.java
resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
resource-assignment/provider/src/test/resources/sql/schema.sql

index cc576b7..42cca13 100755 (executable)
@@ -30,6 +30,7 @@ classes
 out/
 .DS_STORE
 .metadata
+.vscode
 provider/src/main/java/META-INF/
 provider/src/main/java/inventory/
 logs/
index b0272f5..f60b2da 100644 (file)
@@ -11,6 +11,8 @@ import static org.junit.Assert.assertNotNull;
 public class AAIClientRESTExecutorTest {
 
     private static AAIClientRESTExecutor aaiExecute;
+    private static AAIService aaiService;
+
     @BeforeClass
     public static void setUpBeforeClass() throws Exception {
         Properties properties = new Properties();
@@ -22,6 +24,7 @@ public class AAIClientRESTExecutorTest {
         properties.setProperty("connection.timeout", "60000");
         properties.setProperty("read.timeout", "60000");
         aaiExecute = new AAIClientRESTExecutor(properties);
+        aaiService = new AAIService(properties);
 
 
     }
index 32ec505..da497f5 100644 (file)
             <groupId>${project.groupId}</groupId>
             <artifactId>ansible-adapter-bundle</artifactId>
             <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>powermock-api-mockito</artifactId>
+                    <groupId>org.powermock</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
 
index ffc43e1..2e51c83 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
             <groupId>${project.groupId}</groupId>
             <artifactId>saltstack-adapter-provider</artifactId>
             <version>${project.version}</version>
+
+            <exclusions>
+                <exclusion>
+                    <artifactId>powermock-api-mockito</artifactId>
+                    <groupId>org.powermock</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 </project>
index 397915d..6174bc8 100644 (file)
@@ -30,7 +30,9 @@ import org.osgi.framework.BundleListener;
 import org.osgi.framework.Filter;
 import org.osgi.framework.FrameworkListener;
 import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceObjects;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 
@@ -49,8 +51,7 @@ public class TestMdsalResourceActivator {
         mdsal = new MdsalResourceActivator();
     }
 
-
-    @Test (expected = ConfigurationException.class)
+    @Test(expected = ConfigurationException.class)
     public void testStartResource() throws Exception {
         BundleContext ctx = new BundleContext() {
             @Override
@@ -119,27 +120,32 @@ public class TestMdsalResourceActivator {
             }
 
             @Override
-            public ServiceRegistration<?> registerService(String[] clazzes, Object service, Dictionary<String, ?> properties) {
+            public ServiceRegistration<?> registerService(String[] clazzes, Object service,
+                    Dictionary<String, ?> properties) {
                 return null;
             }
 
             @Override
-            public ServiceRegistration<?> registerService(String clazz, Object service, Dictionary<String, ?> properties) {
+            public ServiceRegistration<?> registerService(String clazz, Object service,
+                    Dictionary<String, ?> properties) {
                 return null;
             }
 
             @Override
-            public <S> ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String, ?> properties) {
+            public <S> ServiceRegistration<S> registerService(Class<S> clazz, S service,
+                    Dictionary<String, ?> properties) {
                 return null;
             }
 
             @Override
-            public ServiceReference<?>[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
+            public ServiceReference<?>[] getServiceReferences(String clazz, String filter)
+                    throws InvalidSyntaxException {
                 return new ServiceReference[0];
             }
 
             @Override
-            public ServiceReference<?>[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
+            public ServiceReference<?>[] getAllServiceReferences(String clazz, String filter)
+                    throws InvalidSyntaxException {
                 return new ServiceReference[0];
             }
 
@@ -154,7 +160,8 @@ public class TestMdsalResourceActivator {
             }
 
             @Override
-            public <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> clazz, String filter) throws InvalidSyntaxException {
+            public <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> clazz, String filter)
+                    throws InvalidSyntaxException {
                 return null;
             }
 
@@ -182,6 +189,19 @@ public class TestMdsalResourceActivator {
             public Bundle getBundle(String location) {
                 return null;
             }
+
+            @Override
+            public <S> ServiceRegistration<S> registerService(Class<S> clazz, ServiceFactory<S> factory,
+                    Dictionary<String, ?> properties) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
+                // TODO Auto-generated method stub
+                return null;
+            }
         };
 
         mdsal.start(ctx);
@@ -320,6 +340,19 @@ public class TestMdsalResourceActivator {
             public Bundle getBundle(String location) {
                 return null;
             }
+
+            @Override
+            public <S> ServiceRegistration<S> registerService(Class<S> clazz, ServiceFactory<S> factory,
+                    Dictionary<String, ?> properties) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
+                // TODO Auto-generated method stub
+                return null;
+            }
         };
 
         mdsal.stop(ctx);
index ab2d936..dbf0c4a 100644 (file)
@@ -216,6 +216,7 @@ public class TestReserve {
         rr.requestType = "New";
         rr.rangeMaxOverride = -1;
         rr.rangeMinOverride = -1;
+        rr.applicationId = "myapp";
 
         List<ResourceResponse> rsList = new ArrayList<>();
 
@@ -513,6 +514,7 @@ public class TestReserve {
         rr.endPointPosition = "VPE-Cust";
         rr.rangeMaxOverride = -1;
         rr.rangeMinOverride = -1;
+        rr.applicationId = "myapp";
 
         List<ResourceResponse> rsList = new ArrayList<>();
         resourceAllocator.reserve(sd, rt, rr, rsList);
@@ -533,6 +535,7 @@ public class TestReserve {
         rr.endPointPosition = "VPE-Core1";
         rr.rangeMaxOverride = -1;
         rr.rangeMinOverride = -1;
+        rr.applicationId = "myapp";
 
         rsList = new ArrayList<>();
         resourceAllocator.reserve(sd, rt, rr, rsList);
@@ -553,6 +556,7 @@ public class TestReserve {
         rr.endPointPosition = "VPE-Core2";
         rr.rangeMaxOverride = -1;
         rr.rangeMinOverride = -1;
+        rr.applicationId = "myapp";
 
         rsList = new ArrayList<>();
         resourceAllocator.reserve(sd, rt, rr, rsList);
@@ -573,6 +577,7 @@ public class TestReserve {
         rr.endPointPosition = "VPE-Core3";
         rr.rangeMaxOverride = -1;
         rr.rangeMinOverride = -1;
+        rr.applicationId = "myapp";
 
         rsList = new ArrayList<>();
         resourceAllocator.reserve(sd, rt, rr, rsList);
@@ -720,6 +725,7 @@ public class TestReserve {
         rr.rangeMaxOverride = 3901;
         rr.rangeMinOverride = 3900;
         rr.resourceType = ResourceType.Range;
+        rr.applicationId = "myapp";
 
         List<ResourceResponse> rsList = new ArrayList<>();
         resourceAllocator.reserve(sd, rt, rr, rsList);
@@ -748,6 +754,7 @@ public class TestReserve {
         rr.rangeMinOverride = -1;
         rr.rangeOverrideList = Arrays.asList(range);
         rr.resourceType = ResourceType.Range;
+        rr.applicationId = "myapp";
 
         rsList = new ArrayList<>();
         resourceAllocator.reserve(sd, rt, rr, rsList);
@@ -781,6 +788,7 @@ public class TestReserve {
         rr.rangeOverrideList = new ArrayList<>();
         rr.rangeOverrideList.add(range1);
         rr.rangeOverrideList.add(range2);
+        rr.applicationId = "myapp";
         rr.resourceType = ResourceType.Range;
 
         rsList = new ArrayList<>();
index ed123dd..275337e 100644 (file)
@@ -124,7 +124,7 @@ CREATE TABLE SERVICE_RESOURCE (
   service_status VARCHAR(10) NOT NULL,
   service_change_number SMALLINT NOT NULL,
     resource_set_id VARCHAR(100) NOT NULL,
-    resource_union_id VARCHAR(100) NOT NULL,
+    resource_union_id VARCHAR(100) NOT NULL
 );
 
 ALTER TABLE SERVICE_RESOURCE ADD CONSTRAINT C1_SERVICE_RESOURCE CHECK (service_status IN ('Active', 'Pending'));