Adding UT for MSO catalogdb POJO 05/17305/2
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>
Thu, 5 Oct 2017 05:30:23 +0000 (11:00 +0530)
committerSeshu Kumar M <seshu.kumar.m@huawei.com>
Thu, 5 Oct 2017 10:06:46 +0000 (10:06 +0000)
UT-Step5

IssueId:SO-172

Change-Id: I008b3587e68350dcc1c5a14069afbf8f0153a35b
Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/TempNetworkHeatTemplateLookupTest.java [new file with mode: 0644]
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToscaCsarTest.java [new file with mode: 0644]
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleCustomizationTest.java [new file with mode: 0644]

diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/TempNetworkHeatTemplateLookupTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/TempNetworkHeatTemplateLookupTest.java
new file mode 100644 (file)
index 0000000..b0ccfdd
--- /dev/null
@@ -0,0 +1,50 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.openecomp.mso.db.catalog.test;\r
+\r
+import static org.junit.Assert.assertTrue;\r
+\r
+import org.junit.Test;\r
+import org.openecomp.mso.db.catalog.beans.TempNetworkHeatTemplateLookup;\r
+\r
+/**\r
+ */\r
+\r
+public class TempNetworkHeatTemplateLookupTest {\r
+\r
+       @Test\r
+       public final void tempNetworkHeatTemplateLookupDataTest() {\r
+               TempNetworkHeatTemplateLookup tempNetworkHeatTemplateLookup = new TempNetworkHeatTemplateLookup();\r
+               tempNetworkHeatTemplateLookup.setAicVersionMax("aicVersionMax");\r
+               assertTrue(tempNetworkHeatTemplateLookup.getAicVersionMax().equalsIgnoreCase("aicVersionMax"));\r
+               tempNetworkHeatTemplateLookup.setAicVersionMin("aicVersionMin");\r
+               assertTrue(tempNetworkHeatTemplateLookup.getAicVersionMin().equalsIgnoreCase("aicVersionMin"));\r
+               tempNetworkHeatTemplateLookup.setHeatTemplateArtifactUuid("heatTemplateArtifactUuid");\r
+               assertTrue(tempNetworkHeatTemplateLookup.getHeatTemplateArtifactUuid()\r
+                               .equalsIgnoreCase("heatTemplateArtifactUuid"));\r
+               tempNetworkHeatTemplateLookup.setNetworkResourceModelName("networkResourceModelName");\r
+               assertTrue(tempNetworkHeatTemplateLookup.getNetworkResourceModelName()\r
+                               .equalsIgnoreCase("networkResourceModelName"));\r
+//             assertTrue(tempNetworkHeatTemplateLookup.toString() != null);\r
+\r
+       }\r
+\r
+}\r
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToscaCsarTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToscaCsarTest.java
new file mode 100644 (file)
index 0000000..9cbfaa4
--- /dev/null
@@ -0,0 +1,57 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.openecomp.mso.db.catalog.test;\r
+\r
+import static org.junit.Assert.assertTrue;\r
+\r
+import java.sql.Timestamp;\r
+\r
+import org.junit.Test;\r
+import org.openecomp.mso.db.catalog.beans.ToscaCsar;\r
+\r
+/**\r
+ */\r
+\r
+public class ToscaCsarTest {\r
+\r
+       @Test\r
+       public final void toscaCsarDataTest() {\r
+               ToscaCsar toscaCsar = new ToscaCsar();\r
+               toscaCsar.setCreated(new Timestamp(System.currentTimeMillis()));\r
+               assertTrue(toscaCsar.getCreated() != null);\r
+               toscaCsar.setDescription("description");\r
+               assertTrue(toscaCsar.getDescription().equalsIgnoreCase("description"));\r
+\r
+               toscaCsar.setArtifactChecksum("artifactChecksum");\r
+               assertTrue(toscaCsar.getArtifactChecksum().equalsIgnoreCase("artifactChecksum"));\r
+\r
+               toscaCsar.setArtifactUUID("artifactUUID");\r
+               assertTrue(toscaCsar.getArtifactUUID().equalsIgnoreCase("artifactUUID"));\r
+\r
+               toscaCsar.setName("name");\r
+               assertTrue(toscaCsar.getName().equalsIgnoreCase("name"));\r
+               toscaCsar.setUrl("url");\r
+               assertTrue(toscaCsar.getUrl().equalsIgnoreCase("url"));\r
+//             assertTrue(toscaCsar.toString() != null);\r
+\r
+       }\r
+\r
+}\r
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleCustomizationTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleCustomizationTest.java
new file mode 100644 (file)
index 0000000..52d15ee
--- /dev/null
@@ -0,0 +1,70 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.openecomp.mso.db.catalog.test;\r
+\r
+import static org.junit.Assert.assertTrue;\r
+\r
+import java.sql.Timestamp;\r
+\r
+import org.junit.Test;\r
+import org.openecomp.mso.db.catalog.beans.VfModule;\r
+import org.openecomp.mso.db.catalog.beans.VfModuleCustomization;\r
+\r
+/**\r
+ */\r
+\r
+public class VfModuleCustomizationTest {\r
+\r
+       @Test\r
+       public final void vfModuleCustomizationDataTest() {\r
+               VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();\r
+               vfModuleCustomization.setCreated(new Timestamp(System.currentTimeMillis()));\r
+               assertTrue(vfModuleCustomization.getCreated() != null);\r
+               vfModuleCustomization.setAvailabilityZoneCount(1);\r
+               assertTrue(vfModuleCustomization.getAvailabilityZoneCount() == 1);\r
+               vfModuleCustomization.hashCode();\r
+               vfModuleCustomization.setVolEnvironmentArtifactUuid("volEnvironmentArtifactUuid");\r
+               assertTrue(\r
+                               vfModuleCustomization.getVolEnvironmentArtifactUuid().equalsIgnoreCase("volEnvironmentArtifactUuid"));\r
+\r
+               vfModuleCustomization.setHeatEnvironmentArtifactUuid("heatEnvironmentArtifactUuid");\r
+               assertTrue(\r
+                               vfModuleCustomization.getHeatEnvironmentArtifactUuid().equalsIgnoreCase("heatEnvironmentArtifactUuid"));\r
+\r
+               vfModuleCustomization.setInitialCount(1);\r
+               assertTrue(vfModuleCustomization.getInitialCount() == 1);\r
+\r
+               vfModuleCustomization.setLabel("label");\r
+               assertTrue(vfModuleCustomization.getLabel().equalsIgnoreCase("label"));\r
+               vfModuleCustomization.setMaxInstances(2);\r
+               assertTrue(vfModuleCustomization.getMaxInstances() == 2);\r
+               vfModuleCustomization.setMinInstances(1);\r
+               assertTrue(vfModuleCustomization.getMinInstances() == 1);\r
+               vfModuleCustomization.setModelCustomizationUuid("modelCustomizationUuid");\r
+               assertTrue(vfModuleCustomization.getModelCustomizationUuid().equalsIgnoreCase("modelCustomizationUuid"));\r
+               vfModuleCustomization.setVfModule(new VfModule());\r
+               assertTrue(vfModuleCustomization.getVfModule() != null);\r
+\r
+//             assertTrue(vfModuleCustomization.toString() == null);\r
+\r
+       }\r
+\r
+}\r