diff options
Diffstat (limited to 'adapters')
11 files changed, 113 insertions, 34 deletions
diff --git a/adapters/mso-adapter-utils/pom.xml b/adapters/mso-adapter-utils/pom.xml index 2efb336161..e264a20d9d 100644 --- a/adapters/mso-adapter-utils/pom.xml +++ b/adapters/mso-adapter-utils/pom.xml @@ -54,34 +54,22 @@ <version>${project.version}</version> </dependency> <dependency> -<!-- <groupId>org.onap.so.libs.openstack-java-sdk</groupId> ---> - <groupId>org.openecomp.so.libs.openstack-java-sdk</groupId> <artifactId>keystone-client</artifactId> <version>${openstack.version}</version> </dependency> <dependency> -<!-- <groupId>org.onap.so.libs.openstack-java-sdk</groupId> ---> - <groupId>org.openecomp.so.libs.openstack-java-sdk</groupId> <artifactId>heat-client</artifactId> <version>${openstack.version}</version> </dependency> <dependency> -<!-- <groupId>org.onap.so.libs.openstack-java-sdk</groupId> ---> - <groupId>org.openecomp.so.libs.openstack-java-sdk</groupId> <artifactId>quantum-client</artifactId> <version>${openstack.version}</version> </dependency> <dependency> -<!-- <groupId>org.onap.so.libs.openstack-java-sdk.client-connectors</groupId> ---> - <groupId>org.openecomp.so.libs.openstack-java-sdk.client-connectors</groupId> <artifactId>http-connector</artifactId> <version>${openstack.version}</version> </dependency> diff --git a/adapters/mso-requests-db-adapter/pom.xml b/adapters/mso-requests-db-adapter/pom.xml index 582d1eafe3..51d9092472 100644 --- a/adapters/mso-requests-db-adapter/pom.xml +++ b/adapters/mso-requests-db-adapter/pom.xml @@ -22,7 +22,7 @@ <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> - <version>3.0.19.Final</version> + <version>3.5.0.Final</version> <scope>provided</scope> <exclusions> <exclusion> diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index 358fe53ecb..925086a9d3 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -70,59 +70,59 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { long startTime = System.currentTimeMillis (); try { session.beginTransaction (); - String queryString = "update InfraActiveRequests set "; + StringBuilder queryString = new StringBuilder("update InfraActiveRequests set "); if (statusMessage != null) { - queryString += "statusMessage = :statusMessage, "; + queryString.append("statusMessage = :statusMessage, "); } if (responseBody != null) { - queryString += "responseBody = :responseBody, "; + queryString.append("responseBody = :responseBody, "); } if (requestStatus != null) { - queryString += "requestStatus = :requestStatus, "; + queryString.append("requestStatus = :requestStatus, "); } if (progress != null) { - queryString += "progress = :progress, "; + queryString.append("progress = :progress, "); } if (vnfOutputs != null) { - queryString += "vnfOutputs = :vnfOutputs, "; + queryString.append("vnfOutputs = :vnfOutputs, "); } if (serviceInstanceId != null) { - queryString += "serviceInstanceId = :serviceInstanceId, "; + queryString.append("serviceInstanceId = :serviceInstanceId, "); } if (networkId != null) { - queryString += "networkId = :networkId, "; + queryString.append("networkId = :networkId, "); } if (vnfId != null) { - queryString += "vnfId = :vnfId, "; + queryString.append("vnfId = :vnfId, "); } if (vfModuleId != null) { - queryString += "vfModuleId = :vfModuleId, "; + queryString.append("vfModuleId = :vfModuleId, "); } if (volumeGroupId != null) { - queryString += "volumeGroupId = :volumeGroupId, "; + queryString.append("volumeGroupId = :volumeGroupId, "); } if (serviceInstanceName != null) { - queryString += "serviceInstanceName = :serviceInstanceName, "; + queryString.append("serviceInstanceName = :serviceInstanceName, "); } if (vfModuleName != null) { - queryString += "vfModuleName = :vfModuleName, "; + queryString.append("vfModuleName = :vfModuleName, "); } if (configurationId != null) { - queryString += "configurationId = :configurationId, "; + queryString.append("configurationId = :configurationId, "); } if (configurationName != null) { - queryString += "configurationName = :configurationName, "; + queryString.append("configurationName = :configurationName, "); } if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) { - queryString += "endTime = :endTime, "; + queryString.append("endTime = :endTime, "); } else { - queryString += "modifyTime = :modifyTime, "; + queryString.append("modifyTime = :modifyTime, "); } - queryString += "lastModifiedBy = :lastModifiedBy where requestId = :requestId OR clientRequestId = :requestId"; + queryString.append("lastModifiedBy = :lastModifiedBy where requestId = :requestId OR clientRequestId = :requestId"); - logger.debug("Executing update: " + queryString); + logger.debug("Executing update: " + queryString.toString()); - Query query = session.createQuery (queryString); + Query query = session.createQuery (queryString.toString()); query.setParameter ("requestId", requestId); if (statusMessage != null) { query.setParameter ("statusMessage", statusMessage); diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterAsyncImplTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterAsyncImplTest.java index acde3153ab..acde3153ab 100644 --- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterAsyncImplTest.java +++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterAsyncImplTest.java diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterImplTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java index eec2257c7f..eec2257c7f 100644 --- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterImplTest.java +++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java new file mode 100644 index 0000000000..076a410262 --- /dev/null +++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java @@ -0,0 +1,91 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.vnf.test;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.ws.Holder;
+import org.junit.Test;
+import org.openecomp.mso.adapters.vnf.MsoVnfCloudifyAdapterImpl;
+import org.openecomp.mso.entity.MsoRequest;
+import org.openecomp.mso.openstack.beans.VnfRollback;
+
+public class MsoVnfCloudifyAdapterImplTest {
+
+ @Test
+ public void healthCheckVNFTest() {
+ MsoVnfCloudifyAdapterImpl instance = new MsoVnfCloudifyAdapterImpl();
+ instance.healthCheck();
+ }
+
+ @Test
+ public void createVnfTest() {
+ MsoVnfCloudifyAdapterImpl instance = new MsoVnfCloudifyAdapterImpl();
+ MsoRequest msoRequest = new MsoRequest();
+ msoRequest.setRequestId("12345");
+ msoRequest.setServiceInstanceId("12345");
+
+ Map<String, String> map = new HashMap<>();
+ map.put("key1", "value1");
+ try {
+ instance.createVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
+ Boolean.FALSE, Boolean.TRUE, msoRequest, new Holder<>(), new Holder<>(),
+ new Holder<>());
+ } catch (Exception e) {
+
+ }
+ }
+
+ @Test
+ public void updateVnfTest() {
+ MsoVnfCloudifyAdapterImpl instance = new MsoVnfCloudifyAdapterImpl();
+ MsoRequest msoRequest = new MsoRequest();
+ msoRequest.setRequestId("12345");
+ msoRequest.setServiceInstanceId("12345");
+
+ Map<String, String> map = new HashMap<>();
+ map.put("key1", "value1");
+ try {
+ instance.updateVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ "volumeGroupHeatStackId|1", "baseVfHeatStackId", "vfModuleStackId",
+ "88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<>(),
+ new Holder<>());
+ } catch (Exception e) {
+
+ }
+ }
+
+ @Test
+ public void deleteVnfTest() {
+ MsoVnfCloudifyAdapterImpl instance = new MsoVnfCloudifyAdapterImpl();
+ MsoRequest msoRequest = new MsoRequest();
+ msoRequest.setRequestId("12345");
+ msoRequest.setServiceInstanceId("12345");
+ try {
+ instance.deleteVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
+ new Holder<>());
+ } catch (Exception e) {
+
+ }
+ }
+
+}
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/QueryTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/QueryTest.java index 282b3b15cd..282b3b15cd 100644 --- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/QueryTest.java +++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/QueryTest.java diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfCreateTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/VnfCreateTest.java index 000ed8aef3..000ed8aef3 100644 --- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfCreateTest.java +++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/VnfCreateTest.java diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfDeleteTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/VnfDeleteTest.java index e9b33eb24a..e9b33eb24a 100644 --- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfDeleteTest.java +++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/VnfDeleteTest.java diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfQueryTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/VnfQueryTest.java index bbffddfd15..bbffddfd15 100644 --- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfQueryTest.java +++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/VnfQueryTest.java diff --git a/adapters/mso-workflow-message-adapter/pom.xml b/adapters/mso-workflow-message-adapter/pom.xml index 46e4a2bc13..dd17fe87e8 100644 --- a/adapters/mso-workflow-message-adapter/pom.xml +++ b/adapters/mso-workflow-message-adapter/pom.xml @@ -55,7 +55,7 @@ <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> - <version>4.5.2</version> + <version>4.5.5</version> </dependency> <dependency> <groupId>org.onap.so</groupId> |