From 5e3c303a49b2d44e9d4a4751bdba6138bd0ccb91 Mon Sep 17 00:00:00 2001 From: Seshu-Kumar-M Date: Thu, 5 Oct 2017 11:00:23 +0530 Subject: Adding UT for MSO catalogdb POJO UT-Step5 IssueId:SO-172 Change-Id: I008b3587e68350dcc1c5a14069afbf8f0153a35b Signed-off-by: Seshu-Kumar-M --- .../test/TempNetworkHeatTemplateLookupTest.java | 50 ++++++++++++++++ .../mso/db/catalog/test/ToscaCsarTest.java | 57 ++++++++++++++++++ .../db/catalog/test/VfModuleCustomizationTest.java | 70 ++++++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/TempNetworkHeatTemplateLookupTest.java create mode 100644 mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToscaCsarTest.java create mode 100644 mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleCustomizationTest.java (limited to 'mso-catalog-db/src/test/java') 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 index 0000000000..b0ccfdd781 --- /dev/null +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/TempNetworkHeatTemplateLookupTest.java @@ -0,0 +1,50 @@ +/*- + * ============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 org.junit.Test; +import org.openecomp.mso.db.catalog.beans.TempNetworkHeatTemplateLookup; + +/** + */ + +public class TempNetworkHeatTemplateLookupTest { + + @Test + public final void tempNetworkHeatTemplateLookupDataTest() { + TempNetworkHeatTemplateLookup tempNetworkHeatTemplateLookup = new TempNetworkHeatTemplateLookup(); + tempNetworkHeatTemplateLookup.setAicVersionMax("aicVersionMax"); + assertTrue(tempNetworkHeatTemplateLookup.getAicVersionMax().equalsIgnoreCase("aicVersionMax")); + tempNetworkHeatTemplateLookup.setAicVersionMin("aicVersionMin"); + assertTrue(tempNetworkHeatTemplateLookup.getAicVersionMin().equalsIgnoreCase("aicVersionMin")); + tempNetworkHeatTemplateLookup.setHeatTemplateArtifactUuid("heatTemplateArtifactUuid"); + assertTrue(tempNetworkHeatTemplateLookup.getHeatTemplateArtifactUuid() + .equalsIgnoreCase("heatTemplateArtifactUuid")); + tempNetworkHeatTemplateLookup.setNetworkResourceModelName("networkResourceModelName"); + assertTrue(tempNetworkHeatTemplateLookup.getNetworkResourceModelName() + .equalsIgnoreCase("networkResourceModelName")); +// assertTrue(tempNetworkHeatTemplateLookup.toString() != null); + + } + +} 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 index 0000000000..9cbfaa4d2c --- /dev/null +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToscaCsarTest.java @@ -0,0 +1,57 @@ +/*- + * ============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.ToscaCsar; + +/** + */ + +public class ToscaCsarTest { + + @Test + public final void toscaCsarDataTest() { + ToscaCsar toscaCsar = new ToscaCsar(); + toscaCsar.setCreated(new Timestamp(System.currentTimeMillis())); + assertTrue(toscaCsar.getCreated() != null); + toscaCsar.setDescription("description"); + assertTrue(toscaCsar.getDescription().equalsIgnoreCase("description")); + + toscaCsar.setArtifactChecksum("artifactChecksum"); + assertTrue(toscaCsar.getArtifactChecksum().equalsIgnoreCase("artifactChecksum")); + + toscaCsar.setArtifactUUID("artifactUUID"); + assertTrue(toscaCsar.getArtifactUUID().equalsIgnoreCase("artifactUUID")); + + toscaCsar.setName("name"); + assertTrue(toscaCsar.getName().equalsIgnoreCase("name")); + toscaCsar.setUrl("url"); + assertTrue(toscaCsar.getUrl().equalsIgnoreCase("url")); +// assertTrue(toscaCsar.toString() != null); + + } + +} 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 index 0000000000..52d15ee597 --- /dev/null +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleCustomizationTest.java @@ -0,0 +1,70 @@ +/*- + * ============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.VfModule; +import org.openecomp.mso.db.catalog.beans.VfModuleCustomization; + +/** + */ + +public class VfModuleCustomizationTest { + + @Test + public final void vfModuleCustomizationDataTest() { + VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); + vfModuleCustomization.setCreated(new Timestamp(System.currentTimeMillis())); + assertTrue(vfModuleCustomization.getCreated() != null); + vfModuleCustomization.setAvailabilityZoneCount(1); + assertTrue(vfModuleCustomization.getAvailabilityZoneCount() == 1); + vfModuleCustomization.hashCode(); + vfModuleCustomization.setVolEnvironmentArtifactUuid("volEnvironmentArtifactUuid"); + assertTrue( + vfModuleCustomization.getVolEnvironmentArtifactUuid().equalsIgnoreCase("volEnvironmentArtifactUuid")); + + vfModuleCustomization.setHeatEnvironmentArtifactUuid("heatEnvironmentArtifactUuid"); + assertTrue( + vfModuleCustomization.getHeatEnvironmentArtifactUuid().equalsIgnoreCase("heatEnvironmentArtifactUuid")); + + vfModuleCustomization.setInitialCount(1); + assertTrue(vfModuleCustomization.getInitialCount() == 1); + + vfModuleCustomization.setLabel("label"); + assertTrue(vfModuleCustomization.getLabel().equalsIgnoreCase("label")); + vfModuleCustomization.setMaxInstances(2); + assertTrue(vfModuleCustomization.getMaxInstances() == 2); + vfModuleCustomization.setMinInstances(1); + assertTrue(vfModuleCustomization.getMinInstances() == 1); + vfModuleCustomization.setModelCustomizationUuid("modelCustomizationUuid"); + assertTrue(vfModuleCustomization.getModelCustomizationUuid().equalsIgnoreCase("modelCustomizationUuid")); + vfModuleCustomization.setVfModule(new VfModule()); + assertTrue(vfModuleCustomization.getVfModule() != null); + +// assertTrue(vfModuleCustomization.toString() == null); + + } + +} -- cgit 1.2.3-korg