aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java5
-rw-r--r--adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java2
-rw-r--r--docs/ONAP SO Debug Env Setup.docx (renamed from doc/ONAP SO Debug Env Setup.docx)bin950291 -> 950291 bytes
-rw-r--r--docs/index.rst8
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java111
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToStringTest.java151
7 files changed, 277 insertions, 1 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
index 684933f3a9..52286fd3ac 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
@@ -82,6 +82,7 @@ public class VfcAdapterRest {
RestfulResponse rsp = driverMgr.createNs(nsInput);
return buildResponse(rsp);
} catch(ApplicationException e) {
+ LOGGER.debug("ApplicationException: ", e);
return e.buildErrorResponse();
}
}
@@ -107,6 +108,7 @@ public class VfcAdapterRest {
RestfulResponse rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
return buildResponse(rsp);
} catch(ApplicationException e) {
+ LOGGER.debug("ApplicationException: ", e);
return e.buildErrorResponse();
}
}
@@ -135,6 +137,7 @@ public class VfcAdapterRest {
RestfulResponse rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
return buildResponse(rsp);
} catch(ApplicationException e) {
+ LOGGER.debug("ApplicationException: ", e);
return e.buildErrorResponse();
}
}
@@ -161,6 +164,7 @@ public class VfcAdapterRest {
RestfulResponse rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
return buildResponse(rsp);
} catch(ApplicationException e) {
+ LOGGER.debug("ApplicationException: ", e);
return e.buildErrorResponse();
}
}
@@ -188,6 +192,7 @@ public class VfcAdapterRest {
RestfulResponse rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
return buildResponse(rsp);
} catch(ApplicationException e) {
+ LOGGER.debug("ApplicationException: ", e);
return e.buildErrorResponse();
}
}
diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java
index 7df05f8b43..9afe3bff36 100644
--- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java
+++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/BpelRestClient.java
@@ -282,6 +282,7 @@ public class BpelRestClient {
client.close();
} catch (IOException e) {
// ignore
+ LOGGER.debug("IOException: ", e);
}
}
LOGGER.debug("Response code from BPEL server: "+lastResponseCode);
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
index 8832fe1a1c..8d2cb1ef7f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
@@ -73,7 +73,7 @@ public class SdncUnderlayVpnOperationClient {
try {
networkRpcOutputEntiy = genericResourceApiClient.postNetworkTopologyOperation(body).execute().body();
} catch (Exception e) {
- e.printStackTrace();
+ logger.debug("Exception: ", e);
updateProgress(RequestsDbConstant.Status.ERROR, null, null, "sendRestrequestAndHandleResponse exception:" + e.getMessage());
return false;
}
diff --git a/doc/ONAP SO Debug Env Setup.docx b/docs/ONAP SO Debug Env Setup.docx
index 6d96c0dea1..6d96c0dea1 100644
--- a/doc/ONAP SO Debug Env Setup.docx
+++ b/docs/ONAP SO Debug Env Setup.docx
Binary files differ
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000000..6d479755c5
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,8 @@
+SO Documentation
+=================
+
+.. toctree::
+ :maxdepth: 2
+
+ releases/index
+ onap-developer/index \ No newline at end of file
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java
index 79a2da722e..a00079d8a9 100644
--- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java
@@ -643,4 +643,115 @@ public class CatalogDatabaseTest {
VfModuleCustomization ar = new VfModuleCustomization();
cd.saveOrUpdateVfModuleCustomization(ar);
}
+
+ @Test(expected = Exception.class)
+ public void getNestedHeatTemplateTest(){
+ cd.getNestedHeatTemplate(101,201);
+ }
+ @Test(expected = Exception.class)
+ public void getNestedHeatTemplate2Test(){
+ cd.getNestedHeatTemplate("1002","1002");
+ }
+ @Test(expected = Exception.class)
+ public void saveNestedHeatTemplateTest(){
+ HeatTemplate ar = new HeatTemplate();
+ cd.saveNestedHeatTemplate("1001",ar,"test");
+ }
+ @Test(expected = Exception.class)
+ public void getHeatFiles2Test(){
+ VfModuleCustomization ar = new VfModuleCustomization();
+ cd.getHeatFiles(101,"test","1001","v2");
+ }
+ @Test(expected = Exception.class)
+ public void getHeatFiles3Test(){
+ VfModuleCustomization ar = new VfModuleCustomization();
+ cd.getHeatFiles("200192");
+ }
+ @Test(expected = Exception.class)
+ public void saveHeatFilesTest(){
+ HeatFiles ar = new HeatFiles();
+ cd.saveHeatFiles(ar);
+ }
+ @Test(expected = Exception.class)
+ public void saveVfModuleToHeatFilesTest(){
+ HeatFiles ar = new HeatFiles();
+ cd.saveVfModuleToHeatFiles("3772893",ar);
+ }
+ @Test
+ public void getNetworkResourceByModelUuidTest(){
+
+ cd.getNetworkResourceByModelUuid("3899291");
+ }
+ @Test(expected = Exception.class)
+ public void getNetworkRecipeTest(){
+
+ cd.getNetworkRecipe("test","test1","test2");
+ }
+ @Test(expected = Exception.class)
+ public void getNetworkRecipe2Test(){
+
+ cd.getNetworkRecipe("test","test1");
+ }
+ @Test
+ public void getNetworkResourceByModelCustUuidTest(){
+
+ cd.getNetworkResourceByModelCustUuid("test");
+ }
+ @Test(expected = Exception.class)
+ public void getVnfComponentsRecipe2Test(){
+
+ cd.getVnfComponentsRecipe("test1","test2","test3","test4");
+ }
+ @Test(expected = Exception.class)
+ public void getVnfComponentsRecipeByVfModuleModelUUIdTest(){
+
+ cd.getVnfComponentsRecipeByVfModuleModelUUId("test1","test2","test3");
+ }
+ @Test(expected = Exception.class)
+ public void getVnfComponentRecipesTest(){
+
+ cd.getVnfComponentRecipes("test");
+ }
+ @Test(expected = Exception.class)
+ public void saveOrUpdateVnfComponentTest(){
+ VnfComponent ar = new VnfComponent();
+ cd.saveOrUpdateVnfComponent(ar);
+ }
+
+ @Test(expected = Exception.class)
+ public void getVfModule2Test(){
+
+ cd.getVfModule("test");
+ }
+ @Test(expected = Exception.class)
+ public void getVfModuleByModelUUIDTest(){
+
+ cd.getVfModuleByModelUUID("test");
+ }
+ @Test(expected = Exception.class)
+ public void getServiceRecipeByModelUUIDTest(){
+
+ cd.getServiceRecipeByModelUUID("test1","test2");
+ }
+ @Test(expected = Exception.class)
+ public void getModelRecipeTest(){
+
+ cd.getModelRecipe("test1","test2","test3");
+ }
+ @Test(expected = Exception.class)
+ public void healthCheck(){
+
+ cd.healthCheck();
+ }
+ @Test(expected = Exception.class)
+ public void executeQuerySingleRow(){
+ VnfComponent ar = new VnfComponent();
+ HashMap<String, String> variables = new HashMap<String, String>();
+ cd.executeQuerySingleRow("tets",variables,false);
+ }
+ @Test(expected = Exception.class)
+ public void executeQueryMultipleRows(){
+ HashMap<String, String> variables = new HashMap<String, String>();
+ cd.executeQueryMultipleRows("select",variables,false);
+ }
}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToStringTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToStringTest.java
new file mode 100644
index 0000000000..05e857f178
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToStringTest.java
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.db.catalog.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization;
+import org.openecomp.mso.db.catalog.beans.HeatFiles;
+import org.openecomp.mso.db.catalog.beans.Model;
+import org.openecomp.mso.db.catalog.beans.ModelRecipe;
+import org.openecomp.mso.db.catalog.beans.NetworkResource;
+import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization;
+import org.openecomp.mso.db.catalog.beans.Service;
+import org.openecomp.mso.db.catalog.beans.ServiceMacroHolder;
+import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
+import org.openecomp.mso.db.catalog.beans.ServiceToResourceCustomization;
+import org.openecomp.mso.db.catalog.beans.TempNetworkHeatTemplateLookup;
+import org.openecomp.mso.db.catalog.beans.VfModule;
+import org.openecomp.mso.db.catalog.beans.VnfComponent;
+import org.openecomp.mso.db.catalog.beans.VnfResource;
+import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization;
+
+public class ToStringTest {
+
+ @Test
+ public void testTModelRecipeToString(){
+ ModelRecipe mr = new ModelRecipe();
+ mr.setCreated(new Timestamp(10001));
+ mr.setModelId(102);
+ mr.setRecipeTimeout(100);
+ String str = mr.toString();
+ assertTrue(str != null);
+ }
+
+ @Test
+ public void networkResourcetoStringTest(){
+ NetworkResource nr = new NetworkResource();
+ nr.setCreated(new Timestamp(10000));
+ String str = nr.toString();
+ assertTrue(str != null);
+ }
+
+ @Test
+ public void modelTestToString(){
+ Model m = new Model();
+ m.setCreated(new Timestamp(100000));
+ m.setId(1001);
+ m.setModelCustomizationId("10012");
+ String str = m.toString();
+ assertTrue(str != null);
+ }
+
+ @Test
+ public void serviceMacroHolderTest(){
+ ServiceMacroHolder smh = new ServiceMacroHolder();
+ Service service = new Service();
+ Map<String,ServiceRecipe> recipes = new HashMap<>();
+ recipes.put("test", new ServiceRecipe());
+ service.setRecipes(recipes);
+
+ Set<ServiceToResourceCustomization> serviceResourceCustomizations = new HashSet<>();
+ ServiceToResourceCustomization sr = new ServiceToResourceCustomization();
+ serviceResourceCustomizations.add(sr);
+ service.setServiceResourceCustomizations(serviceResourceCustomizations);
+ smh.setService(service);
+
+ ArrayList<VnfResource> vnflist = new ArrayList<>();
+ smh.setVnfResources(vnflist);
+
+ VnfResource vr = new VnfResource();
+ Set<VnfResourceCustomization> vnfResourceCustomization = new HashSet<>();
+ vnfResourceCustomization.add(new VnfResourceCustomization());
+ vr.setVnfResourceCustomizations(vnfResourceCustomization);
+
+ Set<VfModule> vfModules = new HashSet<>();
+ vfModules.add(new VfModule());
+ vr.setVfModules(vfModules);
+ smh.addVnfResource(vr);
+
+ ArrayList<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>();
+ smh.setVnfResourceCustomizations(vnfResourceCustomizations);
+
+ VnfResourceCustomization vrc = new VnfResourceCustomization();
+ smh.addVnfResourceCustomizations(vrc);
+
+ ArrayList<NetworkResourceCustomization> networkResourceCustomizations = new ArrayList<>();
+ smh.setNetworkResourceCustomization(networkResourceCustomizations);
+
+ NetworkResourceCustomization nrc = new NetworkResourceCustomization();
+ smh.addNetworkResourceCustomization(nrc);
+
+ ArrayList<AllottedResourceCustomization> allottedResourceCustomizations = new ArrayList<>();
+ smh.setAllottedResourceCustomization(allottedResourceCustomizations);
+
+ AllottedResourceCustomization arc = new AllottedResourceCustomization();
+ smh.addAllottedResourceCustomization(arc);
+
+ String str = smh.toString();
+ assertTrue(str != null);
+ }
+
+ @Test
+ public void heatFilesTest(){
+ HeatFiles hf = new HeatFiles();
+ String str = hf.toString();
+ assertTrue(str != null);
+
+ }
+
+ @Test
+ public void testVnfConponent(){
+ VnfComponent vnf = new VnfComponent();
+ String str = vnf.toString();
+ assertTrue(str != null);
+ }
+
+ @Test
+ public void testTempNetworkHeatTemplateLookup(){
+ TempNetworkHeatTemplateLookup tn =new TempNetworkHeatTemplateLookup();
+ String str = tn.toString();
+ assertTrue(str != null);
+ }
+
+
+}