* ============LICENSE_END=========================================================\r
*/\r
\r
-package org.openecomp.mso.adapters.vnf.test;\r
+package org.openecomp.mso.adapters.vnf;\r
\r
import java.util.HashMap;\r
import java.util.Map;\r
* ============LICENSE_END=========================================================\r
*/\r
\r
-package org.openecomp.mso.adapters.vnf.test;\r
+package org.openecomp.mso.adapters.vnf;\r
\r
import java.util.HashMap;\r
import java.util.Map;\r
* ============LICENSE_END=========================================================\r
*/\r
\r
-package org.openecomp.mso.adapters.vnf.test;\r
+package org.openecomp.mso.adapters.vnf;\r
\r
import java.util.HashMap;\r
import java.util.Map;\r
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.adapters.vnf.test;
+package org.openecomp.mso.adapters.vnf;
import static org.junit.Assert.assertFalse;
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.adapters.vnf.test;
+package org.openecomp.mso.adapters.vnf;
import java.util.HashMap;
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.adapters.vnf.test;
+package org.openecomp.mso.adapters.vnf;
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.adapters.vnf.test;
+package org.openecomp.mso.adapters.vnf;
import java.util.Map;
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
- <version>4.5.5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
*/\r
package org.openecomp.mso.bpmn.common.recipe;\r
\r
+import org.openecomp.mso.bpmn.core.domain.ModelInfo;\r
+\r
import com.fasterxml.jackson.annotation.JsonProperty;\r
import com.fasterxml.jackson.annotation.JsonPropertyOrder;\r
import com.fasterxml.jackson.annotation.JsonRootName;\r
* @author\r
* @version ONAP Beijing Release 2018-03-08\r
*/\r
-@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "resourceType","resourceCustomizationUuid"})\r
+@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "serviceModelInfo","resourceModelInfo", "resourceInstancenUuid","resourceParameters","operationType"})\r
@JsonRootName("variables")\r
public class ResourceInput {\r
\r
@JsonProperty("operationId")\r
private String operationId;\r
\r
- //for create resource\r
- @JsonProperty("resourceInvariantUuid")\r
- private String resourceInvariantUuid;\r
+ @JsonProperty("serviceModelInfo")\r
+ private ModelInfo serviceModelInfo;\r
\r
- //for create resource\r
- @JsonProperty("resourceUuid")\r
- private String resourceUuid;\r
-\r
- //for create resource\r
- @JsonProperty("resourceCustomizationUuid")\r
- private String resourceCustomizationUuid;\r
+ @JsonProperty("resourceModelInfo")\r
+ private ModelInfo resourceModelInfo;\r
\r
//for delete resource\r
@JsonProperty("resourceInstancenUuid")\r
public void setOperationId(String operationId) {\r
this.operationId = operationId;\r
}\r
- \r
- \r
\r
/**\r
- * @return Returns the resourceInvariantUuid.\r
+ * @return Returns the serviceModelInfo.\r
*/\r
- @JsonProperty("resourceInvariantUuid")\r
- public String getResourceInvariantUuid() {\r
- return resourceInvariantUuid;\r
+ @JsonProperty("serviceModelInfo")\r
+ public ModelInfo getServiceModelInfo() {\r
+ return serviceModelInfo;\r
}\r
\r
\r
\r
/**\r
- * @param resourceInvariantUuid The resourceInvariantUuid to set.\r
+ * @param serviceModelInfo The serviceModelInfo to set.\r
*/\r
- @JsonProperty("resourceInvariantUuid")\r
- public void setResourceInvariantUuid(String resourceInvariantUuid) {\r
- this.resourceInvariantUuid = resourceInvariantUuid;\r
+ @JsonProperty("serviceModelInfo")\r
+ public void setServiceModelInfo(ModelInfo serviceModelInfo) {\r
+ this.serviceModelInfo = serviceModelInfo;\r
}\r
\r
\r
\r
/**\r
- * @return Returns the resourceUuid.\r
+ * @return Returns the resourceModelInfo.\r
*/\r
- @JsonProperty("resourceUuid")\r
- public String getResourceUuid() {\r
- return resourceUuid;\r
+ @JsonProperty("resourceModelInfo")\r
+ public ModelInfo getResourceModelInfo() {\r
+ return resourceModelInfo;\r
}\r
\r
\r
\r
/**\r
- * @param resourceUuid The resourceUuid to set.\r
- */\r
- @JsonProperty("resourceUuid")\r
- public void setResourceUuid(String resourceUuid) {\r
- this.resourceUuid = resourceUuid;\r
- }\r
-\r
-\r
- /**\r
- * @return Returns the resourceCustomizationUuid.\r
+ * @param resourceModelInfo The resourceModelInfo to set.\r
*/\r
- @JsonProperty("resourceCustomizationUuid")\r
- public String getResourceCustomizationUuid() {\r
- return resourceCustomizationUuid;\r
+ @JsonProperty("resourceModelInfo")\r
+ public void setResourceModelInfo(ModelInfo resourceModelInfo) {\r
+ this.resourceModelInfo = resourceModelInfo;\r
}\r
\r
- \r
- /**\r
- * @param resourceCustomizationUuid The resourceCustomizationUuid to set.\r
- */\r
- @JsonProperty("resourceCustomizationUuid")\r
- public void setResourceCustomizationUuid(String resourceCustomizationUuid) {\r
- this.resourceCustomizationUuid = resourceCustomizationUuid;\r
- }\r
\r
- \r
/**\r
* @return Returns the resourceParameters.\r
*/\r
<?xml version="1.0" encoding="UTF-8"?>
- <!--
- =========================================================================
- AT&T Proprietary (Internal Use Only) Not for use or disclosure outside
- the AT&T companies except under written agreement (c) 2015 AT&T
- Intellectual Property. All rights reserved. AT&T and the AT&T logo are
- trademarks of AT&T Intellectual Property.
- =======================================================================
- -->
<!--
================================================================
Description: This is the schema for LPP Configuration Component
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- =========================================================================
- AT&T Proprietary (Internal Use Only) Not for use or disclosure outside
- the AT&T companies except under written agreement (c) 2015 AT&T
- Intellectual Property. All rights reserved. AT&T and the AT&T logo are
- trademarks of AT&T Intellectual Property.
- =======================================================================
- -->
+
<!--
================================================================
Description: This is the schema for MSO Request data
*/
package org.openecomp.mso.bpmn.common.recipe;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import org.junit.Test;
+import org.openecomp.mso.bpmn.core.domain.ModelInfo;
public class ResourceInputTest {
ri.setServiceType("serviceType");
ri.setServiceInstanceId("serviceId");
ri.setOperationId("operationId");
- ri.setResourceInvariantUuid("resourceInvariantUuid");
- ri.setResourceUuid("resourceUuid");
- ri.setResourceCustomizationUuid("resourceCustomizationUuid");
+ ModelInfo serviceModelInfo = new ModelInfo();
+ serviceModelInfo.setModelCustomizationUuid("modelCustomizationUuid");
+ serviceModelInfo.setModelInvariantUuid("modelInvariantUuid");
+ serviceModelInfo.setModelUuid("modelUuid");
+ ri.setServiceModelInfo(serviceModelInfo);
+ ModelInfo resourceModelInfo = new ModelInfo();
+ resourceModelInfo.setModelCustomizationUuid("modelCustomizationUuid");
+ resourceModelInfo.setModelInvariantUuid("modelInvariantUuid");
+ resourceModelInfo.setModelUuid("modelUuid");
+ ri.setResourceModelInfo(resourceModelInfo);
ri.setResourceInstancenUuid("resourceInstancenUuid");
ri.setResourceParameters("resourceParameters");
ri.setOperationType("operationType");
assertEquals(ri.getServiceType(), "serviceType");
assertEquals(ri.getServiceInstanceId(), "serviceId");
assertEquals(ri.getOperationId(), "operationId");
- assertEquals(ri.getResourceInvariantUuid(), "resourceInvariantUuid");
- assertEquals(ri.getResourceUuid(), "resourceUuid");
- assertEquals(ri.getResourceCustomizationUuid(), "resourceCustomizationUuid");
assertEquals(ri.getResourceInstancenUuid(), "resourceInstancenUuid");
assertEquals(ri.getResourceParameters(), "resourceParameters");
assertEquals(ri.getOperationType(), "operationType");
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.core;
+
+import org.junit.Test;
+
+public class HealthCheckHandlerTest {
+
+ HealthCheckHandler healthCheckHandler = new HealthCheckHandler();
+
+ @Test
+ public void nodeHealthcheck() throws Exception {
+ healthCheckHandler.nodeHealthcheck();
+ }
+
+ @Test
+ public void healthcheck() throws Exception {
+ healthCheckHandler.healthcheck("test-123");
+ }
+
+}
\ No newline at end of file
--- /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
String sdncCallback = execution.getVariable("URN_mso_workflow_sdncadapter_callback")\r
String createNetworkInput = execution.getVariable(Prefix + "networkRequest")\r
\r
+ String hdrRequestId = execution.getVariable("mso-request-id")\r
String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId")\r
- \r
+ String source = execution.getVariable("source")\r
+ String sdnc_service_id = execution.getVariable(Prefix + "sdncServiceId")\r
+ ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")\r
+ String serviceType = resourceInputObj.getServiceType()\r
+ String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid()\r
+ String serviceModelUuid = resourceInputObj.getServiceModelInfo().getModelUuid()\r
+ String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelName()\r
+ String serviceModelName = resourceInputObj.getServiceModelInfo().getModelVersion()\r
+ String globalCustomerId = resourceInputObj.getGlobalSubscriberId()\r
+ String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();\r
+ String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()\r
+ String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()\r
+ String modelName = resourceInputObj.getResourceModelInfo().getModelName()\r
+ String modelVersion = resourceInputObj.getResourceModelInfo().getModelVersion()\r
+ String resourceInputPrameters = resourceInputObj.getResourceParameters()\r
+ String netowrkInputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")\r
+ //here convert json string to xml string\r
+ String netowrkInputParameters = jsonUtil.json2xml(netowrkInputParametersJson)\r
// 1. prepare assign topology via SDNC Adapter SUBFLOW call\r
String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, sdnc_svcAction, sdnc_requestAction, null, null, null)\r
-\r
+ String content =\r
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
+ xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1" \r
+ xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1">\r
+ <sdncadapter:RequestHeader>\r
+ <sdncadapter:RequestId>${hdrRequestId}</sdncadapter:RequestId>\r
+ <sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId>\r
+ <sdncadapter:SvcAction>${sdnc_svcAction}</sdncadapter:SvcAction>\r
+ <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>\r
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>\r
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>\r
+ </sdncadapter:RequestHeader>\r
+ <sdncadapterworkflow:SDNCRequestData>\r
+ <request-information>\r
+ <request-id>${hdrRequestId}</request-id>\r
+ <request-action>${sdnc_requestAction}</request-action>\r
+ <source>${source}</source>\r
+ <notification-url></notification-url>\r
+ <order-number></order-number>\r
+ <order-version></order-version>\r
+ </request-information>\r
+ <service-information>\r
+ <service-id>${sdnc_service_id}</service-id>\r
+ <subscription-service-type>${serviceType}</subscription-service-type>\r
+ <ecomp-model-information>\r
+ <model-invariant-uuid>${serviceModelInvariantUuid}</model-invariant-uuid>\r
+ <model-uuid>${serviceModelUuid}</model-uuid>\r
+ <model-version>${serviceModelVersion}</model-version>\r
+ <model-name>${serviceModelName}</model-name>\r
+ </ecomp-model-information>\r
+ <service-instance-id>${serviceInstanceId}</service-instance-id>\r
+ <global-customer-id>${globalCustomerId}</global-customer-id>\r
+ </service-information>\r
+ <network-information>\r
+ <ecomp-model-information>\r
+ <model-invariant-uuid>${modelInvariantUuid}</model-invariant-uuid>\r
+ <model-customization-uuid>${modelCustomizationUuid}</model-customization-uuid>\r
+ <model-uuid>${modelUuid}</model-uuid>\r
+ <model-version>${modelVersion}</model-version>\r
+ <model-name>${modelName}</model-name>\r
+ </ecomp-model-information>\r
+ </network-information>\r
+ <network-request-input>\r
+ <network-input-parameters>${netowrkInputParameters}</network-input-parameters>\r
+ </network-request-input>\r
+ </sdncadapterworkflow:SDNCRequestData>\r
+ </aetgt:SDNCAdapterWorkflowRequest>""".trim()\r
+ \r
String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest)\r
utils.logAudit(sndcTopologyCreateRequesAsString)\r
execution.setVariable(Prefix + "createSDNCRequest", sndcTopologyCreateRequesAsString)\r
import java.util.List;\r
import java.util.UUID;\r
\r
-import javax.mail.Quota.Resource;\r
-\r
import org.camunda.bpm.engine.delegate.BpmnError\r
import org.camunda.bpm.engine.runtime.Execution\r
import org.camunda.bpm.engine.delegate.DelegateExecution\r
import java.util.List;
import java.util.UUID;
-import javax.mail.Quota.Resource;
-
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
- String resourceCustomizationUuid = currentResource.getModelInfo().getModelCustomizationUuid()
- resourceInput.setResourceCustomizationUuid(resourceCustomizationUuid);
- String resourceInvariantUuid = currentResource.getModelInfo().getModelInvariantUuid()
- resourceInput.setResourceInvariantUuid(resourceInvariantUuid)
- String resourceUuid = currentResource.getModelInfo().getModelUuid()
- resourceInput.setResourceUuid(resourceUuid)
+ resourceInput.setResourceModelInfo(currentResource.getModelInfo());
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ resourceInput.setServiceModelInfo(serviceDecomposition.getModelInfo());
String incomingRequest = execution.getVariable("uuiRequest")
//set the requestInputs from tempalte To Be Done
import groovy.util.XmlParser;
import groovy.xml.QName
-import java.beans.MetaData.java_lang_Class_PersistenceDelegate
import java.io.Serializable;
import java.util.UUID;
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.VidUtils;
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.bpmn.core.domain.ModelInfo
import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
import groovy.util.XmlParser;\r
import groovy.xml.QName\r
\r
-import java.beans.MetaData.java_lang_Class_PersistenceDelegate\r
import java.io.Serializable;\r
import java.util.UUID;\r
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil\r
import org.openecomp.mso.bpmn.common.scripts.VidUtils;\r
import org.openecomp.mso.bpmn.core.RollbackData\r
import org.openecomp.mso.bpmn.core.WorkflowException\r
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil\r
import org.openecomp.mso.bpmn.core.json.JsonUtils\r
import org.openecomp.mso.bpmn.core.domain.ModelInfo\r
import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition\r
import org.json.JSONArray
import org.json.JSONObject
-import java.beans.MetaData.java_lang_Class_PersistenceDelegate
import java.io.Serializable;
import java.util.List
import java.util.UUID;
import org.openecomp.mso.bpmn.common.scripts.VidUtils;
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.bpmn.core.domain.ModelInfo
import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
import groovy.util.XmlParser;
import groovy.xml.QName
-import java.beans.MetaData.java_lang_Class_PersistenceDelegate
import java.io.Serializable;
import java.util.UUID;
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.VidUtils;
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.bpmn.core.domain.ModelInfo
import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
import groovy.util.XmlParser;
import groovy.xml.QName
-import java.beans.MetaData.java_lang_Class_PersistenceDelegate
import java.io.Serializable;
import java.util.UUID;
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.VidUtils;
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.bpmn.core.domain.ModelInfo
import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
-<!-- <version>4.3.1</version> -->
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
-<!-- <version>4.5.5</version> -->
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
File configFile = new File(CONFIG_FILE);
String uuid = "";
BufferedReader in = null;
- BufferedWriter bw = null;
- try {
+ try{
// Verify whether instanceUUID file exist,
// If yes, read the content; if not, generate the instanceUUID and
// write to the file
if ((uuid = in.readLine()) == null) {
// the file is empty, regenerate the file
uuid = UUID.randomUUID().toString();
- FileWriter fw = new FileWriter(configFile.getAbsoluteFile());
- bw = new BufferedWriter(fw);
+ try(BufferedWriter bw = new BufferedWriter(new FileWriter(configFile.getAbsoluteFile()))) {
bw.write(uuid);
- bw.close();
+ } catch (IOException e) {
+ LOGGER.log(Level.SEVERE, "Error trying to write UUID file", e);
+ }
}
in.close();
} else {
uuid = UUID.randomUUID().toString();
configFile.getParentFile().mkdirs();
configFile.createNewFile();
- FileWriter fw = new FileWriter(configFile.getAbsoluteFile());
- bw = new BufferedWriter(fw);
- bw.write(uuid);
- bw.close();
+ try(BufferedWriter bw1 = new BufferedWriter(new FileWriter(configFile.getAbsoluteFile()))){
+ bw1.write(uuid);
+ } catch (IOException e) {
+ LOGGER.log(Level.SEVERE, "Error trying to write UUID file", e);
+ }
}
} catch (IOException e) {
- LOGGER.log(Level.SEVERE, "Error trying to read UUID file", e);
+ LOGGER.log(Level.SEVERE, "Error trying to read UUID file", e);
} finally {
try {
if (in != null) {
in.close();
}
- if (bw != null) {
- bw.close();
- }
} catch (IOException ex) {
LOGGER.log(Level.SEVERE, "Error trying to close UUID file", ex);
}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package org.openecomp.mso.client.aai.objects;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class AAIOperationalEnvironmentTest {
+
+ AAIOperationalEnvironment aaiOE =new AAIOperationalEnvironment();
+
+ @Test
+ public void test() {
+ aaiOE.setOperationalEnvironmentId("operationalEnvironmentId");
+ aaiOE.setOperationalEnvironmentName("operationalEnvironmentName");
+ aaiOE.setOperationalEnvironmentStatus("operationalEnvironmentStatus");
+ aaiOE.setOperationalEnvironmentType("operationalEnvironmentType");
+ aaiOE.setResourceVersion("resourceVersion");
+ aaiOE.setTenantContext("tenantContext");
+ aaiOE.setWorkloadContext("workloadContext");
+ assertEquals(aaiOE.getOperationalEnvironmentId(),"operationalEnvironmentId");
+ assertEquals(aaiOE.getOperationalEnvironmentName(),"operationalEnvironmentName");
+ assertEquals(aaiOE.getOperationalEnvironmentStatus(),"operationalEnvironmentStatus");
+ assertEquals(aaiOE.getOperationalEnvironmentType(),"operationalEnvironmentType");
+ assertEquals(aaiOE.getResourceVersion(),"resourceVersion");
+ assertEquals(aaiOE.getTenantContext(),"tenantContext");
+ assertEquals(aaiOE.getWorkloadContext(),"workloadContext");
+ aaiOE.withOperationalEnvironmentId("operationalEnvironmentId");
+ aaiOE.withOperationalEnvironmentName("operationalEnvironmentName");
+ aaiOE.withOperationalEnvironmentStatus("operationalEnvironmentStatus");
+ aaiOE.withOperationalEnvironmentType("operationalEnvironmentType");
+ aaiOE.withResourceVersion("resourceVersion");
+ aaiOE.withTenantContext("tenantContext");
+ aaiOE.withWorkloadContext("workloadContext");
+ }
+
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package org.openecomp.mso.client.aai.objects;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.openecomp.mso.client.aai.AAIObjectType;
+import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri;
+import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory;
+
+public class AAIOwningEntityTest {
+ AAIOwningEntity aaiOE= new AAIOwningEntity();
+ @Test
+ public void test() {
+ aaiOE.setOwningEntityId("OwningEntityId");
+ aaiOE.setOwningEntityName("OwningEntityName");
+ assertEquals(aaiOE.getOwningEntityId(), "OwningEntityId");
+ assertEquals(aaiOE.getOwningEntityName(), "OwningEntityName");
+ aaiOE.withOwningEntity("OwningEntityId1", "OwningEntityName1");
+ assert(aaiOE.getUri()!=null);
+ }
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package org.openecomp.mso.client.aai.objects;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.openecomp.mso.client.aai.AAIObjectType;
+import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri;
+import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory;
+
+public class AAIProjectTest {
+
+
+ @Test
+ public void test() {
+ AAIProject aaiP =new AAIProject();
+ aaiP.setProjectName("projectName");
+ assertEquals(aaiP.getProjectName(),"projectName");
+ aaiP.withProjectName("projectName");
+ assert(aaiP.getUri()!=null);
+
+ }
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package org.openecomp.mso.client.aai.objects;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class AAIServiceInstanceTest {
+
+ @Test
+ public void test() {
+ AAIServiceInstance aaiSI= new AAIServiceInstance();
+ aaiSI.setEnvironmentContext("environmentContext");
+ aaiSI.setModelInvariantUuid("modelInvariantUuid");
+ aaiSI.setModelUuid("modelUuid");
+ aaiSI.setoStatus("oStatus");
+ aaiSI.setServiceInstanceId("serviceInstanceId");
+ aaiSI.setServiceInstanceName("serviceInstanceName");
+ aaiSI.setServiceRole("serviceRole");
+ aaiSI.setServiceType("serviceType");
+ aaiSI.setWorkloadContext("workloadContext");
+ assertEquals(aaiSI.getEnvironmentContext(), "environmentContext");
+ assertEquals(aaiSI.getModelInvariantUuid(), "modelInvariantUuid");
+ assertEquals(aaiSI.getModelUuid(), "modelUuid");
+ assertEquals(aaiSI.getoStatus(), "oStatus");
+ assertEquals(aaiSI.getServiceInstanceId(), "serviceInstanceId");
+ assertEquals(aaiSI.getServiceInstanceName(), "serviceInstanceName");
+ assertEquals(aaiSI.getServiceRole(), "serviceRole");
+ assertEquals(aaiSI.getServiceType(), "serviceType");
+ assertEquals(aaiSI.getWorkloadContext(), "workloadContext");
+ aaiSI.withServiceInstance("serviceInstanceId");
+ assert(aaiSI.getUri()!=null);
+ }
+
+}
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
- <version>4.4.1</version>
+ <version>4.4.4</version>
<scope>compile</scope>
</dependency>
<dependency>