Adding UT for MsoCatalog POJO 85/17185/2
authorseshukm <seshu.kumar.m@huawei.com>
Wed, 4 Oct 2017 08:08:23 +0000 (13:38 +0530)
committerSeshu Kumar M <seshu.kumar.m@huawei.com>
Wed, 4 Oct 2017 11:11:15 +0000 (11:11 +0000)
UT-Step2

IssueId: SO-172

Change-Id: I4aa763ad9cf723f969b9fd9a9ab7eca5b303ade0
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkRecipeTest.java [new file with mode: 0644]
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceCustomizationTest.java [new file with mode: 0644]
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/NetworkResourceTest.java [new file with mode: 0644]

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 (file)
index 0000000..97eadb3
--- /dev/null
@@ -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 (file)
index 0000000..7b54854
--- /dev/null
@@ -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 (file)
index 0000000..11ee57b
--- /dev/null
@@ -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);
+
+       }
+
+}