diff options
Diffstat (limited to 'vid-app-common/src/test/java/org/openecomp/vid/model')
7 files changed, 826 insertions, 1 deletions
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/ModelUtilTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/ModelUtilTest.java new file mode 100644 index 00000000..8a9f4de8 --- /dev/null +++ b/vid-app-common/src/test/java/org/openecomp/vid/model/ModelUtilTest.java @@ -0,0 +1,48 @@ +package org.openecomp.vid.model; + +import org.junit.Assert; +import org.junit.Test; + + +public class ModelUtilTest { + + private ModelUtil createTestSubject() { + return new ModelUtil(); + } + + + @Test + public void testGetTags() throws Exception { + String[] namespaces; + String constantValue = "test"; + String[] result; + + // test 1 + namespaces = null; + result = ModelUtil.getTags(namespaces, constantValue); + Assert.assertNull(result); + + // test 2 + namespaces = new String[] { "" }; + result = ModelUtil.getTags(namespaces, constantValue); + Assert.assertArrayEquals(new String[] { constantValue }, result); + } + + + @Test + public void testIsType() throws Exception { + String type = "a"; + String[] tags; + boolean result; + + // test 1 + tags = null; + result = ModelUtil.isType(type, tags); + Assert.assertEquals(false, result); + + // test 2 + tags = new String[] { "a" }; + result = ModelUtil.isType(type, tags); + Assert.assertEquals(true, result); + } +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/NewNodeTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/NewNodeTest.java new file mode 100644 index 00000000..fb75c749 --- /dev/null +++ b/vid-app-common/src/test/java/org/openecomp/vid/model/NewNodeTest.java @@ -0,0 +1,212 @@ +package org.openecomp.vid.model; + +import java.util.Map; + +import org.junit.Test; +import org.openecomp.vid.asdc.beans.tosca.Input; + + +public class NewNodeTest { + + private NewNode createTestSubject() { + return new NewNode(); + } + + + @Test + public void testGetUuid() throws Exception { + NewNode testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUuid(); + } + + + @Test + public void testGetInvariantUuid() throws Exception { + NewNode testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInvariantUuid(); + } + + + @Test + public void testGetDescription() throws Exception { + NewNode testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDescription(); + } + + + @Test + public void testGetName() throws Exception { + NewNode testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + + @Test + public void testGetVersion() throws Exception { + NewNode testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVersion(); + } + + + @Test + public void testGetCustomizationUuid() throws Exception { + NewNode testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCustomizationUuid(); + } + + + @Test + public void testGetInputs() throws Exception { + NewNode testSubject; + Map<String, Input> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInputs(); + } + + + @Test + public void testGetCommands() throws Exception { + NewNode testSubject; + Map<String, CommandProperty> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCommands(); + } + + + @Test + public void testGetProperties() throws Exception { + NewNode testSubject; + Map<String, String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProperties(); + } + + + @Test + public void testSetUuid() throws Exception { + NewNode testSubject; + String uuid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setUuid(uuid); + } + + + @Test + public void testSetInvariantUuid() throws Exception { + NewNode testSubject; + String invariantUuid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setInvariantUuid(invariantUuid); + } + + + @Test + public void testSetDescription() throws Exception { + NewNode testSubject; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDescription(description); + } + + + @Test + public void testSetName() throws Exception { + NewNode testSubject; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setName(name); + } + + + @Test + public void testSetVersion() throws Exception { + NewNode testSubject; + String version = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVersion(version); + } + + + @Test + public void testSetCustomizationUuid() throws Exception { + NewNode testSubject; + String u = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setCustomizationUuid(u); + } + + + @Test + public void testSetInputs() throws Exception { + NewNode testSubject; + Map<String, Input> inputs = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInputs(inputs); + } + + + @Test + public void testSetCommands() throws Exception { + NewNode testSubject; + Map<String, CommandProperty> m = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCommands(m); + } + + + @Test + public void testSetProperties() throws Exception { + NewNode testSubject; + Map<String, String> p = null; + + // default test + testSubject = createTestSubject(); + testSubject.setProperties(p); + } +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/NewServiceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/NewServiceTest.java new file mode 100644 index 00000000..f7891427 --- /dev/null +++ b/vid-app-common/src/test/java/org/openecomp/vid/model/NewServiceTest.java @@ -0,0 +1,235 @@ +package org.openecomp.vid.model; + +import java.util.Map; + +import org.junit.Test; +import org.openecomp.vid.asdc.beans.tosca.Input; + +public class NewServiceTest { + + private NewService createTestSubject() { + return new NewService(); + } + + + @Test + public void testGetUuid() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUuid(); + } + + + @Test + public void testGetInvariantUuid() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInvariantUuid(); + } + + + @Test + public void testGetName() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + + @Test + public void testGetVersion() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVersion(); + } + + + @Test + public void testGetToscaModelURL() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getToscaModelURL(); + } + + + @Test + public void testGetCategory() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCategory(); + } + + + @Test + public void testGetDescription() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDescription(); + } + + + @Test + public void testGetInputs() throws Exception { + NewService testSubject; + Map<String, Input> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInputs(); + } + + + @Test + public void testGetServiceEcompNaming() throws Exception { + NewService testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceEcompNaming(); + } + + + @Test + public void testSetUuid() throws Exception { + NewService testSubject; + String uuid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setUuid(uuid); + } + + + @Test + public void testSetInvariantUuid() throws Exception { + NewService testSubject; + String invariantUuid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setInvariantUuid(invariantUuid); + } + + + @Test + public void testSetName() throws Exception { + NewService testSubject; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setName(name); + } + + + @Test + public void testSetVersion() throws Exception { + NewService testSubject; + String version = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVersion(version); + } + + + @Test + public void testSetToscaModelURL() throws Exception { + NewService testSubject; + String toscaModelURL = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setToscaModelURL(toscaModelURL); + } + + + @Test + public void testSetCategory() throws Exception { + NewService testSubject; + String category = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setCategory(category); + } + + + @Test + public void testSetDescription() throws Exception { + NewService testSubject; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDescription(description); + } + + + @Test + public void testSetInputs() throws Exception { + NewService testSubject; + Map<String, Input> inputs = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInputs(inputs); + } + + + @Test + public void testSetServiceEcompNaming() throws Exception { + NewService testSubject; + String serviceEcompNaming = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setServiceEcompNaming(serviceEcompNaming); + } + + + @Test + public void testHashCode() throws Exception { + NewService testSubject; + int result; + + // default test + testSubject = createTestSubject(); + testSubject.setUuid("cb49608f-5a24-4789-b0f7-2595473cb997"); + result = testSubject.hashCode(); + } + + + @Test + public void testEquals() throws Exception { + NewService testSubject; + Object o = null; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.equals(o); + } +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/NewVNFTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/NewVNFTest.java new file mode 100644 index 00000000..5f4f90b9 --- /dev/null +++ b/vid-app-common/src/test/java/org/openecomp/vid/model/NewVNFTest.java @@ -0,0 +1,88 @@ +package org.openecomp.vid.model; + +import java.util.Map; + +import org.junit.Test; + +public class NewVNFTest { + + private NewVNF createTestSubject() { + return new NewVNF(); + } + + + @Test + public void testGetModelCustomizationName() throws Exception { + NewVNF testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelCustomizationName(); + } + + + @Test + public void testGetVfModules() throws Exception { + NewVNF testSubject; + Map<String, VfModule> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVfModules(); + } + + + @Test + public void testSetVfModules() throws Exception { + NewVNF testSubject; + Map<String, VfModule> vfModules = null; + + // default test + testSubject = createTestSubject(); + testSubject.setVfModules(vfModules); + } + + + @Test + public void testGetVolumeGroups() throws Exception { + NewVNF testSubject; + Map<String, VolumeGroup> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVolumeGroups(); + } + + + @Test + public void testSetVolumeGroups() throws Exception { + NewVNF testSubject; + Map<String, VolumeGroup> volumeGroups = null; + + // default test + testSubject = createTestSubject(); + testSubject.setVolumeGroups(volumeGroups); + } + + + @Test + public void testSetModelCustomizationName() throws Exception { + NewVNF testSubject; + String modelCustomizationName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelCustomizationName(modelCustomizationName); + } + + + @Test + public void testNormalizeName() throws Exception { + String originalName = ""; + String result; + + // default test + result = NewVNF.normalizeName(originalName); + } +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/model/TestSuite.java index a58bbba0..3d7f57b3 100644 --- a/vid-app-common/src/test/java/org/openecomp/vid/model/TestSuite.java +++ b/vid-app-common/src/test/java/org/openecomp/vid/model/TestSuite.java @@ -6,6 +6,7 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses( -{ ServiceModelTest.class }) +{ ModelUtilTest.class, NewServiceTest.class, VolumeGroupTest.class, NewNodeTest.class, ServiceModelTest.class, + WorkflowTest.class, NewVNFTest.class }) public class TestSuite { // nothing } diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/VolumeGroupTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/VolumeGroupTest.java new file mode 100644 index 00000000..038290b2 --- /dev/null +++ b/vid-app-common/src/test/java/org/openecomp/vid/model/VolumeGroupTest.java @@ -0,0 +1,169 @@ +package org.openecomp.vid.model; + +import org.junit.Test; +import org.openecomp.vid.asdc.beans.tosca.Group; + + +public class VolumeGroupTest { + + private VolumeGroup createTestSubject() { + return new VolumeGroup(); + } + + + @Test + public void testGetUuid() throws Exception { + VolumeGroup testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUuid(); + } + + + @Test + public void testGetCustomizationUuid() throws Exception { + VolumeGroup testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCustomizationUuid(); + } + + + @Test + public void testGetModelCustomizationName() throws Exception { + VolumeGroup testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelCustomizationName(); + } + + + @Test + public void testGetInvariantUuid() throws Exception { + VolumeGroup testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInvariantUuid(); + } + + + @Test + public void testGetDescription() throws Exception { + VolumeGroup testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDescription(); + } + + + @Test + public void testGetName() throws Exception { + VolumeGroup testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + + @Test + public void testGetVersion() throws Exception { + VolumeGroup testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVersion(); + } + + + @Test + public void testSetUuid() throws Exception { + VolumeGroup testSubject; + String uuid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setUuid(uuid); + } + + + @Test + public void testSetInvariantUuid() throws Exception { + VolumeGroup testSubject; + String invariantUuid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setInvariantUuid(invariantUuid); + } + + + @Test + public void testSetDescription() throws Exception { + VolumeGroup testSubject; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDescription(description); + } + + + @Test + public void testSetName() throws Exception { + VolumeGroup testSubject; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setName(name); + } + + + @Test + public void testSetVersion() throws Exception { + VolumeGroup testSubject; + String version = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVersion(version); + } + + + @Test + public void testSetCustomizationUuid() throws Exception { + VolumeGroup testSubject; + String u = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setCustomizationUuid(u); + } + + + @Test + public void testSetModelCustomizationName() throws Exception { + VolumeGroup testSubject; + String u = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelCustomizationName(u); + } + + + +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/WorkflowTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/WorkflowTest.java new file mode 100644 index 00000000..5f8ec7d1 --- /dev/null +++ b/vid-app-common/src/test/java/org/openecomp/vid/model/WorkflowTest.java @@ -0,0 +1,72 @@ +package org.openecomp.vid.model; + +import java.util.Collection; + +import org.junit.Test; + +public class WorkflowTest { + + private Workflow createTestSubject() { + return new Workflow(); + } + + @Test + public void testGetId() throws Exception { + Workflow testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getId(); + } + + @Test + public void testGetWorkflowName() throws Exception { + Workflow testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getWorkflowName(); + } + + @Test + public void testGetVnfNames() throws Exception { + Workflow testSubject; + Collection<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVnfNames(); + } + + @Test + public void testSetId() throws Exception { + Workflow testSubject; + int id = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setId(id); + } + + @Test + public void testSetWorkflowName() throws Exception { + Workflow testSubject; + String workflowName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setWorkflowName(workflowName); + } + + @Test + public void testSetVnfName() throws Exception { + Workflow testSubject; + Collection<String> vnfNames = null; + + // default test + testSubject = createTestSubject(); + testSubject.setVnfName(vnfNames); + } +}
\ No newline at end of file |