--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class AllottedResourceTest {\r
+ private AllottedResource ar = new AllottedResource();\r
+ TunnelConnect tc = new TunnelConnect();\r
+\r
+ @Test\r
+ public void testAllottedResource() {\r
+ ar.setAllottedResourceType("allottedResourceType");\r
+ ar.setAllottedResourceRole("allottedResourceRole");\r
+ ar.setProvidingServiceModelName("providingServiceModelName");\r
+ ar.setProvidingServiceModelInvariantUuid("providingServiceModelInvariantUuid");\r
+ ar.setProvidingServiceModelUuid("providingServiceModelUuid");\r
+ ar.setNfFunction("nfFunction");\r
+ ar.setNfType("nfType");\r
+ ar.setNfRole("nfRole");\r
+ ar.setNfNamingCode("nfNamingCode");\r
+ ar.setOrchestrationStatus("orchestrationStatus");\r
+ ar.setTunnelConnect(tc);\r
+ assertEquals(ar.getAllottedResourceType(), "allottedResourceType");\r
+ assertEquals(ar.getAllottedResourceRole(), "allottedResourceRole");\r
+ assertEquals(ar.getProvidingServiceModelName(), "providingServiceModelName");\r
+ assertEquals(ar.getProvidingServiceModelInvariantUuid(), "providingServiceModelInvariantUuid");\r
+ assertEquals(ar.getProvidingServiceModelUuid(), "providingServiceModelUuid");\r
+ assertEquals(ar.getNfFunction(), "nfFunction");\r
+ assertEquals(ar.getNfType(), "nfType");\r
+ assertEquals(ar.getNfRole(), "nfRole");\r
+ assertEquals(ar.getNfNamingCode(), "nfNamingCode");\r
+ assertEquals(ar.getOrchestrationStatus(), "orchestrationStatus");\r
+ assertEquals(ar.getTunnelConnect(), tc);\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ConfigResourceTest {\r
+ private ConfigResource configresource = new ConfigResource();{\r
+ configresource.resourceType = ResourceType.CONFIGURATION;\r
+ }\r
+\r
+ @Test\r
+ public void testConfigResource() {\r
+ configresource.setToscaNodeType("toscaNodeType");\r
+ assertEquals(configresource.getToscaNodeType(), "toscaNodeType");\r
+ \r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ConfigurationTest {\r
+ private Configuration configuration = new Configuration();\r
+\r
+ @Test\r
+ public void testConfigurationTest() {\r
+ configuration.setId("id");\r
+ configuration.setName("name");\r
+ configuration.setType("type");\r
+ configuration.setOrchestrationStatus("orchestrationStatus");\r
+ configuration.setTunnelBandwidth("tunnelBandwidth");\r
+ configuration.setVendorAllowedMaxBandwidth("vendorAllowedMaxBandwidth");\r
+ configuration.setResourceVersion("resourceVersion");\r
+ assertEquals(configuration.getId(), "id");\r
+ assertEquals(configuration.getName(), "name");\r
+ assertEquals(configuration.getType(), "type");\r
+ assertEquals(configuration.getOrchestrationStatus(), "orchestrationStatus");\r
+ assertEquals(configuration.getTunnelBandwidth(), "tunnelBandwidth");\r
+ assertEquals(configuration.getVendorAllowedMaxBandwidth(), "vendorAllowedMaxBandwidth");\r
+ assertEquals(configuration.getResourceVersion(), "resourceVersion");\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class CustomerTest {\r
+ private Customer customer = new Customer();\r
+\r
+ @Test\r
+ public void testCustomer() {\r
+ customer.setSubscriptionServiceType("subscriptionServiceType");\r
+ customer.setGlobalSubscriberId("globalSubscriberId");\r
+ assertEquals(customer.getSubscriptionServiceType(), "subscriptionServiceType");\r
+ assertEquals(customer.getGlobalSubscriberId(), "globalSubscriberId");\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class HomingSolutionTest {\r
+ \r
+ private HomingSolution homingsolution = new HomingSolution();\r
+ InventoryType inventory = InventoryType.cloud;\r
+ VnfResource vnfresource = new VnfResource();\r
+ License license = new License();\r
+\r
+ @Test\r
+ public void testHomingSolution() {\r
+ homingsolution.setInventoryType(inventory);\r
+ homingsolution.setRehome(true);\r
+ homingsolution.setServiceInstanceId("serviceInstanceId");\r
+ homingsolution.setCloudOwner("cloudOwner");\r
+ homingsolution.setCloudRegionId("cloudRegionId");\r
+ homingsolution.setAicClli("aicClli");\r
+ homingsolution.setAicVersion("aicVersion");\r
+ homingsolution.setTenant("tenant");\r
+ homingsolution.setVnf(vnfresource);\r
+ homingsolution.setLicense(license);\r
+ assertEquals(homingsolution.getInventoryType(), inventory);\r
+ assertEquals(homingsolution.isRehome(), true);\r
+ assertEquals(homingsolution.getServiceInstanceId(), "serviceInstanceId");\r
+ assertEquals(homingsolution.getCloudOwner(), "cloudOwner");\r
+ assertEquals(homingsolution.getCloudRegionId(), "cloudRegionId");\r
+ assertEquals(homingsolution.getAicClli(), "aicClli");\r
+ assertEquals(homingsolution.getAicVersion(), "aicVersion");\r
+ assertEquals(homingsolution.getTenant(), "tenant");\r
+ assertEquals(homingsolution.getVnf(), vnfresource);\r
+ assertEquals(homingsolution.getLicense(), license);\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+\r
+import static org.junit.Assert.assertArrayEquals;\r
+import static org.junit.Assert.assertEquals;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import org.junit.runner.RunWith;\r
+import org.mockito.BDDMockito.Then;\r
+import org.mockito.InjectMocks;\r
+import org.mockito.Mock;\r
+import org.powermock.api.mockito.PowerMockito;\r
+import org.powermock.core.classloader.annotations.PrepareForTest;\r
+import org.powermock.modules.junit4.PowerMockRunner;\r
+\r
+\r
+//@RunWith(PowerMockRunner.class)\r
+//@PrepareForTest({License.class})\r
+public class LicenseTest {\r
+ \r
+ //@Mock\r
+ private License license= new License();\r
+ //@InjectMocks\r
+ //private LicenseTest licenceTest;\r
+ List<String> entitlementPoolList = new ArrayList<String>();\r
+ private List<String> licenseKeyGroupList = new ArrayList<String>();\r
+ //JSONArray array = new JSONArray(entitlementPoolList);\r
+ //JSONArray array1 = new JSONArray(licenseKeyGroupList);\r
+ //@PrepareForTest({License.class})\r
+ Long serialVersionUID = 333L;\r
+ \r
+ @Test\r
+ public void testLicense() {\r
+ license.setEntitlementPoolList(entitlementPoolList);\r
+ license.setLicenseKeyGroupList(licenseKeyGroupList);\r
+ //license.addEntitlementPool("entitlementPoolUuid");\r
+ license.addLicenseKeyGroup("licenseKeyGroupUuid");\r
+ assertEquals(license.getEntitlementPoolList(), entitlementPoolList);\r
+ assertEquals(license.getLicenseKeyGroupList(), licenseKeyGroupList);\r
+ assert(license.getEntitlementPoolListAsString()!= null);\r
+ assert(license.getLicenseKeyGroupListAsString()!=null);\r
+ license.addEntitlementPool("entitlementPoolUuid");\r
+ //assertEquals(license.getSerialversionuid(), serialVersionUID);\r
+ //assertArrayEquals(license.getSerialversionuid(), serialVersionUID);\r
+ //assert\r
+ \r
+ /*PowerMockito.mockStatic(License.class);\r
+ Mockito.when(License.getSerialversionuid()).thenReturn(getserial());\r
+ assertEquals(License.getSerialversionuid(),"abc");*/\r
+ \r
+ }\r
+ // @Before \r
+ // public void mocksetUp() {\r
+// Long serialVersionUID = 333L;\r
+// PowerMockito.mockStatic(License.class);\r
+// expect (license.getSerialversionuid()).andReturn(serialVersionUID);\r
+// //PowerMockito.when(license.getSerialversionuid().\r
+// //PowerMockito.when(MathUtil.addInteger(2, 2)).thenReturn(1);\r
+// }\r
+ \r
+ /*private Long getserial() {\r
+ \r
+ return abc;\r
+ }*/\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ModelInfoTest {\r
+ private ModelInfo modelinfo = new ModelInfo();\r
+\r
+ @Test\r
+ public void testModelInfo() {\r
+ modelinfo.setModelName("modelName");\r
+ modelinfo.setModelUuid("modelUuid");\r
+ modelinfo.setModelInvariantUuid("modelInvariantUuid");\r
+ modelinfo.setModelVersion("modelVersion");\r
+ modelinfo.setModelCustomizationUuid("modelCustomizationUuid");\r
+ modelinfo.setModelInstanceName("modelInstanceName");\r
+ modelinfo.setModelType("modelType");\r
+ assertEquals(modelinfo.getModelName(), "modelName");\r
+ assertEquals(modelinfo.getModelUuid(), "modelUuid");\r
+ assertEquals(modelinfo.getModelInvariantUuid(), "modelInvariantUuid");\r
+ assertEquals(modelinfo.getModelVersion(), "modelVersion");\r
+ assertEquals(modelinfo.getModelCustomizationUuid(), "modelCustomizationUuid");\r
+ assertEquals(modelinfo.getModelInstanceName(), "modelInstanceName");\r
+ assertEquals(modelinfo.getModelType(), "modelType");\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ModuleResourceTest {\r
+ private ModuleResource moduleresource = new ModuleResource();\r
+\r
+ @Test\r
+ public void testModuleResource() {\r
+ \r
+ moduleresource.setVfModuleName("vfModuleName");\r
+ moduleresource.setHeatStackId("heatStackId");\r
+ moduleresource.setIsBase(true);\r
+ moduleresource.setVfModuleLabel("vfModuleLabel");\r
+ moduleresource.setInitialCount(0);\r
+ moduleresource.setVfModuleType("vfModuleType");\r
+ moduleresource.setHasVolumeGroup(true);\r
+ assertEquals(moduleresource.getVfModuleName(), "vfModuleName");\r
+ assertEquals(moduleresource.getHeatStackId(), "heatStackId");\r
+ assertEquals(moduleresource.getIsBase(), true);\r
+ assertEquals(moduleresource.getVfModuleLabel(), "vfModuleLabel");\r
+ assertEquals(moduleresource.getInitialCount(), 0);\r
+ assertEquals(moduleresource.getVfModuleType(), "vfModuleType");\r
+ assertEquals(moduleresource.isHasVolumeGroup(), true);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class NetworkResourceTest {\r
+ private NetworkResource nr = new NetworkResource();\r
+\r
+ @Test\r
+ public void testNetworkResource() {\r
+ nr.setNetworkType("networkType");\r
+ nr.setNetworkRole("networkRole");\r
+ nr.setNetworkTechnology("networkTechnology");\r
+ nr.setNetworkScope("networkScope");\r
+ assertEquals(nr.getNetworkType(), "networkType");\r
+ assertEquals(nr.getNetworkRole(), "networkRole");\r
+ assertEquals(nr.getNetworkTechnology(), "networkTechnology");\r
+ assertEquals(nr.getNetworkScope(), "networkScope");\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class OwningEntityTest {\r
+ private OwningEntity oe = new OwningEntity();\r
+\r
+ @Test\r
+ public void testOwingEntity() {\r
+ oe.setOwningEntityId("owningEntityId");\r
+ oe.setOwningEntityName("owningEntityName");\r
+ assertEquals(oe.getOwningEntityId(), "owningEntityId");\r
+ assertEquals(oe.getOwningEntityName(), "owningEntityName");\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ProjectTest {\r
+ \r
+ private Project project = new Project();\r
+\r
+ @Test\r
+ public void testProject() {\r
+ project.setProjectName("projectName");\r
+ assertEquals(project.getProjectName(), "projectName");\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class RequestTest {\r
+ \r
+ private Request request = new Request();\r
+ ModelInfo model = new ModelInfo();\r
+\r
+ @Test\r
+ public void testRequest() {\r
+ request.setSdncRequestId("sdncRequestId");\r
+ request.setRequestId("requestId");\r
+ request.setModelInfo(model);\r
+ request.setProductFamilyId("productFamilyId");\r
+ assertEquals(request.getSdncRequestId(), "sdncRequestId");\r
+ assertEquals(request.getRequestId(), "requestId");\r
+ assertEquals(request.getModelInfo(), model);\r
+ assertEquals(request.getProductFamilyId(), "productFamilyId");\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ResourceDecompositionTest {\r
+ \r
+ private ResourceDecomposition rd = new ResourceDecomposition() {\r
+ private static final long serialVersionUID = 1L;\r
+ };\r
+ ModelInfo model = new ModelInfo();\r
+ ResourceInstance ri = new ResourceInstance();\r
+ \r
+ \r
+\r
+ @Test\r
+ public void testResourceDecomposition() {\r
+ rd.setModelInfo(model);\r
+ rd.setInstanceData(ri);\r
+ rd.setResourceType("resourceType");\r
+ rd.setResourceInstanceId("newInstanceId");\r
+ rd.setResourceInstanceName("newInstanceName");\r
+ assertEquals(rd.getResourceModel(), model);\r
+ assertEquals(rd.getModelInfo(), model);\r
+ assertEquals(rd.getInstanceData(), ri);\r
+ assertEquals(rd.getResourceInstanceId(), "newInstanceId");\r
+ assertEquals(rd.getResourceInstanceName(), "newInstanceName");\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ResourceTest {\r
+ private Resource resource = new Resource() {\r
+ private static final long serialVersionUID = 1L;\r
+ \r
+ \r
+ };\r
+ ModelInfo model = new ModelInfo();\r
+ ResourceInstance ri = new ResourceInstance();\r
+ HomingSolution hs = new HomingSolution();\r
+ ResourceType rt = ResourceType.VNF;\r
+ public long concurrencyCounter = 1L;\r
+ long initval = resource.getConcurrencyCounter();\r
+\r
+ @Test\r
+ public void testResource() {\r
+ resource.setResourceId("resourceId");\r
+ resource.setModelInfo(model);\r
+ resource.setResourceInstance(ri);\r
+ resource.setHomingSolution(hs);\r
+ resource.setCurrentHomingSolution(hs);\r
+ resource.setResourceType(rt);\r
+ resource.setToscaNodeType("toscaNodeType");\r
+ resource.setResourceInstanceId("newInstanceId");\r
+ resource.setResourceInstanceName("newInstanceName");\r
+ resource.incrementConcurrencyCounter();\r
+ assertEquals(resource.getResourceId(), "resourceId");\r
+ assertEquals(resource.getModelInfo(), model);\r
+ assertEquals(resource.getResourceInstance(), ri);\r
+ assertEquals(resource.getHomingSolution(), hs);\r
+ assertEquals(resource.getCurrentHomingSolution(), hs);\r
+ assertEquals(resource.getResourceType(), rt);\r
+ assertEquals(resource.getToscaNodeType(), "toscaNodeType");\r
+ assertEquals(resource.getResourceInstanceId(), "newInstanceId");\r
+ assertEquals(resource.getResourceInstanceName(), "newInstanceName");\r
+ assertEquals(resource.getConcurrencyCounter(), initval+1);\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.List;\r
+\r
+import org.junit.Test;\r
+\r
+public class ServiceDecompositionTest {\r
+ private ServiceDecomposition sd = new ServiceDecomposition();\r
+ ModelInfo model= new ModelInfo();\r
+ ServiceInstance si= new ServiceInstance();\r
+ Project project= new Project();\r
+ OwningEntity oe= new OwningEntity();\r
+ //VnfResource vnf = new VnfResource();\r
+ List<VnfResource> vnfResources;\r
+ List<NetworkResource> networkResources;\r
+ List<ConfigResource> configResources;\r
+ List<AllottedResource> allottedResources;\r
+ Request request= new Request();\r
+ Customer customer= new Customer();\r
+ \r
+\r
+ @Test\r
+ public void testServiceDecomposition() {\r
+ sd.setModelInfo(model);\r
+ sd.setServiceInstance(si);\r
+ sd.setProject(project);\r
+ sd.setOwningEntity(oe);\r
+ sd.setServiceVnfs(vnfResources);\r
+ sd.setServiceConfigs(configResources);\r
+ sd.setServiceNetworks(networkResources);\r
+ sd.setServiceAllottedResources(allottedResources);\r
+ sd.setServiceConfigResources(configResources);\r
+ sd.setServiceType("serviceType");\r
+ sd.setServiceRole("serviceRole");\r
+ sd.setRequest(request);\r
+ sd.setCustomer(customer);\r
+ sd.setCallbackURN("callbackURN");\r
+ sd.setSdncVersion("sdncVersion");\r
+ assertEquals(sd.getModelInfo(), model);\r
+ assertEquals(sd.getServiceInstance(), si);\r
+ assertEquals(sd.getProject(), project);\r
+ assertEquals(sd.getOwningEntity(), oe);\r
+ assertEquals(sd.getServiceVnfs(), vnfResources);\r
+ assertEquals(sd.getServiceConfigs(), configResources);\r
+ assertEquals(sd.getServiceNetworks(), networkResources);\r
+ assertEquals(sd.getServiceAllottedResources(), allottedResources);\r
+ assertEquals(sd.getServiceConfigResources(), configResources);\r
+ assertEquals(sd.getRequest(), request);\r
+ assertEquals(sd.getCustomer(), customer);\r
+ assertEquals(sd.getCallbackURN(), "callbackURN");\r
+ assertEquals(sd.getSdncVersion(), "sdncVersion");\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.Map;\r
+\r
+import org.junit.Test;\r
+\r
+public class ServiceInstanceTest {\r
+ \r
+ private ServiceInstance si= new ServiceInstance();\r
+ Map serviceParams;\r
+ Configuration config= new Configuration();\r
+ ModelInfo model= new ModelInfo();\r
+\r
+ @Test\r
+ public void testServiceInstance() {\r
+ si.setServiceType("serviceType");\r
+ si.setServiceId("serviceId");\r
+ si.setServiceParams(serviceParams);\r
+ si.setInstanceId("instanceId");\r
+ si.setInstanceName("instanceName");\r
+ si.setOrchestrationStatus("orchestrationStatus");\r
+ si.setConfiguration(config);\r
+ si.setModelInfo(model);\r
+ si.setEnvironmentContext("environmentContext");\r
+ si.setWorkloadContext("workloadContext");\r
+ assertEquals(si.getServiceType(), "serviceType");\r
+ assertEquals(si.getServiceId(), "serviceId");\r
+ assertEquals(si.getServiceParams(), serviceParams);\r
+ assertEquals(si.getInstanceId(), "instanceId");\r
+ assertEquals(si.getInstanceName(), "instanceName");\r
+ assertEquals(si.getOrchestrationStatus(), "orchestrationStatus");\r
+ assertEquals(si.getConfiguration(), config);\r
+ assertEquals(si.getModelInfo(), model);\r
+ assertEquals(si.getEnvironmentContext(), "environmentContext");\r
+ assertEquals(si.getWorkloadContext(), "workloadContext");\r
+ \r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class SubscriberTest {\r
+ Subscriber subscriber= new Subscriber("globalId", "name", "commonSiteId");\r
+\r
+ @Test\r
+ public void testSubscriber() {\r
+ subscriber.setGlobalId("globalId");\r
+ subscriber.setName("name");\r
+ subscriber.setCommonSiteId("commonSiteId");\r
+ assertEquals(subscriber.getGlobalId(), "globalId");\r
+ assertEquals(subscriber.getName(), "name");\r
+ assertEquals(subscriber.getCommonSiteId(), "commonSiteId");\r
+ \r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class TunnelConnectTest {\r
+ private TunnelConnect tc= new TunnelConnect();\r
+\r
+ @Test\r
+ public void testTunnelConnect() {\r
+ tc.setId("id");\r
+ tc.setUpBandwidth("upBandwidth");\r
+ tc.setDownBandwidth("downBandwidth");\r
+ tc.setUpBandwidth2("upBandwidth2");\r
+ tc.setDownBandwidth2("downBandwidth2");\r
+ assertEquals(tc.getId(), "id");\r
+ assertEquals(tc.getUpBandwidth(), "upBandwidth");\r
+ assertEquals(tc.getDownBandwidth(), "downBandwidth");\r
+ assertEquals(tc.getUpBandwidth2(), "upBandwidth2");\r
+ assertEquals(tc.getDownBandwidth2(), "downBandwidth2");\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.bpmn.core.domain;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import java.util.List;\r
+\r
+import org.junit.Test;\r
+\r
+public class VnfResourceTest {\r
+ \r
+ private VnfResource vnf= new VnfResource();\r
+ List<ModuleResource> moduleResources;\r
+\r
+ @Test\r
+ public void testVnfResource() {\r
+ vnf.setModules(moduleResources);\r
+ vnf.setVnfHostname("vnfHostname");\r
+ vnf.setVnfType("vnfType");\r
+ vnf.setNfFunction("nfFunction");\r
+ vnf.setNfType("nfType");\r
+ vnf.setNfRole("nfRole");\r
+ vnf.setNfNamingCode("nfNamingCode");\r
+ vnf.setMultiStageDesign("multiStageDesign");\r
+ assertEquals(vnf.getVfModules(), moduleResources);\r
+ assertEquals(vnf.getVnfHostname(), "vnfHostname");\r
+ assertEquals(vnf.getVnfType(), "vnfType");\r
+ assertEquals(vnf.getNfFunction(), "nfFunction");\r
+ assertEquals(vnf.getNfType(), "nfType");\r
+ assertEquals(vnf.getNfRole(), "nfRole");\r
+ assertEquals(vnf.getNfNamingCode(), "nfNamingCode");\r
+ assertEquals(vnf.getMultiStageDesign(), "multiStageDesign");\r
+ \r
+ \r
+ }\r
+\r
+}\r