diff options
author | Marcus G K Williams <marcus.williams@intel.com> | 2018-03-07 18:17:22 -0800 |
---|---|---|
committer | Marcus G K Williams <marcus.williams@intel.com> | 2018-03-08 09:17:48 -0800 |
commit | 327b17ab250b4c17cf3f91f5e4cd9bffd89f3d1e (patch) | |
tree | 0d943226962ae31c0bf2fd0696e91c6bb41d099c /mso-catalog-db/src/test/java/org | |
parent | dee036198ee09d71bfdd50247c1d23a7f472df87 (diff) |
Reduce log noise/warnings format to conventions
Reduce build log warnings by formatting tests
to ONAP code conventions (removing tabs etc.)
Issue-ID: SO-368
Change-Id: I48c6d359b83617aebeb79db4e30c1d72d31f7eec
Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'mso-catalog-db/src/test/java/org')
22 files changed, 1059 insertions, 954 deletions
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java index 3cab4f243b..c51cd624a4 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java @@ -63,13 +63,13 @@ public class CatalogDatabaseTest { CatalogDatabase cd = null; @Before - public void setup(){ + public void setup() { cd = CatalogDatabase.getInstance(); } @Test - public void getAllHeatTemplatesTest(){ + public void getAllHeatTemplatesTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -93,12 +93,12 @@ public class CatalogDatabaseTest { } }; - List <HeatTemplate> list = cd.getAllHeatTemplates(); + List<HeatTemplate> list = cd.getAllHeatTemplates(); assertEquals(list.size(), 1); } @Test - public void getHeatTemplateByIdTest(){ + public void getHeatTemplateByIdTest() { MockUp<Session> mockedSession = new MockUp<Session>() { @Mock @@ -121,7 +121,7 @@ public class CatalogDatabaseTest { } @Test - public void getHeatTemplateByNameEmptyListTest(){ + public void getHeatTemplateByNameEmptyListTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -150,7 +150,7 @@ public class CatalogDatabaseTest { } @Test - public void getHeatTemplateByNameTest(){ + public void getHeatTemplateByNameTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -209,7 +209,7 @@ public class CatalogDatabaseTest { } }; - HeatTemplate ht = cd.getHeatTemplate("heat123","v2"); + HeatTemplate ht = cd.getHeatTemplate("heat123", "v2"); assertEquals("1234-uuid", ht.getAsdcUuid()); } @@ -237,12 +237,12 @@ public class CatalogDatabaseTest { } }; - HeatTemplate ht = cd.getHeatTemplate("heat123","v2"); + HeatTemplate ht = cd.getHeatTemplate("heat123", "v2"); assertEquals(null, ht); } @Test - public void getHeatTemplateByArtifactUuidException(){ + public void getHeatTemplateByArtifactUuidException() { MockUp<Session> mockedSession = new MockUp<Session>() { @Mock @@ -265,7 +265,7 @@ public class CatalogDatabaseTest { } @Test - public void getHeatTemplateByArtifactUuidTest(){ + public void getHeatTemplateByArtifactUuidTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -296,7 +296,7 @@ public class CatalogDatabaseTest { } @Test(expected = HibernateException.class) - public void getHeatTemplateByArtifactUuidHibernateErrorTest(){ + public void getHeatTemplateByArtifactUuidHibernateErrorTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -324,7 +324,7 @@ public class CatalogDatabaseTest { } @Test(expected = NonUniqueResultException.class) - public void getHeatTemplateByArtifactUuidNonUniqueResultTest(){ + public void getHeatTemplateByArtifactUuidNonUniqueResultTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -352,7 +352,7 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getHeatTemplateByArtifactUuidGenericExceptionTest(){ + public void getHeatTemplateByArtifactUuidGenericExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -380,7 +380,7 @@ public class CatalogDatabaseTest { } @Test - public void getParametersForHeatTemplateTest(){ + public void getParametersForHeatTemplateTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -410,7 +410,7 @@ public class CatalogDatabaseTest { } @Test(expected = HibernateException.class) - public void getParametersForHeatTemplateHibernateExceptionTest(){ + public void getParametersForHeatTemplateHibernateExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -437,7 +437,7 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getParametersForHeatTemplateExceptionTest(){ + public void getParametersForHeatTemplateExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -464,7 +464,7 @@ public class CatalogDatabaseTest { } @Test - public void getHeatEnvironmentByArtifactUuidTest(){ + public void getHeatEnvironmentByArtifactUuidTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -495,7 +495,7 @@ public class CatalogDatabaseTest { } @Test(expected = HibernateException.class) - public void getHeatEnvironmentByArtifactUuidHibernateExceptionTest(){ + public void getHeatEnvironmentByArtifactUuidHibernateExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -523,7 +523,7 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getHeatEnvironmentByArtifactUuidExceptionTest(){ + public void getHeatEnvironmentByArtifactUuidExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -551,7 +551,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceByInvariantUUIDTest(){ + public void getServiceByInvariantUUIDTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -582,7 +582,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceByInvariantUUIDEmptyResultTest(){ + public void getServiceByInvariantUUIDEmptyResultTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -611,7 +611,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceTest(){ + public void getServiceTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -642,7 +642,7 @@ public class CatalogDatabaseTest { } @Test(expected = NonUniqueResultException.class) - public void getServiceNoUniqueResultTest(){ + public void getServiceNoUniqueResultTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -670,7 +670,7 @@ public class CatalogDatabaseTest { } @Test(expected = HibernateException.class) - public void getServiceHibernateExceptionTest(){ + public void getServiceHibernateExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -698,7 +698,7 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getServiceExceptionTest(){ + public void getServiceExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -726,7 +726,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceByModelUUIDTest(){ + public void getServiceByModelUUIDTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -756,7 +756,7 @@ public class CatalogDatabaseTest { } @Test - public void getService2Test(){ + public void getService2Test() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -789,7 +789,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceByModelNameTest(){ + public void getServiceByModelNameTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -819,7 +819,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceByModelNameEmptyTest(){ + public void getServiceByModelNameEmptyTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -847,7 +847,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceByVersionAndInvariantIdTest() throws Exception{ + public void getServiceByVersionAndInvariantIdTest() throws Exception { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -872,12 +872,12 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - Service service = cd.getServiceByVersionAndInvariantId("123","tetwe"); + Service service = cd.getServiceByVersionAndInvariantId("123", "tetwe"); assertEquals("123-uuid", service.getModelUUID()); } @Test(expected = Exception.class) - public void getServiceByVersionAndInvariantIdNonUniqueResultTest() throws Exception{ + public void getServiceByVersionAndInvariantIdNonUniqueResultTest() throws Exception { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -900,12 +900,12 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - Service service = cd.getServiceByVersionAndInvariantId("123","tetwe"); + Service service = cd.getServiceByVersionAndInvariantId("123", "tetwe"); } @Test(expected = Exception.class) - public void getServiceRecipeTestException() throws Exception{ - ServiceRecipe ht = cd.getServiceRecipe("123","tetwe"); + public void getServiceRecipeTestException() throws Exception { + ServiceRecipe ht = cd.getServiceRecipe("123", "tetwe"); } @Test @@ -932,7 +932,7 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - ServiceRecipe serviceRecipe = cd.getServiceRecipeByServiceModelUuid("123","tetwe"); + ServiceRecipe serviceRecipe = cd.getServiceRecipeByServiceModelUuid("123", "tetwe"); assertEquals(1, serviceRecipe.getId()); } @@ -958,12 +958,12 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - ServiceRecipe serviceRecipe = cd.getServiceRecipeByServiceModelUuid("123","tetwe"); + ServiceRecipe serviceRecipe = cd.getServiceRecipeByServiceModelUuid("123", "tetwe"); assertEquals(null, serviceRecipe); } @Test - public void getServiceRecipesTestException() throws Exception{ + public void getServiceRecipesTestException() throws Exception { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<ServiceRecipe> list() { @@ -991,7 +991,7 @@ public class CatalogDatabaseTest { } @Test - public void getServiceRecipesEmptyTest() throws Exception{ + public void getServiceRecipesEmptyTest() throws Exception { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<ServiceRecipe> list() { @@ -1017,12 +1017,12 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getVnfComponentTestException() throws Exception{ - VnfComponent ht = cd.getVnfComponent(123,"vnf"); + public void getVnfComponentTestException() throws Exception { + VnfComponent ht = cd.getVnfComponent(123, "vnf"); } @Test - public void getVnfResourceTest() throws Exception{ + public void getVnfResourceTest() throws Exception { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfResource> list() { @@ -1050,7 +1050,7 @@ public class CatalogDatabaseTest { } @Test - public void getVnfResourceEmptyTest() throws Exception{ + public void getVnfResourceEmptyTest() throws Exception { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfResource> list() { @@ -1100,7 +1100,7 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - VnfResource vnfResource = cd.getVnfResource("vnf","3992"); + VnfResource vnfResource = cd.getVnfResource("vnf", "3992"); assertEquals("123-uuid", vnfResource.getModelUuid()); } @@ -1127,7 +1127,7 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - VnfResource vnfResource = cd.getVnfResource("vnf","3992"); + VnfResource vnfResource = cd.getVnfResource("vnf", "3992"); } @Test(expected = HibernateException.class) @@ -1153,7 +1153,7 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - VnfResource vnfResource = cd.getVnfResource("vnf","3992"); + VnfResource vnfResource = cd.getVnfResource("vnf", "3992"); } @Test(expected = Exception.class) @@ -1179,7 +1179,7 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - VnfResource vnfResource = cd.getVnfResource("vnf","3992"); + VnfResource vnfResource = cd.getVnfResource("vnf", "3992"); } @Test @@ -1209,7 +1209,7 @@ public class CatalogDatabaseTest { }; VnfResource vnfResource = cd.getVnfResourceByModelCustomizationId("3992"); - assertEquals("123-uuid",vnfResource.getModelUuid()); + assertEquals("123-uuid", vnfResource.getModelUuid()); } @Test(expected = NonUniqueResultException.class) @@ -1268,12 +1268,12 @@ public class CatalogDatabaseTest { @Test(expected = Exception.class) - public void getServiceRecipeTest2Exception() throws Exception{ - ServiceRecipe ht = cd.getServiceRecipe(1001,"3992"); + public void getServiceRecipeTest2Exception() throws Exception { + ServiceRecipe ht = cd.getServiceRecipe(1001, "3992"); } @Test - public void getVnfResourceCustomizationByModelCustomizationNameTest(){ + public void getVnfResourceCustomizationByModelCustomizationNameTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfResourceCustomization> list() throws Exception { @@ -1301,7 +1301,7 @@ public class CatalogDatabaseTest { } @Test - public void getVnfResourceCustomizationByModelCustomizationNameEmptyTest(){ + public void getVnfResourceCustomizationByModelCustomizationNameEmptyTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfResourceCustomization> list() throws Exception { @@ -1327,11 +1327,11 @@ public class CatalogDatabaseTest { } @Test - public void getVnfResourceByModelInvariantIdTest(){ + public void getVnfResourceByModelInvariantIdTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock - public Object uniqueResult(){ + public Object uniqueResult() { VnfResource vnfResource = new VnfResource(); vnfResource.setModelUuid("123-uuid"); return vnfResource; @@ -1356,11 +1356,11 @@ public class CatalogDatabaseTest { } @Test(expected = NonUniqueResultException.class) - public void getVnfResourceByModelInvariantIdNURExceptionTest(){ + public void getVnfResourceByModelInvariantIdNURExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock - public Object uniqueResult(){ + public Object uniqueResult() { throw new NonUniqueResultException(-1); } }; @@ -1382,11 +1382,11 @@ public class CatalogDatabaseTest { } @Test(expected = HibernateException.class) - public void getVnfResourceByModelInvariantIdHibernateExceptionTest(){ + public void getVnfResourceByModelInvariantIdHibernateExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock - public Object uniqueResult(){ + public Object uniqueResult() { throw new HibernateException("hibernate exception"); } }; @@ -1408,7 +1408,7 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getVnfResourceByModelInvariantIdExceptionTest(){ + public void getVnfResourceByModelInvariantIdExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -1434,12 +1434,12 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getVnfResourceByIdTestException(){ + public void getVnfResourceByIdTestException() { VnfResource vnf = cd.getVnfResourceById(19299); } @Test - public void getVfModuleModelName(){ + public void getVfModuleModelName() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VfModule> list() throws Exception { @@ -1467,7 +1467,7 @@ public class CatalogDatabaseTest { } @Test - public void getVfModuleModelNameExceptionTest(){ + public void getVfModuleModelNameExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VfModule> list() throws Exception { @@ -1518,7 +1518,7 @@ public class CatalogDatabaseTest { } }; - VfModule vfModule = cd.getVfModuleModelName("tetes","4kidsl"); + VfModule vfModule = cd.getVfModuleModelName("tetes", "4kidsl"); assertEquals("123-uuid", vfModule.getModelUUID()); } @@ -1546,7 +1546,7 @@ public class CatalogDatabaseTest { } }; - VfModule vfModule = cd.getVfModuleModelName("tetes","4kidsl"); + VfModule vfModule = cd.getVfModuleModelName("tetes", "4kidsl"); } @Test(expected = HibernateException.class) @@ -1573,7 +1573,7 @@ public class CatalogDatabaseTest { } }; - VfModule vfModule = cd.getVfModuleModelName("tetes","4kidsl"); + VfModule vfModule = cd.getVfModuleModelName("tetes", "4kidsl"); } @Test(expected = Exception.class) @@ -1600,11 +1600,11 @@ public class CatalogDatabaseTest { } }; - VfModule vfModule = cd.getVfModuleModelName("tetes","4kidsl"); + VfModule vfModule = cd.getVfModuleModelName("tetes", "4kidsl"); } @Test - public void ggetVfModuleCustomizationByModelNameTest(){ + public void ggetVfModuleCustomizationByModelNameTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VfModuleCustomization> list() throws Exception { @@ -1632,7 +1632,7 @@ public class CatalogDatabaseTest { } @Test - public void ggetVfModuleCustomizationByModelNameEmptyTest(){ + public void ggetVfModuleCustomizationByModelNameEmptyTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VfModuleCustomization> list() throws Exception { @@ -1658,7 +1658,7 @@ public class CatalogDatabaseTest { } @Test - public void getNetworkResourceTest(){ + public void getNetworkResourceTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<NetworkResource> list() throws Exception { @@ -1686,7 +1686,7 @@ public class CatalogDatabaseTest { } @Test - public void getNetworkResourceTestEmptyException(){ + public void getNetworkResourceTestEmptyException() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<NetworkResource> list() throws Exception { @@ -1712,7 +1712,7 @@ public class CatalogDatabaseTest { } @Test - public void getVnfRecipeTest(){ + public void getVnfRecipeTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -1737,12 +1737,12 @@ public class CatalogDatabaseTest { } }; - VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes","ergfedrf","4993493"); + VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes", "ergfedrf", "4993493"); assertEquals("123-id", vnfRecipe.getVfModuleId()); } @Test - public void getVnfRecipeEmptyTest(){ + public void getVnfRecipeEmptyTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -1765,12 +1765,12 @@ public class CatalogDatabaseTest { } }; - VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes","ergfedrf","4993493"); + VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes", "ergfedrf", "4993493"); assertEquals(null, vnfRecipe); } @Test - public void getVnfRecipe2Test(){ + public void getVnfRecipe2Test() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfRecipe> list() throws Exception { @@ -1793,12 +1793,12 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes","4993493"); + VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes", "4993493"); assertEquals(1, vnfRecipe.getId()); } @Test - public void getVnfRecipe2EmptyTest(){ + public void getVnfRecipe2EmptyTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfRecipe> list() throws Exception { @@ -1819,12 +1819,12 @@ public class CatalogDatabaseTest { return mockedSession.getMockInstance(); } }; - VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes","4993493"); + VnfRecipe vnfRecipe = cd.getVnfRecipe("tetes", "4993493"); assertEquals(null, vnfRecipe); } @Test - public void getVnfRecipeByVfModuleIdTest(){ + public void getVnfRecipeByVfModuleIdTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfRecipe> list() throws Exception { @@ -1848,12 +1848,12 @@ public class CatalogDatabaseTest { } }; - VnfRecipe vnfRecipe = cd.getVnfRecipeByVfModuleId("tetes","4993493","vnf"); + VnfRecipe vnfRecipe = cd.getVnfRecipeByVfModuleId("tetes", "4993493", "vnf"); assertEquals(1, vnfRecipe.getId()); } @Test - public void getVnfRecipeByVfModuleIdEmptyTest(){ + public void getVnfRecipeByVfModuleIdEmptyTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock public List<VnfRecipe> list() throws Exception { @@ -1875,21 +1875,22 @@ public class CatalogDatabaseTest { } }; - VnfRecipe vnfRecipe = cd.getVnfRecipeByVfModuleId("tetes","4993493","vnf"); + VnfRecipe vnfRecipe = cd.getVnfRecipeByVfModuleId("tetes", "4993493", "vnf"); assertEquals(null, vnfRecipe); } @Test(expected = Exception.class) - public void getVfModuleTypeTestException(){ + public void getVfModuleTypeTestException() { VfModule vnf = cd.getVfModuleType("4993493"); } @Test(expected = Exception.class) - public void getVfModuleType2TestException(){ - VfModule vnf = cd.getVfModuleType("4993493","vnf"); + public void getVfModuleType2TestException() { + VfModule vnf = cd.getVfModuleType("4993493", "vnf"); } + @Test - public void getVnfResourceByServiceUuidTest(){ + public void getVnfResourceByServiceUuidTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -1918,7 +1919,7 @@ public class CatalogDatabaseTest { } @Test(expected = NonUniqueResultException.class) - public void getVnfResourceByServiceUuidNURExceptionTest(){ + public void getVnfResourceByServiceUuidNURExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -1944,7 +1945,7 @@ public class CatalogDatabaseTest { } @Test(expected = HibernateException.class) - public void getVnfResourceByServiceUuidHibernateExceptionTest(){ + public void getVnfResourceByServiceUuidHibernateExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -1970,7 +1971,7 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getVnfResourceByServiceUuidExceptionTest(){ + public void getVnfResourceByServiceUuidExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -1996,7 +1997,7 @@ public class CatalogDatabaseTest { } @Test - public void getVnfResourceByVnfUuidTest(){ + public void getVnfResourceByVnfUuidTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -2026,7 +2027,7 @@ public class CatalogDatabaseTest { } @Test(expected = NonUniqueResultException.class) - public void getVnfResourceByVnfUuidNURExceptionTest(){ + public void getVnfResourceByVnfUuidNURExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -2053,7 +2054,7 @@ public class CatalogDatabaseTest { } @Test(expected = HibernateException.class) - public void getVnfResourceByVnfUuidHibernateExceptionTest(){ + public void getVnfResourceByVnfUuidHibernateExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -2080,7 +2081,7 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getVnfResourceByVnfUuidExceptionTest(){ + public void getVnfResourceByVnfUuidExceptionTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @Mock @@ -2107,7 +2108,7 @@ public class CatalogDatabaseTest { } @Test - public void getVfModuleByModelInvariantUuidTest(){ + public void getVfModuleByModelInvariantUuidTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -2138,7 +2139,7 @@ public class CatalogDatabaseTest { } @Test - public void getVfModuleByModelInvariantUuidEmptyTest(){ + public void getVfModuleByModelInvariantUuidEmptyTest() { MockUp<Query> mockUpQuery = new MockUp<Query>() { @@ -2167,370 +2168,450 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void getVfModuleByModelCustomizationUuidTestException(){ + public void getVfModuleByModelCustomizationUuidTestException() { VfModuleCustomization vnf = cd.getVfModuleByModelCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getVfModuleByModelInvariantUuidAndModelVersionTestException(){ - VfModule vnf = cd.getVfModuleByModelInvariantUuidAndModelVersion("4993493","vnf"); + public void getVfModuleByModelInvariantUuidAndModelVersionTestException() { + VfModule vnf = cd.getVfModuleByModelInvariantUuidAndModelVersion("4993493", "vnf"); } + @Test(expected = Exception.class) - public void getVfModuleCustomizationByModelCustomizationIdTestException(){ + public void getVfModuleCustomizationByModelCustomizationIdTestException() { VfModuleCustomization vnf = cd.getVfModuleCustomizationByModelCustomizationId("4993493"); } + @Test(expected = Exception.class) - public void getVfModuleByModelUuidTestException(){ + public void getVfModuleByModelUuidTestException() { VfModule vnf = cd.getVfModuleByModelUuid("4993493"); } + @Test(expected = Exception.class) - public void getVnfResourceCustomizationByModelCustomizationUuidTestException(){ + public void getVnfResourceCustomizationByModelCustomizationUuidTestException() { VnfResourceCustomization vnf = cd.getVnfResourceCustomizationByModelCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getVnfResourceCustomizationByModelVersionIdTestException(){ + public void getVnfResourceCustomizationByModelVersionIdTestException() { VnfResourceCustomization vnf = cd.getVnfResourceCustomizationByModelVersionId("4993493"); } + @Test(expected = Exception.class) - public void getVfModuleByModelCustomizationIdAndVersionTestException(){ - cd.getVfModuleByModelCustomizationIdAndVersion("4993493","test"); + public void getVfModuleByModelCustomizationIdAndVersionTestException() { + cd.getVfModuleByModelCustomizationIdAndVersion("4993493", "test"); } + @Test(expected = Exception.class) - public void getVfModuleByModelCustomizationIdModelVersionAndModelInvariantIdTestException(){ - cd.getVfModuleByModelCustomizationIdModelVersionAndModelInvariantId("4993493","vnf","test"); + public void getVfModuleByModelCustomizationIdModelVersionAndModelInvariantIdTestException() { + cd.getVfModuleByModelCustomizationIdModelVersionAndModelInvariantId("4993493", "vnf", "test"); } + @Test(expected = Exception.class) - public void getVnfResourceCustomizationByModelInvariantIdTest(){ - cd.getVnfResourceCustomizationByModelInvariantId("4993493","vnf","test"); + public void getVnfResourceCustomizationByModelInvariantIdTest() { + cd.getVnfResourceCustomizationByModelInvariantId("4993493", "vnf", "test"); } + @Test(expected = Exception.class) - public void getVfModuleCustomizationByVnfModuleCustomizationUuidTest(){ + public void getVfModuleCustomizationByVnfModuleCustomizationUuidTest() { cd.getVfModuleCustomizationByVnfModuleCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionIdTest(){ - cd.getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionId("4993493","test"); + public void getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionIdTest() { + cd.getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionId("4993493", "test"); } + @Test(expected = Exception.class) - public void getAllVfModuleCustomizationstest(){ + public void getAllVfModuleCustomizationstest() { cd.getAllVfModuleCustomizations("4993493"); } + @Test(expected = Exception.class) - public void getVnfResourceByModelUuidTest(){ + public void getVnfResourceByModelUuidTest() { cd.getVnfResourceByModelUuid("4993493"); } + @Test(expected = Exception.class) - public void getVnfResCustomToVfModuleTest(){ - cd.getVnfResCustomToVfModule("4993493","test"); + public void getVnfResCustomToVfModuleTest() { + cd.getVnfResCustomToVfModule("4993493", "test"); } + @Test(expected = Exception.class) - public void getVfModulesForVnfResourceTest(){ + public void getVfModulesForVnfResourceTest() { VnfResource vnfResource = new VnfResource(); vnfResource.setModelUuid("48839"); cd.getVfModulesForVnfResource(vnfResource); } + @Test(expected = Exception.class) - public void getVfModulesForVnfResource2Test(){ + public void getVfModulesForVnfResource2Test() { cd.getVfModulesForVnfResource("4993493"); } + @Test(expected = Exception.class) - public void getServiceByUuidTest(){ + public void getServiceByUuidTest() { cd.getServiceByUuid("4993493"); } + @Test(expected = Exception.class) - public void getNetworkResourceById2Test(){ + public void getNetworkResourceById2Test() { cd.getNetworkResourceById(4993493); } + @Test(expected = Exception.class) - public void getNetworkResourceByIdTest(){ + public void getNetworkResourceByIdTest() { cd.getVfModuleTypeByUuid("4993493"); } + @Test - public void isEmptyOrNullTest(){ + public void isEmptyOrNullTest() { boolean is = cd.isEmptyOrNull("4993493"); assertFalse(is); } + @Test(expected = Exception.class) - public void getSTRTest(){ - cd.getSTR("4993493","test","vnf"); + public void getSTRTest() { + cd.getSTR("4993493", "test", "vnf"); } + @Test(expected = Exception.class) - public void getVRCtoVFMCTest(){ - cd.getVRCtoVFMC("4993493","388492"); + public void getVRCtoVFMCTest() { + cd.getVRCtoVFMC("4993493", "388492"); } + @Test(expected = Exception.class) - public void getVfModuleTypeByUuidTestException(){ + public void getVfModuleTypeByUuidTestException() { cd.getVfModuleTypeByUuid("4993493"); } @Test(expected = Exception.class) - public void getTempNetworkHeatTemplateLookupTest(){ + public void getTempNetworkHeatTemplateLookupTest() { cd.getTempNetworkHeatTemplateLookup("4993493"); } @Test(expected = Exception.class) - public void getAllNetworksByServiceModelUuidTest(){ + public void getAllNetworksByServiceModelUuidTest() { cd.getAllNetworksByServiceModelUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllNetworksByServiceModelInvariantUuidTest(){ + public void getAllNetworksByServiceModelInvariantUuidTest() { cd.getAllNetworksByServiceModelInvariantUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllNetworksByServiceModelInvariantUuid2Test(){ - cd.getAllNetworksByServiceModelInvariantUuid("4993493","test"); + public void getAllNetworksByServiceModelInvariantUuid2Test() { + cd.getAllNetworksByServiceModelInvariantUuid("4993493", "test"); } + @Test(expected = Exception.class) - public void getAllNetworksByNetworkModelCustomizationUuidTest(){ + public void getAllNetworksByNetworkModelCustomizationUuidTest() { cd.getAllNetworksByNetworkModelCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllNetworksByNetworkTypeTest(){ + public void getAllNetworksByNetworkTypeTest() { cd.getAllNetworksByNetworkType("4993493"); } + @Test(expected = Exception.class) - public void getAllVfmcForVrcTest(){ + public void getAllVfmcForVrcTest() { VnfResourceCustomization re = new VnfResourceCustomization(); re.setModelCustomizationUuid("377483"); cd.getAllVfmcForVrc(re); } + @Test(expected = Exception.class) - public void getAllVnfsByServiceModelUuidTest(){ + public void getAllVnfsByServiceModelUuidTest() { cd.getAllVnfsByServiceModelUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllVnfsByServiceModelInvariantUuidTest(){ + public void getAllVnfsByServiceModelInvariantUuidTest() { cd.getAllVnfsByServiceModelInvariantUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllVnfsByServiceModelInvariantUuid2Test(){ - cd.getAllVnfsByServiceModelInvariantUuid("4993493","test"); + public void getAllVnfsByServiceModelInvariantUuid2Test() { + cd.getAllVnfsByServiceModelInvariantUuid("4993493", "test"); } + @Test(expected = Exception.class) - public void getAllVnfsByServiceNameTest(){ - cd.getAllVnfsByServiceName("4993493","test"); + public void getAllVnfsByServiceNameTest() { + cd.getAllVnfsByServiceName("4993493", "test"); } + @Test(expected = Exception.class) - public void getAllVnfsByServiceName2Test(){ + public void getAllVnfsByServiceName2Test() { cd.getAllVnfsByServiceName("4993493"); } + @Test(expected = Exception.class) - public void getAllVnfsByVnfModelCustomizationUuidTest(){ + public void getAllVnfsByVnfModelCustomizationUuidTest() { cd.getAllVnfsByVnfModelCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllAllottedResourcesByServiceModelUuidTest(){ + public void getAllAllottedResourcesByServiceModelUuidTest() { cd.getAllAllottedResourcesByServiceModelUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllAllottedResourcesByServiceModelInvariantUuidTest(){ + public void getAllAllottedResourcesByServiceModelInvariantUuidTest() { cd.getAllAllottedResourcesByServiceModelInvariantUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllAllottedResourcesByServiceModelInvariantUuid2Test(){ - cd.getAllAllottedResourcesByServiceModelInvariantUuid("4993493","test"); + public void getAllAllottedResourcesByServiceModelInvariantUuid2Test() { + cd.getAllAllottedResourcesByServiceModelInvariantUuid("4993493", "test"); } + @Test(expected = Exception.class) - public void getAllAllottedResourcesByArModelCustomizationUuidTest(){ + public void getAllAllottedResourcesByArModelCustomizationUuidTest() { cd.getAllAllottedResourcesByArModelCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllottedResourceByModelUuidTest(){ + public void getAllottedResourceByModelUuidTest() { cd.getAllottedResourceByModelUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllResourcesByServiceModelUuidTest(){ + public void getAllResourcesByServiceModelUuidTest() { cd.getAllResourcesByServiceModelUuid("4993493"); } + @Test(expected = Exception.class) - public void getAllResourcesByServiceModelInvariantUuidTest(){ + public void getAllResourcesByServiceModelInvariantUuidTest() { cd.getAllResourcesByServiceModelInvariantUuid("4993493"); } @Test(expected = Exception.class) - public void getAllResourcesByServiceModelInvariantUuid2Test(){ - cd.getAllResourcesByServiceModelInvariantUuid("4993493","test"); + public void getAllResourcesByServiceModelInvariantUuid2Test() { + cd.getAllResourcesByServiceModelInvariantUuid("4993493", "test"); } + @Test(expected = Exception.class) - public void getSingleNetworkByModelCustomizationUuidTest(){ + public void getSingleNetworkByModelCustomizationUuidTest() { cd.getSingleNetworkByModelCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getSingleAllottedResourceByModelCustomizationUuidTest(){ + public void getSingleAllottedResourceByModelCustomizationUuidTest() { cd.getSingleAllottedResourceByModelCustomizationUuid("4993493"); } + @Test(expected = Exception.class) - public void getVfModuleRecipeTest(){ - cd.getVfModuleRecipe("4993493","test","get"); + public void getVfModuleRecipeTest() { + cd.getVfModuleRecipe("4993493", "test", "get"); } + @Test(expected = Exception.class) - public void getVfModuleTest(){ - cd.getVfModule("4993493","test","get","v2","vnf"); + public void getVfModuleTest() { + cd.getVfModule("4993493", "test", "get", "v2", "vnf"); } + @Test(expected = Exception.class) - public void getVnfComponentsRecipeTest(){ - cd.getVnfComponentsRecipe("4993493","test","v2","vnf","get","3992"); + public void getVnfComponentsRecipeTest() { + cd.getVnfComponentsRecipe("4993493", "test", "v2", "vnf", "get", "3992"); } + @Test(expected = Exception.class) - public void getVnfComponentsRecipeByVfModuleTest(){ - List <VfModule> resultList = new ArrayList<>(); + public void getVnfComponentsRecipeByVfModuleTest() { + List<VfModule> resultList = new ArrayList<>(); VfModule m = new VfModule(); resultList.add(m); - cd.getVnfComponentsRecipeByVfModule(resultList,"4993493"); + cd.getVnfComponentsRecipeByVfModule(resultList, "4993493"); } + @Test(expected = Exception.class) - public void getAllVnfResourcesTest(){ + public void getAllVnfResourcesTest() { cd.getAllVnfResources(); } + @Test(expected = Exception.class) - public void getVnfResourcesByRoleTest(){ + public void getVnfResourcesByRoleTest() { cd.getVnfResourcesByRole("4993493"); } + @Test(expected = Exception.class) - public void getVnfResourceCustomizationsByRoleTest(){ + public void getVnfResourceCustomizationsByRoleTest() { cd.getVnfResourceCustomizationsByRole("4993493"); } + @Test(expected = Exception.class) - public void getAllNetworkResourcesTest(){ + public void getAllNetworkResourcesTest() { cd.getAllNetworkResources(); } + @Test(expected = Exception.class) - public void getAllNetworkResourceCustomizationsTest(){ + public void getAllNetworkResourceCustomizationsTest() { cd.getAllNetworkResourceCustomizations(); } + @Test(expected = Exception.class) - public void getAllVfModulesTest(){ + public void getAllVfModulesTest() { cd.getAllVfModules(); } + @Test(expected = Exception.class) - public void getAllVfModuleCustomizationsTest(){ + public void getAllVfModuleCustomizationsTest() { cd.getAllVfModuleCustomizations(); } + @Test(expected = Exception.class) - public void getAllHeatEnvironmentTest(){ + public void getAllHeatEnvironmentTest() { cd.getAllHeatEnvironment(); } + @Test(expected = Exception.class) - public void getHeatEnvironment2Test(){ + public void getHeatEnvironment2Test() { cd.getHeatEnvironment(4993493); } + @Test(expected = Exception.class) - public void getNestedTemplatesTest(){ + public void getNestedTemplatesTest() { cd.getNestedTemplates(4993493); } + @Test(expected = Exception.class) - public void getNestedTemplates2Test(){ + public void getNestedTemplates2Test() { cd.getNestedTemplates("4993493"); } + @Test(expected = Exception.class) - public void getHeatFilesTest(){ + public void getHeatFilesTest() { cd.getHeatFiles(4993493); } + @Test(expected = Exception.class) - public void getVfModuleToHeatFilesEntryTest(){ - cd.getVfModuleToHeatFilesEntry("4993493","49959499"); + public void getVfModuleToHeatFilesEntryTest() { + cd.getVfModuleToHeatFilesEntry("4993493", "49959499"); } + @Test(expected = Exception.class) - public void getServiceToResourceCustomization(){ - cd.getServiceToResourceCustomization("4993493","599349","49900"); + public void getServiceToResourceCustomization() { + cd.getServiceToResourceCustomization("4993493", "599349", "49900"); } + @Test(expected = Exception.class) - public void getHeatFilesForVfModuleTest(){ + public void getHeatFilesForVfModuleTest() { cd.getHeatFilesForVfModule("4993493"); } + @Test(expected = Exception.class) - public void getHeatTemplateTest(){ - cd.getHeatTemplate("4993493","test","heat"); + public void getHeatTemplateTest() { + cd.getHeatTemplate("4993493", "test", "heat"); } @Test(expected = Exception.class) - public void saveHeatTemplateTest(){ + public void saveHeatTemplateTest() { HeatTemplate heat = new HeatTemplate(); - Set <HeatTemplateParam> paramSet = new HashSet<>(); - cd.saveHeatTemplate(heat,paramSet); + Set<HeatTemplateParam> paramSet = new HashSet<>(); + cd.saveHeatTemplate(heat, paramSet); } + @Test(expected = Exception.class) - public void getHeatEnvironmentTest(){ - cd.getHeatEnvironment("4993493","test","heat"); + public void getHeatEnvironmentTest() { + cd.getHeatEnvironment("4993493", "test", "heat"); } + @Test(expected = Exception.class) - public void getHeatEnvironment3Test(){ - cd.getHeatEnvironment("4993493","test"); + public void getHeatEnvironment3Test() { + cd.getHeatEnvironment("4993493", "test"); } + @Test(expected = Exception.class) - public void saveHeatEnvironmentTest(){ + public void saveHeatEnvironmentTest() { HeatEnvironment en = new HeatEnvironment(); cd.saveHeatEnvironment(en); } + @Test(expected = Exception.class) - public void saveHeatTemplate2Test(){ + public void saveHeatTemplate2Test() { HeatTemplate heat = new HeatTemplate(); cd.saveHeatTemplate(heat); } + @Test(expected = Exception.class) - public void saveHeatFileTest(){ + public void saveHeatFileTest() { HeatFiles hf = new HeatFiles(); cd.saveHeatFile(hf); } + @Test(expected = Exception.class) - public void saveVnfRecipeTest(){ + public void saveVnfRecipeTest() { VnfRecipe vr = new VnfRecipe(); cd.saveVnfRecipe(vr); } + @Test(expected = Exception.class) - public void saveVnfComponentsRecipe(){ + public void saveVnfComponentsRecipe() { VnfComponentsRecipe vr = new VnfComponentsRecipe(); cd.saveVnfComponentsRecipe(vr); } + @Test(expected = Exception.class) - public void saveOrUpdateVnfResourceTest(){ + public void saveOrUpdateVnfResourceTest() { VnfResource vr = new VnfResource(); cd.saveOrUpdateVnfResource(vr); } + @Test(expected = Exception.class) - public void saveVnfResourceCustomizationTest(){ + public void saveVnfResourceCustomizationTest() { VnfResourceCustomization vr = new VnfResourceCustomization(); cd.saveVnfResourceCustomization(vr); } + @Test(expected = Exception.class) - public void saveAllottedResourceCustomizationTest(){ + public void saveAllottedResourceCustomizationTest() { AllottedResourceCustomization arc = new AllottedResourceCustomization(); cd.saveAllottedResourceCustomization(arc); } + @Test(expected = Exception.class) - public void saveAllottedResourceTest(){ + public void saveAllottedResourceTest() { AllottedResource ar = new AllottedResource(); cd.saveAllottedResource(ar); } + @Test(expected = Exception.class) public void saveNetworkResourceTest() throws RecordNotFoundException { NetworkResource nr = new NetworkResource(); cd.saveNetworkResource(nr); } + @Test(expected = Exception.class) - public void saveToscaCsarTest()throws RecordNotFoundException { + public void saveToscaCsarTest() throws RecordNotFoundException { ToscaCsar ts = new ToscaCsar(); cd.saveToscaCsar(ts); } + @Test(expected = Exception.class) - public void getToscaCsar(){ + public void getToscaCsar() { cd.getToscaCsar("4993493"); } + @Test(expected = Exception.class) - public void saveTempNetworkHeatTemplateLookupTest(){ + public void saveTempNetworkHeatTemplateLookupTest() { TempNetworkHeatTemplateLookup t = new TempNetworkHeatTemplateLookup(); cd.saveTempNetworkHeatTemplateLookup(t); } + @Test(expected = Exception.class) - public void saveVfModuleToHeatFiles(){ + public void saveVfModuleToHeatFiles() { VfModuleToHeatFiles v = new VfModuleToHeatFiles(); cd.saveVfModuleToHeatFiles(v); } + @Test(expected = Exception.class) public void saveVnfResourceToVfModuleCustomizationTest() throws RecordNotFoundException { - VnfResourceCustomization v =new VnfResourceCustomization(); + VnfResourceCustomization v = new VnfResourceCustomization(); VfModuleCustomization vm = new VfModuleCustomization(); cd.saveVnfResourceToVfModuleCustomization(v, vm); } + @Test(expected = Exception.class) public void saveNetworkResourceCustomizationTest() throws RecordNotFoundException { NetworkResourceCustomization nrc = new NetworkResourceCustomization(); @@ -2538,139 +2619,163 @@ public class CatalogDatabaseTest { } @Test(expected = Exception.class) - public void saveServiceToNetworksTest(){ + public void saveServiceToNetworksTest() { AllottedResource ar = new AllottedResource(); cd.saveAllottedResource(ar); } + @Test(expected = Exception.class) - public void saveServiceToResourceCustomizationTest(){ + public void saveServiceToResourceCustomizationTest() { ServiceToResourceCustomization ar = new ServiceToResourceCustomization(); cd.saveServiceToResourceCustomization(ar); } + @Test(expected = Exception.class) - public void saveServiceTest(){ + public void saveServiceTest() { Service ar = new Service(); cd.saveService(ar); } + @Test(expected = Exception.class) - public void saveOrUpdateVfModuleTest(){ + public void saveOrUpdateVfModuleTest() { VfModule ar = new VfModule(); cd.saveOrUpdateVfModule(ar); } + @Test(expected = Exception.class) - public void saveOrUpdateVfModuleCustomizationTest(){ + public void saveOrUpdateVfModuleCustomizationTest() { VfModuleCustomization ar = new VfModuleCustomization(); cd.saveOrUpdateVfModuleCustomization(ar); } @Test(expected = Exception.class) - public void getNestedHeatTemplateTest(){ - cd.getNestedHeatTemplate(101,201); + public void getNestedHeatTemplateTest() { + cd.getNestedHeatTemplate(101, 201); } + @Test(expected = Exception.class) - public void getNestedHeatTemplate2Test(){ - cd.getNestedHeatTemplate("1002","1002"); + public void getNestedHeatTemplate2Test() { + cd.getNestedHeatTemplate("1002", "1002"); } + @Test(expected = Exception.class) - public void saveNestedHeatTemplateTest(){ + public void saveNestedHeatTemplateTest() { HeatTemplate ar = new HeatTemplate(); - cd.saveNestedHeatTemplate("1001",ar,"test"); + cd.saveNestedHeatTemplate("1001", ar, "test"); } + @Test(expected = Exception.class) - public void getHeatFiles2Test(){ + public void getHeatFiles2Test() { VfModuleCustomization ar = new VfModuleCustomization(); - cd.getHeatFiles(101,"test","1001","v2"); + cd.getHeatFiles(101, "test", "1001", "v2"); } + @Test(expected = Exception.class) - public void getHeatFiles3Test(){ + public void getHeatFiles3Test() { VfModuleCustomization ar = new VfModuleCustomization(); cd.getHeatFiles("200192"); } + @Test(expected = Exception.class) - public void saveHeatFilesTest(){ + public void saveHeatFilesTest() { HeatFiles ar = new HeatFiles(); cd.saveHeatFiles(ar); } + @Test(expected = Exception.class) - public void saveVfModuleToHeatFilesTest(){ + public void saveVfModuleToHeatFilesTest() { HeatFiles ar = new HeatFiles(); - cd.saveVfModuleToHeatFiles("3772893",ar); + cd.saveVfModuleToHeatFiles("3772893", ar); } + @Test - public void getNetworkResourceByModelUuidTest(){ + public void getNetworkResourceByModelUuidTest() { cd.getNetworkResourceByModelUuid("3899291"); } + @Test(expected = Exception.class) - public void getNetworkRecipeTest(){ + public void getNetworkRecipeTest() { - cd.getNetworkRecipe("test","test1","test2"); + cd.getNetworkRecipe("test", "test1", "test2"); } + @Test(expected = Exception.class) - public void getNetworkRecipe2Test(){ + public void getNetworkRecipe2Test() { - cd.getNetworkRecipe("test","test1"); + cd.getNetworkRecipe("test", "test1"); } + @Test - public void getNetworkResourceByModelCustUuidTest(){ + public void getNetworkResourceByModelCustUuidTest() { cd.getNetworkResourceByModelCustUuid("test"); } + @Test(expected = Exception.class) - public void getVnfComponentsRecipe2Test(){ + public void getVnfComponentsRecipe2Test() { - cd.getVnfComponentsRecipe("test1","test2","test3","test4"); + cd.getVnfComponentsRecipe("test1", "test2", "test3", "test4"); } + @Test(expected = Exception.class) - public void getVnfComponentsRecipeByVfModuleModelUUIdTest(){ + public void getVnfComponentsRecipeByVfModuleModelUUIdTest() { - cd.getVnfComponentsRecipeByVfModuleModelUUId("test1","test2","test3"); + cd.getVnfComponentsRecipeByVfModuleModelUUId("test1", "test2", "test3"); } + @Test(expected = Exception.class) - public void getVnfComponentRecipesTest(){ + public void getVnfComponentRecipesTest() { cd.getVnfComponentRecipes("test"); } + @Test(expected = Exception.class) - public void saveOrUpdateVnfComponentTest(){ + public void saveOrUpdateVnfComponentTest() { VnfComponent ar = new VnfComponent(); cd.saveOrUpdateVnfComponent(ar); } @Test(expected = Exception.class) - public void getVfModule2Test(){ + public void getVfModule2Test() { cd.getVfModule("test"); } + @Test(expected = Exception.class) - public void getVfModuleByModelUUIDTest(){ + public void getVfModuleByModelUUIDTest() { cd.getVfModuleByModelUUID("test"); } + @Test(expected = Exception.class) - public void getServiceRecipeByModelUUIDTest(){ + public void getServiceRecipeByModelUUIDTest() { - cd.getServiceRecipeByModelUUID("test1","test2"); + cd.getServiceRecipeByModelUUID("test1", "test2"); } + @Test(expected = Exception.class) - public void getModelRecipeTest(){ + public void getModelRecipeTest() { - cd.getModelRecipe("test1","test2","test3"); + cd.getModelRecipe("test1", "test2", "test3"); } + @Test(expected = Exception.class) - public void healthCheck(){ + public void healthCheck() { cd.healthCheck(); } + @Test(expected = Exception.class) - public void executeQuerySingleRow(){ + public void executeQuerySingleRow() { VnfComponent ar = new VnfComponent(); HashMap<String, String> variables = new HashMap<>(); - cd.executeQuerySingleRow("tets",variables,false); + cd.executeQuerySingleRow("tets", variables, false); } + @Test(expected = Exception.class) - public void executeQueryMultipleRows(){ + public void executeQueryMultipleRows() { HashMap<String, String> variables = new HashMap<>(); - cd.executeQueryMultipleRows("select",variables,false); + cd.executeQueryMultipleRows("select", variables, false); } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatFilesTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatFilesTest.java index da4e87806c..d25daf02f9 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatFilesTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatFilesTest.java @@ -39,49 +39,49 @@ import org.openecomp.mso.db.catalog.beans.HeatFiles; public class HeatFilesTest { - @Test - public final void heatFilesTest() { - - HeatFiles heatFiles = new HeatFiles(); - heatFiles.setFileBody("testBody"); - heatFiles.setArtifactUuid(UUID.randomUUID().toString()); - assertTrue(heatFiles.getFileBody().equals("testBody")); - assertTrue(!heatFiles.toString().contains("8 chars")); - heatFiles.setFileBody(null); - assertTrue(!heatFiles.toString().contains("Not defined")); - heatFiles.setVersion("12"); - assertTrue(heatFiles.getVersion().equals("12")); - - heatFiles.setFileName("File"); - assertTrue(heatFiles.getFileName().equalsIgnoreCase("File")); - - heatFiles.setCreated(null); - assertTrue(heatFiles.getCreated() == null); - heatFiles.setAsdcUuid("asdc"); - - assertTrue(heatFiles.getAsdcUuid().equalsIgnoreCase("asdc")); - - heatFiles.setDescription("desc"); - assertTrue(heatFiles.getDescription().equalsIgnoreCase("desc")); - - - heatFiles.setArtifactChecksum("artifactChecksum"); - assertTrue(heatFiles.getArtifactChecksum().equalsIgnoreCase("artifactChecksum")); - File tempFile; - try { - tempFile = File.createTempFile("heatFiles", "test"); - tempFile.deleteOnExit(); - try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), "utf-8"))) { - writer.write("something\n"); - writer.write("something2\n"); - } - heatFiles.setFileBody(tempFile.getAbsolutePath()); - assertTrue(heatFiles.getFileBody().contains("test")); - } catch (IOException e) { - e.printStackTrace(); - fail("Exception caught"); - } - - } + @Test + public final void heatFilesTest() { + + HeatFiles heatFiles = new HeatFiles(); + heatFiles.setFileBody("testBody"); + heatFiles.setArtifactUuid(UUID.randomUUID().toString()); + assertTrue(heatFiles.getFileBody().equals("testBody")); + assertTrue(!heatFiles.toString().contains("8 chars")); + heatFiles.setFileBody(null); + assertTrue(!heatFiles.toString().contains("Not defined")); + heatFiles.setVersion("12"); + assertTrue(heatFiles.getVersion().equals("12")); + + heatFiles.setFileName("File"); + assertTrue(heatFiles.getFileName().equalsIgnoreCase("File")); + + heatFiles.setCreated(null); + assertTrue(heatFiles.getCreated() == null); + heatFiles.setAsdcUuid("asdc"); + + assertTrue(heatFiles.getAsdcUuid().equalsIgnoreCase("asdc")); + + heatFiles.setDescription("desc"); + assertTrue(heatFiles.getDescription().equalsIgnoreCase("desc")); + + + heatFiles.setArtifactChecksum("artifactChecksum"); + assertTrue(heatFiles.getArtifactChecksum().equalsIgnoreCase("artifactChecksum")); + File tempFile; + try { + tempFile = File.createTempFile("heatFiles", "test"); + tempFile.deleteOnExit(); + try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), "utf-8"))) { + writer.write("something\n"); + writer.write("something2\n"); + } + heatFiles.setFileBody(tempFile.getAbsolutePath()); + assertTrue(heatFiles.getFileBody().contains("test")); + } catch (IOException e) { + e.printStackTrace(); + fail("Exception caught"); + } + + } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatTemplateTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatTemplateTest.java index cf79d5b0d1..39ec365f88 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatTemplateTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/HeatTemplateTest.java @@ -41,48 +41,48 @@ import org.openecomp.mso.db.catalog.beans.HeatTemplateParam; */ public class HeatTemplateTest { - + @Test - public final void heatTemplateTest () { - HeatTemplate heatTemplate = new HeatTemplate (); - heatTemplate.setTemplateBody ("testBody"); + public final void heatTemplateTest() { + HeatTemplate heatTemplate = new HeatTemplate(); + heatTemplate.setTemplateBody("testBody"); heatTemplate.setArtifactUuid(UUID.randomUUID().toString()); - assertTrue (heatTemplate.getHeatTemplate ().equals ("testBody")); - assertTrue (heatTemplate.toString ().contains ("8 chars")); - heatTemplate.setTemplateBody (null); - assertTrue (heatTemplate.toString ().contains ("Not defined")); - HashSet<HeatTemplateParam> set = new HashSet<> (); - HeatTemplateParam param = new HeatTemplateParam (); - param.setParamName ("param name"); - param.setParamType ("string"); - param.setRequired (false); + assertTrue(heatTemplate.getHeatTemplate().equals("testBody")); + assertTrue(heatTemplate.toString().contains("8 chars")); + heatTemplate.setTemplateBody(null); + assertTrue(heatTemplate.toString().contains("Not defined")); + HashSet<HeatTemplateParam> set = new HashSet<>(); + HeatTemplateParam param = new HeatTemplateParam(); + param.setParamName("param name"); + param.setParamType("string"); + param.setRequired(false); param.setHeatTemplateArtifactUuid(UUID.randomUUID().toString()); - set.add (param); - HeatTemplateParam param2 = new HeatTemplateParam (); - param2.setParamName ("param 2"); - param2.setParamType ("string"); - param2.setRequired (true); + set.add(param); + HeatTemplateParam param2 = new HeatTemplateParam(); + param2.setParamName("param 2"); + param2.setParamType("string"); + param2.setRequired(true); param2.setHeatTemplateArtifactUuid(UUID.randomUUID().toString()); - set.add (param2); - heatTemplate.setParameters (set); - String heatStr = heatTemplate.toString (); - assertTrue (heatStr.contains ("param name")); - assertTrue (heatStr.contains ("param 2(reqd)")); + set.add(param2); + heatTemplate.setParameters(set); + String heatStr = heatTemplate.toString(); + assertTrue(heatStr.contains("param name")); + assertTrue(heatStr.contains("param 2(reqd)")); File tempFile; try { - tempFile = File.createTempFile ("heatTemplate", "test"); - tempFile.deleteOnExit (); - try (Writer writer = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (tempFile), - "utf-8"))) { - writer.write ("something\n"); - writer.write ("something2\n"); + tempFile = File.createTempFile("heatTemplate", "test"); + tempFile.deleteOnExit(); + try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), + "utf-8"))) { + writer.write("something\n"); + writer.write("something2\n"); } - heatTemplate.setTemplateBody(tempFile.getAbsolutePath ()); - assertTrue (heatTemplate.getHeatTemplate ().contains ("test")); + heatTemplate.setTemplateBody(tempFile.getAbsolutePath()); + assertTrue(heatTemplate.getHeatTemplate().contains("test")); } catch (IOException e) { - e.printStackTrace (); - fail ("Exception caught"); + e.printStackTrace(); + fail("Exception caught"); } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java index c99a714b11..615246b071 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java @@ -35,153 +35,153 @@ import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; public class MavenVersioningTest { - @Test - public final void testVersion () { - MavenLikeVersioning mavenVersioning = new MavenLikeVersioning (); - assertFalse(mavenVersioning.isMoreRecentThan("0.0.0")); - assertFalse(mavenVersioning.isMoreRecentThan(null)); - mavenVersioning.setVersion("0.0.1"); - - assertFalse(mavenVersioning.isMoreRecentThan(null)); - assertTrue(mavenVersioning.isMoreRecentThan("0.0.0")); - assertTrue(mavenVersioning.isMoreRecentThan("0.0.0.1")); - - assertFalse(mavenVersioning.isMoreRecentThan("0.0.2")); - assertFalse(mavenVersioning.isMoreRecentThan("0.0.1")); - assertFalse(mavenVersioning.isMoreRecentThan("00.00.01")); - - assertFalse(mavenVersioning.isMoreRecentThan("0.1")); - assertFalse(mavenVersioning.isMoreRecentThan("1")); - assertFalse(mavenVersioning.isMoreRecentThan("0.1.0.2")); - - assertFalse(mavenVersioning.isMoreRecentThan("0.1.1")); - assertFalse(mavenVersioning.isMoreRecentThan("2.1.1")); - - mavenVersioning.setVersion("1.0.1"); - assertTrue(mavenVersioning.isMoreRecentThan("0.0.0")); - assertTrue(mavenVersioning.isMoreRecentThan("0.5.2")); - assertTrue(mavenVersioning.isMoreRecentThan("1.0.0")); - - assertFalse(mavenVersioning.isMoreRecentThan("2.1.1")); - assertFalse(mavenVersioning.isMoreRecentThan("02.001.0001")); - assertFalse(mavenVersioning.isMoreRecentThan("1.0.1")); - assertFalse(mavenVersioning.isMoreRecentThan("1.0.2")); - assertFalse(mavenVersioning.isMoreRecentThan("1.1.1")); - assertFalse(mavenVersioning.isMoreRecentThan("1.0.10")); - - - mavenVersioning.setVersion("100.0.1"); - assertTrue(mavenVersioning.isMoreRecentThan("0.0.0")); - assertTrue(mavenVersioning.isMoreRecentThan("0.5.2")); - assertTrue(mavenVersioning.isMoreRecentThan("1.0.0")); - - assertFalse(mavenVersioning.isMoreRecentThan("101.1.1")); - assertFalse(mavenVersioning.isMoreRecentThan("100.0.1")); - assertFalse(mavenVersioning.isMoreRecentThan("100.0.2")); - assertFalse(mavenVersioning.isMoreRecentThan("100.1.1")); - - assertFalse(mavenVersioning.isMoreRecentThan("100.0.1.4")); - } - - @Test - public final void testOneDigitVersion() { - MavenLikeVersioning oneDigit = new MavenLikeVersioning(); - oneDigit.setVersion("1"); - assertFalse(oneDigit.isMoreRecentThan("2")); - assertFalse(oneDigit.isMoreRecentThan("2.0")); - assertFalse(oneDigit.isMoreRecentThan("1.0")); - - oneDigit.setVersion("1.0"); - assertTrue(oneDigit.isMoreRecentThan("1")); - - oneDigit.setVersion("1"); - assertFalse(oneDigit.isTheSameVersion("1.1")); - assertFalse(oneDigit.isTheSameVersion("1.0")); - assertFalse(oneDigit.isTheSameVersion("1.0.0")); - - oneDigit.setVersion("2"); - assertTrue(oneDigit.isMoreRecentThan("1")); - assertTrue(oneDigit.isMoreRecentThan("1.0")); - assertTrue(oneDigit.isMoreRecentThan("1.1")); - assertTrue(oneDigit.isMoreRecentThan("0.1")); - assertFalse(oneDigit.isMoreRecentThan("2.0")); - - } - - @Test - public final void testVersionEquals () { - - MavenLikeVersioning heatTemplate = new MavenLikeVersioning(); - assertFalse(heatTemplate.isTheSameVersion("100.0")); - assertTrue(heatTemplate.isTheSameVersion(null)); - heatTemplate.setVersion("100.0.1"); - assertFalse(heatTemplate.isTheSameVersion(null)); - assertFalse(heatTemplate.isTheSameVersion("100.0")); - assertFalse(heatTemplate.isTheSameVersion("100")); - assertFalse(heatTemplate.isTheSameVersion("100.0.1.1")); - assertTrue(heatTemplate.isTheSameVersion("100.0.1")); - assertTrue(heatTemplate.isTheSameVersion("00100.000.0001")); - assertFalse(heatTemplate.isTheSameVersion("0.0.1")); - assertTrue(heatTemplate.isTheSameVersion("100.0.01")); - - } - - @Test - public final void testListSort () { - MavenLikeVersioning test1 = new MavenLikeVersioning(); - test1.setVersion("1.1"); - MavenLikeVersioning test2 = new MavenLikeVersioning(); - test2.setVersion("1.10"); - MavenLikeVersioning test3 = new MavenLikeVersioning(); - test3.setVersion("1.2"); - MavenLikeVersioning test4 = new MavenLikeVersioning(); - test4.setVersion("1.20"); - MavenLikeVersioning test5 = new MavenLikeVersioning(); - test5.setVersion("1.02"); - MavenLikeVersioning test6 = new MavenLikeVersioning(); - test6.setVersion("2.02"); - MavenLikeVersioning test7 = new MavenLikeVersioning(); - test7.setVersion("0.02"); - MavenLikeVersioning test8 = new MavenLikeVersioning(); - test8.setVersion("2.02"); - MavenLikeVersioning test9 = new MavenLikeVersioning(); - test9.setVersion("10.2004"); - MavenLikeVersioning test10 = new MavenLikeVersioning(); - test10.setVersion("2"); - MavenLikeVersioning test11 = new MavenLikeVersioning(); - test11.setVersion("12"); - MavenLikeVersioning test12 = new MavenLikeVersioning(); - test12.setVersion("2.0"); - - List<MavenLikeVersioning> list= new LinkedList<>(); - list.add(test1); - list.add(test2); - list.add(test3); - list.add(test4); - list.add(test5); - list.add(test6); - list.add(test7); - list.add(test8); - list.add(test9); - list.add(test10); - list.add(test11); - list.add(test12); - - list.sort(new MavenLikeVersioningComparator()); - //Collections.reverse(list); - assertTrue(list.get(0).getVersion().equals("0.02")); - assertTrue(list.get(1).getVersion().equals("1.1")); - assertTrue(list.get(2).getVersion().equals("1.02") || list.get(3).getVersion().equals("1.02")); - assertTrue(list.get(3).getVersion().equals("1.2") || list.get(2).getVersion().equals("1.2")); - assertTrue(list.get(4).getVersion().equals("1.10")); - assertTrue(list.get(5).getVersion().equals("1.20")); - assertTrue(list.get(6).getVersion().equals("2")); - assertTrue(list.get(7).getVersion().equals("2.0")); - assertTrue(list.get(8).getVersion().equals("2.02")); - assertTrue(list.get(9).getVersion().equals("2.02")); - assertTrue(list.get(10).getVersion().equals("10.2004")); - assertTrue(list.get(11).getVersion().equals("12")); - - } + @Test + public final void testVersion() { + MavenLikeVersioning mavenVersioning = new MavenLikeVersioning(); + assertFalse(mavenVersioning.isMoreRecentThan("0.0.0")); + assertFalse(mavenVersioning.isMoreRecentThan(null)); + mavenVersioning.setVersion("0.0.1"); + + assertFalse(mavenVersioning.isMoreRecentThan(null)); + assertTrue(mavenVersioning.isMoreRecentThan("0.0.0")); + assertTrue(mavenVersioning.isMoreRecentThan("0.0.0.1")); + + assertFalse(mavenVersioning.isMoreRecentThan("0.0.2")); + assertFalse(mavenVersioning.isMoreRecentThan("0.0.1")); + assertFalse(mavenVersioning.isMoreRecentThan("00.00.01")); + + assertFalse(mavenVersioning.isMoreRecentThan("0.1")); + assertFalse(mavenVersioning.isMoreRecentThan("1")); + assertFalse(mavenVersioning.isMoreRecentThan("0.1.0.2")); + + assertFalse(mavenVersioning.isMoreRecentThan("0.1.1")); + assertFalse(mavenVersioning.isMoreRecentThan("2.1.1")); + + mavenVersioning.setVersion("1.0.1"); + assertTrue(mavenVersioning.isMoreRecentThan("0.0.0")); + assertTrue(mavenVersioning.isMoreRecentThan("0.5.2")); + assertTrue(mavenVersioning.isMoreRecentThan("1.0.0")); + + assertFalse(mavenVersioning.isMoreRecentThan("2.1.1")); + assertFalse(mavenVersioning.isMoreRecentThan("02.001.0001")); + assertFalse(mavenVersioning.isMoreRecentThan("1.0.1")); + assertFalse(mavenVersioning.isMoreRecentThan("1.0.2")); + assertFalse(mavenVersioning.isMoreRecentThan("1.1.1")); + assertFalse(mavenVersioning.isMoreRecentThan("1.0.10")); + + + mavenVersioning.setVersion("100.0.1"); + assertTrue(mavenVersioning.isMoreRecentThan("0.0.0")); + assertTrue(mavenVersioning.isMoreRecentThan("0.5.2")); + assertTrue(mavenVersioning.isMoreRecentThan("1.0.0")); + + assertFalse(mavenVersioning.isMoreRecentThan("101.1.1")); + assertFalse(mavenVersioning.isMoreRecentThan("100.0.1")); + assertFalse(mavenVersioning.isMoreRecentThan("100.0.2")); + assertFalse(mavenVersioning.isMoreRecentThan("100.1.1")); + + assertFalse(mavenVersioning.isMoreRecentThan("100.0.1.4")); + } + + @Test + public final void testOneDigitVersion() { + MavenLikeVersioning oneDigit = new MavenLikeVersioning(); + oneDigit.setVersion("1"); + assertFalse(oneDigit.isMoreRecentThan("2")); + assertFalse(oneDigit.isMoreRecentThan("2.0")); + assertFalse(oneDigit.isMoreRecentThan("1.0")); + + oneDigit.setVersion("1.0"); + assertTrue(oneDigit.isMoreRecentThan("1")); + + oneDigit.setVersion("1"); + assertFalse(oneDigit.isTheSameVersion("1.1")); + assertFalse(oneDigit.isTheSameVersion("1.0")); + assertFalse(oneDigit.isTheSameVersion("1.0.0")); + + oneDigit.setVersion("2"); + assertTrue(oneDigit.isMoreRecentThan("1")); + assertTrue(oneDigit.isMoreRecentThan("1.0")); + assertTrue(oneDigit.isMoreRecentThan("1.1")); + assertTrue(oneDigit.isMoreRecentThan("0.1")); + assertFalse(oneDigit.isMoreRecentThan("2.0")); + + } + + @Test + public final void testVersionEquals() { + + MavenLikeVersioning heatTemplate = new MavenLikeVersioning(); + assertFalse(heatTemplate.isTheSameVersion("100.0")); + assertTrue(heatTemplate.isTheSameVersion(null)); + heatTemplate.setVersion("100.0.1"); + assertFalse(heatTemplate.isTheSameVersion(null)); + assertFalse(heatTemplate.isTheSameVersion("100.0")); + assertFalse(heatTemplate.isTheSameVersion("100")); + assertFalse(heatTemplate.isTheSameVersion("100.0.1.1")); + assertTrue(heatTemplate.isTheSameVersion("100.0.1")); + assertTrue(heatTemplate.isTheSameVersion("00100.000.0001")); + assertFalse(heatTemplate.isTheSameVersion("0.0.1")); + assertTrue(heatTemplate.isTheSameVersion("100.0.01")); + + } + + @Test + public final void testListSort() { + MavenLikeVersioning test1 = new MavenLikeVersioning(); + test1.setVersion("1.1"); + MavenLikeVersioning test2 = new MavenLikeVersioning(); + test2.setVersion("1.10"); + MavenLikeVersioning test3 = new MavenLikeVersioning(); + test3.setVersion("1.2"); + MavenLikeVersioning test4 = new MavenLikeVersioning(); + test4.setVersion("1.20"); + MavenLikeVersioning test5 = new MavenLikeVersioning(); + test5.setVersion("1.02"); + MavenLikeVersioning test6 = new MavenLikeVersioning(); + test6.setVersion("2.02"); + MavenLikeVersioning test7 = new MavenLikeVersioning(); + test7.setVersion("0.02"); + MavenLikeVersioning test8 = new MavenLikeVersioning(); + test8.setVersion("2.02"); + MavenLikeVersioning test9 = new MavenLikeVersioning(); + test9.setVersion("10.2004"); + MavenLikeVersioning test10 = new MavenLikeVersioning(); + test10.setVersion("2"); + MavenLikeVersioning test11 = new MavenLikeVersioning(); + test11.setVersion("12"); + MavenLikeVersioning test12 = new MavenLikeVersioning(); + test12.setVersion("2.0"); + + List<MavenLikeVersioning> list = new LinkedList<>(); + list.add(test1); + list.add(test2); + list.add(test3); + list.add(test4); + list.add(test5); + list.add(test6); + list.add(test7); + list.add(test8); + list.add(test9); + list.add(test10); + list.add(test11); + list.add(test12); + + list.sort(new MavenLikeVersioningComparator()); + //Collections.reverse(list); + assertTrue(list.get(0).getVersion().equals("0.02")); + assertTrue(list.get(1).getVersion().equals("1.1")); + assertTrue(list.get(2).getVersion().equals("1.02") || list.get(3).getVersion().equals("1.02")); + assertTrue(list.get(3).getVersion().equals("1.2") || list.get(2).getVersion().equals("1.2")); + assertTrue(list.get(4).getVersion().equals("1.10")); + assertTrue(list.get(5).getVersion().equals("1.20")); + assertTrue(list.get(6).getVersion().equals("2")); + assertTrue(list.get(7).getVersion().equals("2.0")); + assertTrue(list.get(8).getVersion().equals("2.02")); + assertTrue(list.get(9).getVersion().equals("2.02")); + assertTrue(list.get(10).getVersion().equals("10.2004")); + assertTrue(list.get(11).getVersion().equals("12")); + + } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelRecipeTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelRecipeTest.java index d70f267cc1..dff06e456c 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelRecipeTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelRecipeTest.java @@ -32,28 +32,28 @@ import org.openecomp.mso.db.catalog.beans.ModelRecipe; public class ModelRecipeTest { - @Test - public final void modelRecipeDataTest() { - ModelRecipe modelRecipe = new ModelRecipe(); - modelRecipe.setAction("action"); - assertTrue(modelRecipe.getAction().equalsIgnoreCase("action")); - modelRecipe.setCreated(new Timestamp(System.currentTimeMillis())); - assertTrue(modelRecipe.getCreated() != null); - modelRecipe.setDescription("description"); - assertTrue(modelRecipe.getDescription().equalsIgnoreCase("description")); - modelRecipe.setId(1); - assertTrue(modelRecipe.getId() == 1); - modelRecipe.setModelId(1); - assertTrue(modelRecipe.getModelId() == 1); - modelRecipe.setModelParamXSD("modelParamXSD"); - assertTrue(modelRecipe.getModelParamXSD().equalsIgnoreCase("modelParamXSD")); - modelRecipe.setOrchestrationUri("orchestrationUri"); - assertTrue(modelRecipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri")); - modelRecipe.setRecipeTimeout(1); - assertTrue(modelRecipe.getRecipeTimeout() == 1); - modelRecipe.setSchemaVersion("schemaVersion"); - assertTrue(modelRecipe.getSchemaVersion().equalsIgnoreCase("schemaVersion")); + @Test + public final void modelRecipeDataTest() { + ModelRecipe modelRecipe = new ModelRecipe(); + modelRecipe.setAction("action"); + assertTrue(modelRecipe.getAction().equalsIgnoreCase("action")); + modelRecipe.setCreated(new Timestamp(System.currentTimeMillis())); + assertTrue(modelRecipe.getCreated() != null); + modelRecipe.setDescription("description"); + assertTrue(modelRecipe.getDescription().equalsIgnoreCase("description")); + modelRecipe.setId(1); + assertTrue(modelRecipe.getId() == 1); + modelRecipe.setModelId(1); + assertTrue(modelRecipe.getModelId() == 1); + modelRecipe.setModelParamXSD("modelParamXSD"); + assertTrue(modelRecipe.getModelParamXSD().equalsIgnoreCase("modelParamXSD")); + modelRecipe.setOrchestrationUri("orchestrationUri"); + assertTrue(modelRecipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri")); + modelRecipe.setRecipeTimeout(1); + assertTrue(modelRecipe.getRecipeTimeout() == 1); + modelRecipe.setSchemaVersion("schemaVersion"); + assertTrue(modelRecipe.getSchemaVersion().equalsIgnoreCase("schemaVersion")); // assertTrue(modelRecipe.toString() != null); - } + } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelTest.java index dcc9810042..26b10bd6a6 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ModelTest.java @@ -32,38 +32,38 @@ import org.openecomp.mso.db.catalog.beans.Model; public class ModelTest { - @Test - public final void modelDataTest() { - Model model = new Model(); - model.setId(1); - assertTrue(model.getId() == 1); + @Test + public final void modelDataTest() { + Model model = new Model(); + model.setId(1); + assertTrue(model.getId() == 1); - model.setCreated(new Timestamp(System.currentTimeMillis())); - assertTrue(model.getCreated() != null); - model.setModelCustomizationId("modelCustomizationId"); + model.setCreated(new Timestamp(System.currentTimeMillis())); + assertTrue(model.getCreated() != null); + model.setModelCustomizationId("modelCustomizationId"); - assertTrue(model.getModelCustomizationId().equalsIgnoreCase("modelCustomizationId")); - model.setModelCustomizationName("modelCustomizationName"); - assertTrue(model.getModelCustomizationName().equalsIgnoreCase("modelCustomizationName")); + assertTrue(model.getModelCustomizationId().equalsIgnoreCase("modelCustomizationId")); + model.setModelCustomizationName("modelCustomizationName"); + assertTrue(model.getModelCustomizationName().equalsIgnoreCase("modelCustomizationName")); - model.setModelInvariantId("modelInvariantId"); - assertTrue(model.getModelInvariantId().equalsIgnoreCase("modelInvariantId")); - model.setModelName("modelName"); - assertTrue(model.getModelName().equalsIgnoreCase("modelName")); + model.setModelInvariantId("modelInvariantId"); + assertTrue(model.getModelInvariantId().equalsIgnoreCase("modelInvariantId")); + model.setModelName("modelName"); + assertTrue(model.getModelName().equalsIgnoreCase("modelName")); - model.setModelType("modelType"); - assertTrue(model.getModelType().equalsIgnoreCase("modelType")); - model.setModelVersion("modelVersion"); - assertTrue(model.getModelVersion().equalsIgnoreCase("modelVersion")); - model.setModelVersionId("modelVersionId"); - assertTrue(model.getModelVersionId().equalsIgnoreCase("modelVersionId")); - model.setVersion("1"); - assertTrue(model.getVersion().equalsIgnoreCase("1")); - model.setRecipes(null); + model.setModelType("modelType"); + assertTrue(model.getModelType().equalsIgnoreCase("modelType")); + model.setModelVersion("modelVersion"); + assertTrue(model.getModelVersion().equalsIgnoreCase("modelVersion")); + model.setModelVersionId("modelVersionId"); + assertTrue(model.getModelVersionId().equalsIgnoreCase("modelVersionId")); + model.setVersion("1"); + assertTrue(model.getVersion().equalsIgnoreCase("1")); + model.setRecipes(null); - assertTrue(model.getRecipes() == null); + assertTrue(model.getRecipes() == null); // assertTrue(model.toString() != null); - } + } } 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 index c17b50e738..69700f9351 100644 --- 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 @@ -32,32 +32,32 @@ 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.setParamXSD("networkParamXSD"); - assertTrue(networkRecipe.getParamXSD().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")); + @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.setParamXSD("networkParamXSD"); + assertTrue(networkRecipe.getParamXSD().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 index 7b54854fd9..5a10de9809 100644 --- 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 @@ -33,30 +33,30 @@ 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")); + @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 index 11ee57b86b..b10f61d77f 100644 --- 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 @@ -32,37 +32,37 @@ 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")); + @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); - } + } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/RecipeTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/RecipeTest.java index 49dc9b7079..62f8c274b5 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/RecipeTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/RecipeTest.java @@ -32,24 +32,24 @@ import org.openecomp.mso.db.catalog.beans.Recipe; public class RecipeTest { - @Test - public final void recipeDataTest() { - Recipe recipe = new Recipe(); - recipe.setAction("action"); - assertTrue(recipe.getAction().equalsIgnoreCase("action")); - recipe.setCreated(new Timestamp(System.currentTimeMillis())); - assertTrue(recipe.getCreated() != null); - recipe.setDescription("description"); - assertTrue(recipe.getDescription().equalsIgnoreCase("description")); - recipe.setId(1); - assertTrue(recipe.getId() == 1); - recipe.setOrchestrationUri("orchestrationUri"); - assertTrue(recipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri")); - recipe.setRecipeTimeout(1); - assertTrue(recipe.getRecipeTimeout() == 1); - recipe.setServiceType("serviceType"); - assertTrue(recipe.getServiceType().equalsIgnoreCase("serviceType")); + @Test + public final void recipeDataTest() { + Recipe recipe = new Recipe(); + recipe.setAction("action"); + assertTrue(recipe.getAction().equalsIgnoreCase("action")); + recipe.setCreated(new Timestamp(System.currentTimeMillis())); + assertTrue(recipe.getCreated() != null); + recipe.setDescription("description"); + assertTrue(recipe.getDescription().equalsIgnoreCase("description")); + recipe.setId(1); + assertTrue(recipe.getId() == 1); + recipe.setOrchestrationUri("orchestrationUri"); + assertTrue(recipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri")); + recipe.setRecipeTimeout(1); + assertTrue(recipe.getRecipeTimeout() == 1); + recipe.setServiceType("serviceType"); + assertTrue(recipe.getServiceType().equalsIgnoreCase("serviceType")); // assertTrue(recipe.toString() != null); - } + } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceMacroHolderTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceMacroHolderTest.java index 0e3492170e..02d35bf0ca 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceMacroHolderTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceMacroHolderTest.java @@ -34,15 +34,15 @@ import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization; public class ServiceMacroHolderTest { - @Test - public final void serviceMacroHolderDataTest() { - ServiceMacroHolder serviceMacroHolder = new ServiceMacroHolder(); - assertTrue(serviceMacroHolder.getService() == null); - serviceMacroHolder.addVnfResource(new VnfResource()); - serviceMacroHolder.addVnfResourceCustomizations(new VnfResourceCustomization()); - serviceMacroHolder.addNetworkResourceCustomization(new NetworkResourceCustomization()); - serviceMacroHolder.addAllottedResourceCustomization(new AllottedResourceCustomization()); - assertTrue(serviceMacroHolder != null); - } + @Test + public final void serviceMacroHolderDataTest() { + ServiceMacroHolder serviceMacroHolder = new ServiceMacroHolder(); + assertTrue(serviceMacroHolder.getService() == null); + serviceMacroHolder.addVnfResource(new VnfResource()); + serviceMacroHolder.addVnfResourceCustomizations(new VnfResourceCustomization()); + serviceMacroHolder.addNetworkResourceCustomization(new NetworkResourceCustomization()); + serviceMacroHolder.addAllottedResourceCustomization(new AllottedResourceCustomization()); + assertTrue(serviceMacroHolder != null); + } } diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceRecipeTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceRecipeTest.java index 4b4a5adf4a..6890b6b508 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceRecipeTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceRecipeTest.java @@ -33,33 +33,33 @@ import org.openecomp.mso.db.catalog.beans.ServiceRecipe; public class ServiceRecipeTest { - @Test - public final void serviceRecipeDataTest() { + @Test + public final void serviceRecipeDataTest() { - ServiceRecipe serviceRecipe = new ServiceRecipe(); - serviceRecipe.setAction("action"); - assertTrue(serviceRecipe.getAction().equalsIgnoreCase("action")); - serviceRecipe.setCreated(new Timestamp(System.currentTimeMillis())); - assertTrue(serviceRecipe.getCreated() != null); - serviceRecipe.setDescription("description"); - assertTrue(serviceRecipe.getDescription().equalsIgnoreCase("description")); - serviceRecipe.setId(1); - assertTrue(serviceRecipe.getId() == 1); - serviceRecipe.setOrchestrationUri("orchestrationUri"); - assertTrue(serviceRecipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri")); - serviceRecipe.setRecipeTimeout(1); - assertTrue(serviceRecipe.getRecipeTimeout() == 1); - serviceRecipe.setVersion("version"); - assertTrue(serviceRecipe.getVersion().equalsIgnoreCase("version")); - serviceRecipe.setServiceTimeoutInterim(1); - assertTrue(serviceRecipe.getServiceTimeoutInterim() == 1); - serviceRecipe.setServiceParamXSD("serviceParamXSD"); - assertTrue(serviceRecipe.getServiceParamXSD().equalsIgnoreCase("serviceParamXSD")); - assertTrue(serviceRecipe.toString() != null); - ServiceRecipe serviceRecipeWithValue = new ServiceRecipe(1, "string", "string", "string", "string", "string", 1, - 1, new Date()); - assertTrue(serviceRecipeWithValue.toString() != null); + ServiceRecipe serviceRecipe = new ServiceRecipe(); + serviceRecipe.setAction("action"); + assertTrue(serviceRecipe.getAction().equalsIgnoreCase("action")); + serviceRecipe.setCreated(new Timestamp(System.currentTimeMillis())); + assertTrue(serviceRecipe.getCreated() != null); + serviceRecipe.setDescription("description"); + assertTrue(serviceRecipe.getDescription().equalsIgnoreCase("description")); + serviceRecipe.setId(1); + assertTrue(serviceRecipe.getId() == 1); + serviceRecipe.setOrchestrationUri("orchestrationUri"); + assertTrue(serviceRecipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri")); + serviceRecipe.setRecipeTimeout(1); + assertTrue(serviceRecipe.getRecipeTimeout() == 1); + serviceRecipe.setVersion("version"); + assertTrue(serviceRecipe.getVersion().equalsIgnoreCase("version")); + serviceRecipe.setServiceTimeoutInterim(1); + assertTrue(serviceRecipe.getServiceTimeoutInterim() == 1); + serviceRecipe.setServiceParamXSD("serviceParamXSD"); + assertTrue(serviceRecipe.getServiceParamXSD().equalsIgnoreCase("serviceParamXSD")); + assertTrue(serviceRecipe.toString() != null); + ServiceRecipe serviceRecipeWithValue = new ServiceRecipe(1, "string", "string", "string", "string", "string", 1, + 1, new Date()); + assertTrue(serviceRecipeWithValue.toString() != null); - } + } } 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 index 12c55e7a48..df7fa405c3 100644 --- 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 @@ -32,36 +32,36 @@ import org.openecomp.mso.db.catalog.beans.Service; public class ServiceTest {
- @Test
- public final void recipeDataTest() {
- Service service = new Service();
- service.setCreated(new Timestamp(System.currentTimeMillis()));
- assertTrue(service.getCreated() != null);
- service.setDescription("description");
- assertTrue(service.getDescription().equalsIgnoreCase("description"));
+ @Test
+ public final void recipeDataTest() {
+ Service service = new Service();
+ service.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(service.getCreated() != null);
+ service.setDescription("description");
+ assertTrue(service.getDescription().equalsIgnoreCase("description"));
- service.setModelInvariantUUID("action");
- assertTrue(service.getModelInvariantUUID().equalsIgnoreCase("action"));
+ service.setModelInvariantUUID("action");
+ assertTrue(service.getModelInvariantUUID().equalsIgnoreCase("action"));
- service.setModelName("modelName");
- assertTrue(service.getModelName().equalsIgnoreCase("modelName"));
+ service.setModelName("modelName");
+ assertTrue(service.getModelName().equalsIgnoreCase("modelName"));
- service.setModelUUID("modelUUID");
- assertTrue(service.getModelUUID().equalsIgnoreCase("modelUUID"));
- service.setModelVersion("modelVersion");
- assertTrue(service.getModelVersion().equalsIgnoreCase("modelVersion"));
- service.setServiceRole("serviceRole");
- assertTrue(service.getServiceRole().equalsIgnoreCase("serviceRole"));
- service.setToscaCsarArtifactUUID("toscaCsarArtifactUUID");
- assertTrue(service.getToscaCsarArtifactUUID().equalsIgnoreCase("toscaCsarArtifactUUID"));
+ service.setModelUUID("modelUUID");
+ assertTrue(service.getModelUUID().equalsIgnoreCase("modelUUID"));
+ service.setModelVersion("modelVersion");
+ assertTrue(service.getModelVersion().equalsIgnoreCase("modelVersion"));
+ service.setServiceRole("serviceRole");
+ assertTrue(service.getServiceRole().equalsIgnoreCase("serviceRole"));
+ service.setToscaCsarArtifactUUID("toscaCsarArtifactUUID");
+ assertTrue(service.getToscaCsarArtifactUUID().equalsIgnoreCase("toscaCsarArtifactUUID"));
- service.setServiceType("serviceType");
- assertTrue(service.getServiceType().equalsIgnoreCase("serviceType"));
- service.setRecipes(null);
- assertTrue(service.getRecipes() == null);
- service.setServiceResourceCustomizations(null);
- assertTrue(service.getServiceResourceCustomizations() == null);
+ service.setServiceType("serviceType");
+ assertTrue(service.getServiceType().equalsIgnoreCase("serviceType"));
+ service.setRecipes(null);
+ assertTrue(service.getRecipes() == null);
+ service.setServiceResourceCustomizations(null);
+ assertTrue(service.getServiceResourceCustomizations() == null);
- }
+ }
}
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 index b2aaeeed4e..86cd746024 100644 --- 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 @@ -32,18 +32,18 @@ import org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources; public class ServiceToAllottedResourcesTest {
- @Test
- public final void serviceToAllottedResourcesDataTest() {
- ServiceToAllottedResources serviceToAllottedResources = new ServiceToAllottedResources();
- serviceToAllottedResources.setArModelCustomizationUuid("arModelCustomizationUuid");
- assertTrue(
- serviceToAllottedResources.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));
- serviceToAllottedResources.setCreated(new Timestamp(System.currentTimeMillis()));
- assertTrue(serviceToAllottedResources.getCreated() != null);
- serviceToAllottedResources.setServiceModelUuid("serviceModelUuid");
- assertTrue(serviceToAllottedResources.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));
-// assertTrue(serviceToAllottedResources.toString() != null);
-
- }
+ @Test
+ public final void serviceToAllottedResourcesDataTest() {
+ ServiceToAllottedResources serviceToAllottedResources = new ServiceToAllottedResources();
+ serviceToAllottedResources.setArModelCustomizationUuid("arModelCustomizationUuid");
+ assertTrue(
+ serviceToAllottedResources.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));
+ serviceToAllottedResources.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(serviceToAllottedResources.getCreated() != null);
+ serviceToAllottedResources.setServiceModelUuid("serviceModelUuid");
+ assertTrue(serviceToAllottedResources.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));
+// assertTrue(serviceToAllottedResources.toString() != null);
+
+ }
}
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 index 337cf4b574..51c4083be5 100644 --- 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 @@ -32,18 +32,18 @@ import org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources; public class ServiceToResourceCustomizationTest {
- @Test
- public final void serviceToResourceCustomizationDataTest() {
- ServiceToAllottedResources serviceToResourceCustomization = new ServiceToAllottedResources();
- serviceToResourceCustomization.setArModelCustomizationUuid("arModelCustomizationUuid");
- assertTrue(
- serviceToResourceCustomization.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));
- serviceToResourceCustomization.setCreated(new Timestamp(System.currentTimeMillis()));
- assertTrue(serviceToResourceCustomization.getCreated() != null);
- serviceToResourceCustomization.setServiceModelUuid("serviceModelUuid");
- assertTrue(serviceToResourceCustomization.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));
-// assertTrue(serviceToResourceCustomization.toString() != null);
-
- }
+ @Test
+ public final void serviceToResourceCustomizationDataTest() {
+ ServiceToAllottedResources serviceToResourceCustomization = new ServiceToAllottedResources();
+ serviceToResourceCustomization.setArModelCustomizationUuid("arModelCustomizationUuid");
+ assertTrue(
+ serviceToResourceCustomization.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));
+ serviceToResourceCustomization.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(serviceToResourceCustomization.getCreated() != null);
+ serviceToResourceCustomization.setServiceModelUuid("serviceModelUuid");
+ assertTrue(serviceToResourceCustomization.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));
+// assertTrue(serviceToResourceCustomization.toString() != null);
+
+ }
}
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 index b0ccfdd781..4a8d92ef42 100644 --- 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 @@ -30,21 +30,21 @@ 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);
-
- }
+ @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/ToStringTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToStringTest.java index 05e857f178..66e422e059 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToStringTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ToStringTest.java @@ -48,104 +48,104 @@ import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization; public class ToStringTest { - @Test - public void testTModelRecipeToString(){ - ModelRecipe mr = new ModelRecipe(); - mr.setCreated(new Timestamp(10001)); - mr.setModelId(102); - mr.setRecipeTimeout(100); - String str = mr.toString(); - assertTrue(str != null); - } - - @Test - public void networkResourcetoStringTest(){ - NetworkResource nr = new NetworkResource(); - nr.setCreated(new Timestamp(10000)); - String str = nr.toString(); - assertTrue(str != null); - } - - @Test - public void modelTestToString(){ - Model m = new Model(); - m.setCreated(new Timestamp(100000)); - m.setId(1001); - m.setModelCustomizationId("10012"); - String str = m.toString(); - assertTrue(str != null); - } - - @Test - public void serviceMacroHolderTest(){ - ServiceMacroHolder smh = new ServiceMacroHolder(); - Service service = new Service(); - Map<String,ServiceRecipe> recipes = new HashMap<>(); - recipes.put("test", new ServiceRecipe()); - service.setRecipes(recipes); - - Set<ServiceToResourceCustomization> serviceResourceCustomizations = new HashSet<>(); - ServiceToResourceCustomization sr = new ServiceToResourceCustomization(); - serviceResourceCustomizations.add(sr); - service.setServiceResourceCustomizations(serviceResourceCustomizations); - smh.setService(service); - - ArrayList<VnfResource> vnflist = new ArrayList<>(); - smh.setVnfResources(vnflist); - - VnfResource vr = new VnfResource(); - Set<VnfResourceCustomization> vnfResourceCustomization = new HashSet<>(); - vnfResourceCustomization.add(new VnfResourceCustomization()); - vr.setVnfResourceCustomizations(vnfResourceCustomization); - - Set<VfModule> vfModules = new HashSet<>(); - vfModules.add(new VfModule()); - vr.setVfModules(vfModules); - smh.addVnfResource(vr); - - ArrayList<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>(); - smh.setVnfResourceCustomizations(vnfResourceCustomizations); - - VnfResourceCustomization vrc = new VnfResourceCustomization(); - smh.addVnfResourceCustomizations(vrc); - - ArrayList<NetworkResourceCustomization> networkResourceCustomizations = new ArrayList<>(); - smh.setNetworkResourceCustomization(networkResourceCustomizations); - - NetworkResourceCustomization nrc = new NetworkResourceCustomization(); - smh.addNetworkResourceCustomization(nrc); - - ArrayList<AllottedResourceCustomization> allottedResourceCustomizations = new ArrayList<>(); - smh.setAllottedResourceCustomization(allottedResourceCustomizations); - - AllottedResourceCustomization arc = new AllottedResourceCustomization(); - smh.addAllottedResourceCustomization(arc); - - String str = smh.toString(); - assertTrue(str != null); - } - - @Test - public void heatFilesTest(){ - HeatFiles hf = new HeatFiles(); - String str = hf.toString(); - assertTrue(str != null); - - } - - @Test - public void testVnfConponent(){ - VnfComponent vnf = new VnfComponent(); - String str = vnf.toString(); - assertTrue(str != null); - } - - @Test - public void testTempNetworkHeatTemplateLookup(){ - TempNetworkHeatTemplateLookup tn =new TempNetworkHeatTemplateLookup(); - String str = tn.toString(); - assertTrue(str != null); - } - - + @Test + public void testTModelRecipeToString() { + ModelRecipe mr = new ModelRecipe(); + mr.setCreated(new Timestamp(10001)); + mr.setModelId(102); + mr.setRecipeTimeout(100); + String str = mr.toString(); + assertTrue(str != null); + } + + @Test + public void networkResourcetoStringTest() { + NetworkResource nr = new NetworkResource(); + nr.setCreated(new Timestamp(10000)); + String str = nr.toString(); + assertTrue(str != null); + } + + @Test + public void modelTestToString() { + Model m = new Model(); + m.setCreated(new Timestamp(100000)); + m.setId(1001); + m.setModelCustomizationId("10012"); + String str = m.toString(); + assertTrue(str != null); + } + + @Test + public void serviceMacroHolderTest() { + ServiceMacroHolder smh = new ServiceMacroHolder(); + Service service = new Service(); + Map<String, ServiceRecipe> recipes = new HashMap<>(); + recipes.put("test", new ServiceRecipe()); + service.setRecipes(recipes); + + Set<ServiceToResourceCustomization> serviceResourceCustomizations = new HashSet<>(); + ServiceToResourceCustomization sr = new ServiceToResourceCustomization(); + serviceResourceCustomizations.add(sr); + service.setServiceResourceCustomizations(serviceResourceCustomizations); + smh.setService(service); + + ArrayList<VnfResource> vnflist = new ArrayList<>(); + smh.setVnfResources(vnflist); + + VnfResource vr = new VnfResource(); + Set<VnfResourceCustomization> vnfResourceCustomization = new HashSet<>(); + vnfResourceCustomization.add(new VnfResourceCustomization()); + vr.setVnfResourceCustomizations(vnfResourceCustomization); + + Set<VfModule> vfModules = new HashSet<>(); + vfModules.add(new VfModule()); + vr.setVfModules(vfModules); + smh.addVnfResource(vr); + + ArrayList<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>(); + smh.setVnfResourceCustomizations(vnfResourceCustomizations); + + VnfResourceCustomization vrc = new VnfResourceCustomization(); + smh.addVnfResourceCustomizations(vrc); + + ArrayList<NetworkResourceCustomization> networkResourceCustomizations = new ArrayList<>(); + smh.setNetworkResourceCustomization(networkResourceCustomizations); + + NetworkResourceCustomization nrc = new NetworkResourceCustomization(); + smh.addNetworkResourceCustomization(nrc); + + ArrayList<AllottedResourceCustomization> allottedResourceCustomizations = new ArrayList<>(); + smh.setAllottedResourceCustomization(allottedResourceCustomizations); + + AllottedResourceCustomization arc = new AllottedResourceCustomization(); + smh.addAllottedResourceCustomization(arc); + + String str = smh.toString(); + assertTrue(str != null); + } + + @Test + public void heatFilesTest() { + HeatFiles hf = new HeatFiles(); + String str = hf.toString(); + assertTrue(str != null); + + } + + @Test + public void testVnfConponent() { + VnfComponent vnf = new VnfComponent(); + String str = vnf.toString(); + assertTrue(str != null); + } + + @Test + public void testTempNetworkHeatTemplateLookup() { + TempNetworkHeatTemplateLookup tn = new TempNetworkHeatTemplateLookup(); + String str = tn.toString(); + assertTrue(str != 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 index 9cbfaa4d2c..01c5cebe3a 100644 --- 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 @@ -32,26 +32,26 @@ 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);
-
- }
+ @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 index 52d15ee597..cc38becce6 100644 --- 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 @@ -33,38 +33,38 @@ 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"));
+ @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.setHeatEnvironmentArtifactUuid("heatEnvironmentArtifactUuid");
+ assertTrue(
+ vfModuleCustomization.getHeatEnvironmentArtifactUuid().equalsIgnoreCase("heatEnvironmentArtifactUuid"));
- vfModuleCustomization.setInitialCount(1);
- assertTrue(vfModuleCustomization.getInitialCount() == 1);
+ 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);
+ 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);
+// assertTrue(vfModuleCustomization.toString() == null);
- }
+ }
}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleTest.java index 9409a642ec..5b76fa183c 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VfModuleTest.java @@ -32,32 +32,32 @@ import org.openecomp.mso.db.catalog.beans.VfModule; public class VfModuleTest {
- @Test
- public final void vfModuleDataTest() {
- VfModule vfModule = new VfModule();
- vfModule.setCreated(new Timestamp(System.currentTimeMillis()));
- assertTrue(vfModule.getCreated() != null);
- vfModule.setDescription("description");
- assertTrue(vfModule.getDescription().equalsIgnoreCase("description"));
-
- vfModule.setModelInvariantUUID("action");
- assertTrue(vfModule.getModelInvariantUUID().equalsIgnoreCase("action"));
-
- vfModule.setModelName("modelName");
- assertTrue(vfModule.getModelName().equalsIgnoreCase("modelName"));
-
- vfModule.setModelUUID("modelUUID");
- assertTrue(vfModule.getModelUUID().equalsIgnoreCase("modelUUID"));
- vfModule.setModelVersion("modelVersion");
- assertTrue(vfModule.getModelVersion().equalsIgnoreCase("modelVersion"));
- vfModule.setHeatTemplateArtifactUUId("heatTemplateArtifactUUId");
- assertTrue(vfModule.getHeatTemplateArtifactUUId().equalsIgnoreCase("heatTemplateArtifactUUId"));
- vfModule.setVnfResourceModelUUId("vnfResourceModelUUId");
- assertTrue(vfModule.getVnfResourceModelUUId().equalsIgnoreCase("vnfResourceModelUUId"));
- vfModule.setIsBase(1);
- assertTrue(vfModule.isBase());
-// assertTrue(vfModule.toString() == null);
-
- }
+ @Test
+ public final void vfModuleDataTest() {
+ VfModule vfModule = new VfModule();
+ vfModule.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(vfModule.getCreated() != null);
+ vfModule.setDescription("description");
+ assertTrue(vfModule.getDescription().equalsIgnoreCase("description"));
+
+ vfModule.setModelInvariantUUID("action");
+ assertTrue(vfModule.getModelInvariantUUID().equalsIgnoreCase("action"));
+
+ vfModule.setModelName("modelName");
+ assertTrue(vfModule.getModelName().equalsIgnoreCase("modelName"));
+
+ vfModule.setModelUUID("modelUUID");
+ assertTrue(vfModule.getModelUUID().equalsIgnoreCase("modelUUID"));
+ vfModule.setModelVersion("modelVersion");
+ assertTrue(vfModule.getModelVersion().equalsIgnoreCase("modelVersion"));
+ vfModule.setHeatTemplateArtifactUUId("heatTemplateArtifactUUId");
+ assertTrue(vfModule.getHeatTemplateArtifactUUId().equalsIgnoreCase("heatTemplateArtifactUUId"));
+ vfModule.setVnfResourceModelUUId("vnfResourceModelUUId");
+ assertTrue(vfModule.getVnfResourceModelUUId().equalsIgnoreCase("vnfResourceModelUUId"));
+ vfModule.setIsBase(1);
+ assertTrue(vfModule.isBase());
+// assertTrue(vfModule.toString() == null);
+
+ }
}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfRecipeTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfRecipeTest.java index 3f707871a6..6500535a05 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfRecipeTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfRecipeTest.java @@ -32,32 +32,32 @@ import org.openecomp.mso.db.catalog.beans.VnfRecipe; public class VnfRecipeTest {
- @Test
- public final void vnfRecipeDataTest() {
- VnfRecipe vnfRecipe = new VnfRecipe();
- vnfRecipe.setCreated(new Timestamp(System.currentTimeMillis()));
- assertTrue(vnfRecipe.getCreated() != null);
- vnfRecipe.setDescription("description");
- assertTrue(vnfRecipe.getDescription().equalsIgnoreCase("description"));
-
- vnfRecipe.setOrchestrationUri("orchestrationUri");
- assertTrue(vnfRecipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri"));
-
- vnfRecipe.setRecipeTimeout(1);
- assertTrue(vnfRecipe.getRecipeTimeout() == 1);
- vnfRecipe.setVnfType("vnfType");
- assertTrue(vnfRecipe.getVnfType().equalsIgnoreCase("vnfType"));
-
- vnfRecipe.setServiceType("serviceType");
- assertTrue(vnfRecipe.getServiceType().equalsIgnoreCase("serviceType"));
- vnfRecipe.setVersion("version");
- assertTrue(vnfRecipe.getVersion().equalsIgnoreCase("version"));
- vnfRecipe.setParamXSD("vnfParamXSD");
- assertTrue(vnfRecipe.getParamXSD().equalsIgnoreCase("vnfParamXSD"));
- vnfRecipe.setVfModuleId("vfModuleId");
- assertTrue(vnfRecipe.getVfModuleId().equalsIgnoreCase("vfModuleId"));
+ @Test
+ public final void vnfRecipeDataTest() {
+ VnfRecipe vnfRecipe = new VnfRecipe();
+ vnfRecipe.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(vnfRecipe.getCreated() != null);
+ vnfRecipe.setDescription("description");
+ assertTrue(vnfRecipe.getDescription().equalsIgnoreCase("description"));
+
+ vnfRecipe.setOrchestrationUri("orchestrationUri");
+ assertTrue(vnfRecipe.getOrchestrationUri().equalsIgnoreCase("orchestrationUri"));
+
+ vnfRecipe.setRecipeTimeout(1);
+ assertTrue(vnfRecipe.getRecipeTimeout() == 1);
+ vnfRecipe.setVnfType("vnfType");
+ assertTrue(vnfRecipe.getVnfType().equalsIgnoreCase("vnfType"));
+
+ vnfRecipe.setServiceType("serviceType");
+ assertTrue(vnfRecipe.getServiceType().equalsIgnoreCase("serviceType"));
+ vnfRecipe.setVersion("version");
+ assertTrue(vnfRecipe.getVersion().equalsIgnoreCase("version"));
+ vnfRecipe.setParamXSD("vnfParamXSD");
+ assertTrue(vnfRecipe.getParamXSD().equalsIgnoreCase("vnfParamXSD"));
+ vnfRecipe.setVfModuleId("vfModuleId");
+ assertTrue(vnfRecipe.getVfModuleId().equalsIgnoreCase("vfModuleId"));
// assertTrue(vnfRecipe.toString() == null);
- }
+ }
}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfResourceTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfResourceTest.java index 68749e397e..82f0962966 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfResourceTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/VnfResourceTest.java @@ -36,47 +36,47 @@ import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization; public class VnfResourceTest {
- @Test
- public final void vnfResourceDataTest() {
+ @Test
+ public final void vnfResourceDataTest() {
- VnfResource vnfResource = new VnfResource();
- vnfResource.setCreated(new Timestamp(System.currentTimeMillis()));
- assertTrue(vnfResource.getCreated() != null);
- vnfResource.setDescription("description");
- assertTrue(vnfResource.getDescription().equalsIgnoreCase("description"));
+ VnfResource vnfResource = new VnfResource();
+ vnfResource.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(vnfResource.getCreated() != null);
+ vnfResource.setDescription("description");
+ assertTrue(vnfResource.getDescription().equalsIgnoreCase("description"));
- vnfResource.setAicVersionMax("aicVersionMax");
- assertTrue(vnfResource.getAicVersionMax().equalsIgnoreCase("aicVersionMax"));
+ vnfResource.setAicVersionMax("aicVersionMax");
+ assertTrue(vnfResource.getAicVersionMax().equalsIgnoreCase("aicVersionMax"));
- vnfResource.setAicVersionMin("aicVersionMin");
- assertTrue(vnfResource.getAicVersionMin().equalsIgnoreCase("aicVersionMin"));
- vnfResource.setHeatTemplateArtifactUUId("heatTemplateArtifactUUId");
- assertTrue(vnfResource.getHeatTemplateArtifactUUId().equalsIgnoreCase("heatTemplateArtifactUUId"));
+ vnfResource.setAicVersionMin("aicVersionMin");
+ assertTrue(vnfResource.getAicVersionMin().equalsIgnoreCase("aicVersionMin"));
+ vnfResource.setHeatTemplateArtifactUUId("heatTemplateArtifactUUId");
+ assertTrue(vnfResource.getHeatTemplateArtifactUUId().equalsIgnoreCase("heatTemplateArtifactUUId"));
- vnfResource.setModelInvariantUuid("modelInvariantUuid");
- assertTrue(vnfResource.getModelInvariantUuid().equalsIgnoreCase("modelInvariantUuid"));
- vnfResource.setModelName("modelName");
- assertTrue(vnfResource.getModelName().equalsIgnoreCase("modelName"));
- vnfResource.setModelUuid("modelUuid");
- assertTrue(vnfResource.getModelUuid().equalsIgnoreCase("modelUuid"));
- vnfResource.setModelVersion("modelVersion");
- assertTrue(vnfResource.getModelVersion().equalsIgnoreCase("modelVersion"));
- vnfResource.setOrchestrationMode("orchestrationMode");
- assertTrue(vnfResource.getOrchestrationMode().equalsIgnoreCase("orchestrationMode"));
- vnfResource.setTemplateId("heatTemplateArtifactUUId");
- assertTrue(vnfResource.getHeatTemplateArtifactUUId().equalsIgnoreCase("heatTemplateArtifactUUId"));
- vnfResource.setModelInvariantUuid("modelInvariantUuid");
- assertTrue(vnfResource.getModelInvariantUuid().equalsIgnoreCase("modelInvariantUuid"));
- Set<VnfResourceCustomization> list = new HashSet<>();
- list.add(new VnfResourceCustomization());
- vnfResource.setVnfResourceCustomizations(list);
- assertTrue(vnfResource.getVfModuleCustomizations() != null);
- Set<VfModule> vfModules = new HashSet<>();
- vfModules.add(new VfModule());
- vnfResource.setVfModules(vfModules);
- assertTrue(vnfResource.getVfModules() != null);
-// assertTrue(vnfResource.toString() != null);
+ vnfResource.setModelInvariantUuid("modelInvariantUuid");
+ assertTrue(vnfResource.getModelInvariantUuid().equalsIgnoreCase("modelInvariantUuid"));
+ vnfResource.setModelName("modelName");
+ assertTrue(vnfResource.getModelName().equalsIgnoreCase("modelName"));
+ vnfResource.setModelUuid("modelUuid");
+ assertTrue(vnfResource.getModelUuid().equalsIgnoreCase("modelUuid"));
+ vnfResource.setModelVersion("modelVersion");
+ assertTrue(vnfResource.getModelVersion().equalsIgnoreCase("modelVersion"));
+ vnfResource.setOrchestrationMode("orchestrationMode");
+ assertTrue(vnfResource.getOrchestrationMode().equalsIgnoreCase("orchestrationMode"));
+ vnfResource.setTemplateId("heatTemplateArtifactUUId");
+ assertTrue(vnfResource.getHeatTemplateArtifactUUId().equalsIgnoreCase("heatTemplateArtifactUUId"));
+ vnfResource.setModelInvariantUuid("modelInvariantUuid");
+ assertTrue(vnfResource.getModelInvariantUuid().equalsIgnoreCase("modelInvariantUuid"));
+ Set<VnfResourceCustomization> list = new HashSet<>();
+ list.add(new VnfResourceCustomization());
+ vnfResource.setVnfResourceCustomizations(list);
+ assertTrue(vnfResource.getVfModuleCustomizations() != null);
+ Set<VfModule> vfModules = new HashSet<>();
+ vfModules.add(new VfModule());
+ vnfResource.setVfModules(vfModules);
+ assertTrue(vnfResource.getVfModules() != null);
+// assertTrue(vnfResource.toString() != null);
- }
+ }
}
|