aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseshukm <seshu.kumar.m@huawei.com>2017-10-04 13:38:23 +0530
committerSeshu Kumar M <seshu.kumar.m@huawei.com>2017-10-04 11:11:15 +0000
commit33ef19f5f07ae792d3294e87732c718af926be81 (patch)
treeb6950422a682c5b48d0674df1a230f974636fb45
parent67fca73b228779352f10724c3b874d8aa4e06ed4 (diff)
Adding UT for MsoCatalog POJO
UT-Step2 IssueId: SO-172 Change-Id: I4aa763ad9cf723f969b9fd9a9ab7eca5b303ade0 Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkRecipeTest.java63
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceCustomizationTest.java62
-rw-r--r--mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceTest.java68
3 files changed, 193 insertions, 0 deletions
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkRecipeTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkRecipeTest.java
new file mode 100644
index 0000000000..97eadb3f1d
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkRecipeTest.java
@@ -0,0 +1,63 @@
+/*-
+ * ============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.db.catalog.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Timestamp;
+
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.NetworkRecipe;
+
+/**
+ */
+
+public class NetworkRecipeTest {
+
+ @Test
+ public final void networkRecipeDataTest() {
+
+ NetworkRecipe networkRecipe = new NetworkRecipe();
+ networkRecipe.setAction("action");
+ assertTrue(networkRecipe.getAction().equalsIgnoreCase("action"));
+ networkRecipe.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(networkRecipe.getCreated() != null);
+ networkRecipe.setDescription("description");
+ assertTrue(networkRecipe.getDescription().equalsIgnoreCase("description"));
+ networkRecipe.setId(1);
+ assertTrue(networkRecipe.getId() == 1);
+ networkRecipe.setModelName("modelName");
+ assertTrue(networkRecipe.getModelName().equalsIgnoreCase("modelName"));
+ networkRecipe.setNetworkParamXSD("networkParamXSD");
+ assertTrue(networkRecipe.getNetworkParamXSD().equalsIgnoreCase("networkParamXSD"));
+ networkRecipe.setOrchestrationUri("orchestrationUri");
+ assertTrue(networkRecipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri"));
+ networkRecipe.setRecipeTimeout(1);
+ assertTrue(networkRecipe.getRecipeTimeout() == 1);
+ networkRecipe.setServiceType("serviceType");
+ assertTrue(networkRecipe.getServiceType().equalsIgnoreCase("serviceType"));
+ networkRecipe.setVersion("version");
+ assertTrue(networkRecipe.getVersion().equalsIgnoreCase("version"));
+// assertTrue(networkRecipe.toString() != null);
+
+ }
+
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceCustomizationTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceCustomizationTest.java
new file mode 100644
index 0000000000..7b54854fd9
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceCustomizationTest.java
@@ -0,0 +1,62 @@
+/*-
+ * ============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.db.catalog.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Timestamp;
+
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.NetworkResource;
+import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization;
+
+/**
+ */
+
+public class NetworkResourceCustomizationTest {
+
+ @Test
+ public final void networkResourceCustomizationDataTest() {
+ NetworkResourceCustomization networkResourceCustomization = new NetworkResourceCustomization();
+ networkResourceCustomization.setModelCustomizationUuid("modelCustomizationUuid");
+ assertTrue(networkResourceCustomization.getModelCustomizationUuid().equalsIgnoreCase("modelCustomizationUuid"));
+ networkResourceCustomization.setModelInstanceName("modelInstanceName");
+ assertTrue(networkResourceCustomization.getModelInstanceName().equalsIgnoreCase("modelInstanceName"));
+ networkResourceCustomization.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(networkResourceCustomization.getCreated() != null);
+ networkResourceCustomization.setNetworkResource(new NetworkResource());
+ assertTrue(networkResourceCustomization.getNetworkResource() != null);
+ networkResourceCustomization.setNetworkResourceModelUuid("networkResourceModelUuid");
+ assertTrue(networkResourceCustomization.getNetworkResourceModelUuid()
+ .equalsIgnoreCase("networkResourceModelUuid"));
+ networkResourceCustomization.setNetworkRole("networkRole");
+ assertTrue(networkResourceCustomization.getNetworkRole().equalsIgnoreCase("networkRole"));
+ networkResourceCustomization.setNetworkScope("networkScope");
+ assertTrue(networkResourceCustomization.getNetworkScope().equalsIgnoreCase("networkScope"));
+ networkResourceCustomization.setNetworkTechnology("networkTechnology");
+ assertTrue(networkResourceCustomization.getNetworkTechnology().equalsIgnoreCase("networkTechnology"));
+ networkResourceCustomization.setNetworkType("networkType");
+ assertTrue(networkResourceCustomization.getNetworkType().equalsIgnoreCase("networkType"));
+// assertTrue(networkResourceCustomization.toString() != null);
+
+ }
+
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceTest.java
new file mode 100644
index 0000000000..11ee57b86b
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceTest.java
@@ -0,0 +1,68 @@
+/*-
+ * ============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.db.catalog.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Timestamp;
+
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.NetworkResource;
+
+/**
+ */
+
+public class NetworkResourceTest {
+
+ @Test
+ public final void networkResourceDataTest() {
+ NetworkResource networkResource = new NetworkResource();
+ networkResource.setAicVersionMax("aicVersionMax");
+ assertTrue(networkResource.getAicVersionMax().equalsIgnoreCase("aicVersionMax"));
+ networkResource.setAicVersionMin("aicVersionMin");
+ assertTrue(networkResource.getAicVersionMin().equalsIgnoreCase("aicVersionMin"));
+ networkResource.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(networkResource.getCreated() != null);
+ networkResource.setDescription("description");
+ assertTrue(networkResource.getDescription().equalsIgnoreCase("description"));
+ networkResource.setHeatTemplateArtifactUUID("heatTemplateArtifactUUID");
+ assertTrue(networkResource.getHeatTemplateArtifactUUID().equalsIgnoreCase("heatTemplateArtifactUUID"));
+ networkResource.setModelInvariantUUID("modelInvariantUUID");
+ assertTrue(networkResource.getModelInvariantUUID().equalsIgnoreCase("modelInvariantUUID"));
+ networkResource.setModelName("modelName");
+ assertTrue(networkResource.getModelName().equalsIgnoreCase("modelName"));
+ networkResource.setModelUUID("modelUUID");
+ assertTrue(networkResource.getModelUUID().equalsIgnoreCase("modelUUID"));
+ networkResource.setModelVersion("modelVersion");
+ assertTrue(networkResource.getModelVersion().equalsIgnoreCase("modelVersion"));
+ networkResource.setNeutronNetworkType("neutronNetworkType");
+ assertTrue(networkResource.getNeutronNetworkType().equalsIgnoreCase("neutronNetworkType"));
+ networkResource.setOrchestrationMode("orchestrationMode");
+ assertTrue(networkResource.getOrchestrationMode().equalsIgnoreCase("orchestrationMode"));
+ networkResource.setToscaNodeType("toscaNodeType");
+ assertTrue(networkResource.getToscaNodeType().equalsIgnoreCase("toscaNodeType"));
+ networkResource.setVersion("1");
+ assertTrue(networkResource.getVersion().equalsIgnoreCase("1"));
+// assertTrue(networkResource.toString() != null);
+
+ }
+
+}