Adding UT for MSO catalogdb POJO 03/17303/2
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>
Thu, 5 Oct 2017 05:09:47 +0000 (10:39 +0530)
committerSeshu Kumar M <seshu.kumar.m@huawei.com>
Thu, 5 Oct 2017 10:41:44 +0000 (10:41 +0000)
UT-Step4

IssueId:SO-172

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

diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceTest.java
new file mode 100644 (file)
index 0000000..12c55e7
--- /dev/null
@@ -0,0 +1,67 @@
+/*-\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.Service;\r
+\r
+/**\r
+ */\r
+\r
+public class ServiceTest {\r
+\r
+       @Test\r
+       public final void recipeDataTest() {\r
+               Service service = new Service();\r
+               service.setCreated(new Timestamp(System.currentTimeMillis()));\r
+               assertTrue(service.getCreated() != null);\r
+               service.setDescription("description");\r
+               assertTrue(service.getDescription().equalsIgnoreCase("description"));\r
+\r
+               service.setModelInvariantUUID("action");\r
+               assertTrue(service.getModelInvariantUUID().equalsIgnoreCase("action"));\r
+\r
+               service.setModelName("modelName");\r
+               assertTrue(service.getModelName().equalsIgnoreCase("modelName"));\r
+\r
+               service.setModelUUID("modelUUID");\r
+               assertTrue(service.getModelUUID().equalsIgnoreCase("modelUUID"));\r
+               service.setModelVersion("modelVersion");\r
+               assertTrue(service.getModelVersion().equalsIgnoreCase("modelVersion"));\r
+               service.setServiceRole("serviceRole");\r
+               assertTrue(service.getServiceRole().equalsIgnoreCase("serviceRole"));\r
+               service.setToscaCsarArtifactUUID("toscaCsarArtifactUUID");\r
+               assertTrue(service.getToscaCsarArtifactUUID().equalsIgnoreCase("toscaCsarArtifactUUID"));\r
+\r
+               service.setServiceType("serviceType");\r
+               assertTrue(service.getServiceType().equalsIgnoreCase("serviceType"));\r
+               service.setRecipes(null);\r
+               assertTrue(service.getRecipes() == null);\r
+               service.setServiceResourceCustomizations(null);\r
+               assertTrue(service.getServiceResourceCustomizations() == null);\r
+\r
+       }\r
+\r
+}\r
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToAllottedResourcesTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToAllottedResourcesTest.java
new file mode 100644 (file)
index 0000000..b2aaeee
--- /dev/null
@@ -0,0 +1,49 @@
+/*-\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.ServiceToAllottedResources;\r
+\r
+/**\r
+ */\r
+\r
+public class ServiceToAllottedResourcesTest {\r
+\r
+       @Test\r
+       public final void serviceToAllottedResourcesDataTest() {\r
+               ServiceToAllottedResources serviceToAllottedResources = new ServiceToAllottedResources();\r
+               serviceToAllottedResources.setArModelCustomizationUuid("arModelCustomizationUuid");\r
+               assertTrue(\r
+                               serviceToAllottedResources.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));\r
+               serviceToAllottedResources.setCreated(new Timestamp(System.currentTimeMillis()));\r
+               assertTrue(serviceToAllottedResources.getCreated() != null);\r
+               serviceToAllottedResources.setServiceModelUuid("serviceModelUuid");\r
+               assertTrue(serviceToAllottedResources.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));\r
+//             assertTrue(serviceToAllottedResources.toString() != null);\r
+\r
+       }\r
+\r
+}\r
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToResourceCustomizationTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToResourceCustomizationTest.java
new file mode 100644 (file)
index 0000000..337cf4b
--- /dev/null
@@ -0,0 +1,49 @@
+/*-\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.ServiceToAllottedResources;\r
+\r
+/**\r
+ */\r
+\r
+public class ServiceToResourceCustomizationTest {\r
+\r
+       @Test\r
+       public final void serviceToResourceCustomizationDataTest() {\r
+               ServiceToAllottedResources serviceToResourceCustomization = new ServiceToAllottedResources();\r
+               serviceToResourceCustomization.setArModelCustomizationUuid("arModelCustomizationUuid");\r
+               assertTrue(\r
+                               serviceToResourceCustomization.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));\r
+               serviceToResourceCustomization.setCreated(new Timestamp(System.currentTimeMillis()));\r
+               assertTrue(serviceToResourceCustomization.getCreated() != null);\r
+               serviceToResourceCustomization.setServiceModelUuid("serviceModelUuid");\r
+               assertTrue(serviceToResourceCustomization.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));\r
+//             assertTrue(serviceToResourceCustomization.toString() != null);\r
+\r
+       }\r
+\r
+}\r