aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2020-07-14 08:55:33 -0400
committerDan Timoney <dtimoney@att.com>2020-08-03 19:29:50 +0000
commit6fb8dfad11c84c0833e842183ec43a4ee95e81de (patch)
tree68048c21cd7244797fa60e572c2c4c48b7f5abb5
parent3960d5fe8a04c505334714516c3144c327bb98c1 (diff)
Update adaptors to sodium
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>
-rwxr-xr-x.gitignore1
-rw-r--r--aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java3
-rw-r--r--features/ccsdk-ansible-adapter/pom.xml6
-rw-r--r--features/ccsdk-saltstack-adapter/pom.xml10
-rw-r--r--mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestMdsalResourceActivator.java49
-rw-r--r--resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java8
-rw-r--r--resource-assignment/provider/src/test/resources/sql/schema.sql2
7 files changed, 69 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index cc576b7b..42cca13b 100755
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@ classes
out/
.DS_STORE
.metadata
+.vscode
provider/src/main/java/META-INF/
provider/src/main/java/inventory/
logs/
diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java
index b0272f5d..f60b2da6 100644
--- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java
+++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutorTest.java
@@ -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);
}
diff --git a/features/ccsdk-ansible-adapter/pom.xml b/features/ccsdk-ansible-adapter/pom.xml
index 32ec5058..da497f56 100644
--- a/features/ccsdk-ansible-adapter/pom.xml
+++ b/features/ccsdk-ansible-adapter/pom.xml
@@ -36,6 +36,12 @@
<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>
diff --git a/features/ccsdk-saltstack-adapter/pom.xml b/features/ccsdk-saltstack-adapter/pom.xml
index ffc43e15..2e51c83b 100644
--- a/features/ccsdk-saltstack-adapter/pom.xml
+++ b/features/ccsdk-saltstack-adapter/pom.xml
@@ -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>
@@ -33,6 +34,13 @@
<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>
diff --git a/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestMdsalResourceActivator.java b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestMdsalResourceActivator.java
index 397915d0..6174bc84 100644
--- a/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestMdsalResourceActivator.java
+++ b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestMdsalResourceActivator.java
@@ -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);
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
index ab2d936c..dbf0c4aa 100644
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
+++ b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
@@ -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<>();
diff --git a/resource-assignment/provider/src/test/resources/sql/schema.sql b/resource-assignment/provider/src/test/resources/sql/schema.sql
index ed123ddd..275337e4 100644
--- a/resource-assignment/provider/src/test/resources/sql/schema.sql
+++ b/resource-assignment/provider/src/test/resources/sql/schema.sql
@@ -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'));