diff options
author | 2017-01-31 11:40:03 +0100 | |
---|---|---|
committer | 2017-01-31 12:59:33 +0100 | |
commit | 025301d08b061482c1f046d562bf017c8cbcfe8d (patch) | |
tree | 68a2a549736c9bf0f7cd4e71c76e40ef7e2606f2 /asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/VfModuleStructureESTest.java | |
parent | 2754ad52f833278a5c925bd788a16d1dce16a598 (diff) |
Initial OpenECOMP MSO commit
Change-Id: Ia6a7574859480717402cc2f22534d9973a78fa6d
Signed-off-by: ChrisC <cc697w@intl.att.com>
Diffstat (limited to 'asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/VfModuleStructureESTest.java')
-rw-r--r-- | asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/VfModuleStructureESTest.java | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/VfModuleStructureESTest.java b/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/VfModuleStructureESTest.java new file mode 100644 index 0000000000..f3c20c5eb7 --- /dev/null +++ b/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/VfModuleStructureESTest.java @@ -0,0 +1,108 @@ +/* + * This file was automatically generated by EvoSuite + * Fri Nov 25 13:37:00 GMT 2016 + */ + +package org.openecomp.mso.asdc.installer; + +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.ViolatedAssumptionAnswer; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.openecomp.sdc.api.notification.INotificationData; +import org.openecomp.sdc.api.notification.IResourceInstance; +import org.openecomp.sdc.api.notification.IVfModuleMetadata; + +import java.util.LinkedList; +import java.util.List; + +import static org.evosuite.runtime.EvoAssertions.verifyException; +import static org.evosuite.shaded.org.mockito.Mockito.doReturn; +import static org.evosuite.shaded.org.mockito.Mockito.mock; +import static org.junit.Assert.fail; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class VfModuleStructureESTest extends VfModuleStructureESTestscaffolding { + + @Test(timeout = 4000) + public void test1() throws Throwable { + INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer()); + IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer()); + VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0); + IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); + doReturn((List) null).when(iVfModuleMetadata0).getArtifacts(); + VfModuleStructure vfModuleStructure0 = null; + try { + vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); + } + } + + @Test(timeout = 4000) + public void test2() throws Throwable { + IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); + doReturn((List) null).when(iVfModuleMetadata0).getArtifacts(); + VfModuleStructure vfModuleStructure0 = null; + try { + vfModuleStructure0 = new VfModuleStructure((VfResourceStructure) null, iVfModuleMetadata0); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); + } + } + + @Test(timeout = 4000) + public void test3() throws Throwable { + INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer()); + IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer()); + VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0); + LinkedList<String> linkedList0 = new LinkedList<String>(); + IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); + doReturn(linkedList0).when(iVfModuleMetadata0).getArtifacts(); + linkedList0.add(""); + VfModuleStructure vfModuleStructure0 = null; + try { + vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0); + fail("Expecting exception: Exception"); + + } catch(Exception e) { + // + // Artifact (UUID:) referenced in the VFModule UUID list has not been downloaded, cancelling the Resource deployment + // + verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); + } + } + + @Test(timeout = 4000) + public void test4() throws Throwable { + INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer()); + IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer()); + VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0); + vfResourceStructure0.setSuccessfulDeployment(); + IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); + doReturn((List) null).when(iVfModuleMetadata0).getArtifacts(); + vfResourceStructure0.setSuccessfulDeployment(); + VfModuleStructure vfModuleStructure0 = null; + try { + vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); + } + } +} |