diff options
author | 2017-01-31 11:40:03 +0100 | |
---|---|---|
committer | 2017-01-31 12:59:33 +0100 | |
commit | 025301d08b061482c1f046d562bf017c8cbcfe8d (patch) | |
tree | 68a2a549736c9bf0f7cd4e71c76e40ef7e2606f2 /adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans | |
parent | 2754ad52f833278a5c925bd788a16d1dce16a598 (diff) |
Initial OpenECOMP MSO commit
Change-Id: Ia6a7574859480717402cc2f22534d9973a78fa6d
Signed-off-by: ChrisC <cc697w@intl.att.com>
Diffstat (limited to 'adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans')
12 files changed, 1812 insertions, 0 deletions
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTest.java new file mode 100644 index 0000000000..241ca88a1d --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTest.java @@ -0,0 +1,83 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:56:50 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.junit.Test; +import static org.junit.Assert.*; + +import java.util.Map; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.junit.runner.RunWith; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class MsoTenantESTest extends MsoTenantESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant("P<5j-:=G4zf", "P<5j-:=G4zf", (Map<String, String>) null); + String string0 = msoTenant0.getTenantName(); + assertEquals("P<5j-:=G4zf", string0); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant("", "", (Map<String, String>) null); + String string0 = msoTenant0.getTenantName(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test2() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant(); + String string0 = msoTenant0.getTenantName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test3() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant(); + Map<String, String> map0 = msoTenant0.getMetadata(); + assertNull(map0); + } + + @Test(timeout = 4000) + public void test4() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant("", "SsK{%:", (Map<String, String>) null); + String string0 = msoTenant0.getTenantId(); + assertEquals("", string0); + assertEquals("SsK{%:", msoTenant0.getTenantName()); + } + + @Test(timeout = 4000) + public void test5() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant(); + msoTenant0.setTenantId("9A"); + String string0 = msoTenant0.getTenantId(); + assertEquals("9A", string0); + } + + @Test(timeout = 4000) + public void test6() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant(); + msoTenant0.setMetadata((Map<String, String>) null); + assertNull(msoTenant0.getTenantName()); + } + + @Test(timeout = 4000) + public void test7() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant(); + msoTenant0.setTenantName("9A"); + assertNull(msoTenant0.getTenantId()); + } + + @Test(timeout = 4000) + public void test8() throws Throwable { + MsoTenant msoTenant0 = new MsoTenant(); + String string0 = msoTenant0.getTenantId(); + assertNull(string0); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTestscaffolding.java new file mode 100644 index 0000000000..0ac4893ee8 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTestscaffolding.java @@ -0,0 +1,78 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:56:50 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.evosuite.runtime.annotation.EvoSuiteClassExclude; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.After; +import org.junit.AfterClass; +import org.evosuite.runtime.sandbox.Sandbox; + +@EvoSuiteClassExclude +public class MsoTenantESTestscaffolding { + + @org.junit.Rule + public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); + + private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); + + private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); + + @BeforeClass + public static void initEvoSuiteFramework() { + org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.openstack.beans.MsoTenant"; + org.evosuite.runtime.GuiSupport.initialize(); + org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; + org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; + org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; + org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; + org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); + org.evosuite.runtime.classhandling.JDKClassResetter.init(); + initializeClasses(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + } + + @AfterClass + public static void clearEvoSuiteFramework(){ + Sandbox.resetDefaultSecurityManager(); + java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); + } + + @Before + public void initTestCase(){ + threadStopper.storeCurrentThreads(); + threadStopper.startRecordingTime(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); + org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); + + org.evosuite.runtime.GuiSupport.setHeadless(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + org.evosuite.runtime.agent.InstrumentingAgent.activate(); + } + + @After + public void doneWithTestCase(){ + threadStopper.killAndJoinClientThreads(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); + org.evosuite.runtime.classhandling.JDKClassResetter.reset(); + resetClasses(); + org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); + org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); + org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); + } + + + private static void initializeClasses() { + org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(MsoTenantESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.beans.MsoTenant" + ); + } + + private static void resetClasses() { + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTest.java new file mode 100644 index 0000000000..9c157252ed --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTest.java @@ -0,0 +1,247 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:44:14 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.junit.Test; +import static org.junit.Assert.*; +import static org.evosuite.shaded.org.mockito.Mockito.*; +import static org.evosuite.runtime.MockitoExtension.*; + +import com.woorea.openstack.quantum.model.Network; +import com.woorea.openstack.quantum.model.Segment; +import java.util.List; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.ViolatedAssumptionAnswer; +import org.junit.runner.RunWith; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class NetworkInfoESTest extends NetworkInfoESTestscaffolding { + + @Test(timeout = 4000) + public void test00() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setVlans((List<Integer>) null); + List<Integer> list0 = networkInfo0.getVlans(); + assertNull(list0); + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + Network network0 = mock(Network.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(network0).getId(); + doReturn((String) null).when(network0).getName(); + doReturn((String) null).when(network0).getProviderPhysicalNetwork(); + doReturn((List) null).when(network0).getSegments(); + doReturn((String) null).when(network0).getStatus(); + doReturn((List) null).when(network0).getSubnets(); + NetworkInfo networkInfo0 = new NetworkInfo(network0); + List<String> list0 = networkInfo0.getSubnets(); + assertNull(list0); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setShared("Network [id="); + String string0 = networkInfo0.getShared(); + assertEquals("Network [id=", string0); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setProvider((String) null); + String string0 = networkInfo0.getProvider(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setProvider("ERROR"); + String string0 = networkInfo0.getProvider(); + assertEquals("ERROR", string0); + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setId((String) null); + String string0 = networkInfo0.getId(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + NetworkStatus networkStatus0 = NetworkStatus.DOWN; + NetworkInfo networkInfo0 = new NetworkInfo("IghhGdNW B*}", networkStatus0); + String string0 = networkInfo0.getId(); + assertEquals("IghhGdNW B*}", string0); + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + Network network0 = mock(Network.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(network0).getId(); + doReturn((String) null).when(network0).getName(); + doReturn((String) null).when(network0).getProviderPhysicalNetwork(); + doReturn((List) null).when(network0).getSegments(); + doReturn((String) null).when(network0).getStatus(); + doReturn((List) null).when(network0).getSubnets(); + NetworkInfo networkInfo0 = new NetworkInfo(network0); + List<String> list0 = networkInfo0.getSubnets(); + Network network1 = mock(Network.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(network1).getId(); + doReturn((String) null).when(network1).getName(); + doReturn((String) null).when(network1).getProviderPhysicalNetwork(); + doReturn((List<Segment>) null).when(network1).getSegments(); + doReturn("uxR^({\"", (String) null).when(network1).getStatus(); + doReturn(list0).when(network1).getSubnets(); + NetworkInfo networkInfo1 = new NetworkInfo(network1); + assertNull(networkInfo1.getName()); + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + Network network0 = mock(Network.class, new ViolatedAssumptionAnswer()); + doReturn(", segments: ").when(network0).getId(); + doReturn("ACTIVE").when(network0).getName(); + doReturn("l1~gC_#a'H,#*").when(network0).getProviderNetworkType(); + doReturn("ACTIVE", "").when(network0).getProviderPhysicalNetwork(); + doReturn("ERROR", "ERROR", "%<3T-").when(network0).getStatus(); + doReturn((List) null).when(network0).getSubnets(); + NetworkInfo networkInfo0 = new NetworkInfo(network0); + networkInfo0.getStatus(); + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + Network network0 = mock(Network.class, new ViolatedAssumptionAnswer()); + doReturn(", segments: ").when(network0).getId(); + doReturn("ACTIVE").when(network0).getName(); + doReturn((String) null).when(network0).getProviderNetworkType(); + doReturn("ACTIVE", (String) null).when(network0).getProviderPhysicalNetwork(); + doReturn("ERROR", (String) null).when(network0).getStatus(); + NetworkInfo networkInfo0 = null; + try { + networkInfo0 = new NetworkInfo(network0); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + } + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo((Network) null); + assertEquals("", networkInfo0.getId()); + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + String string0 = networkInfo0.toString(); + assertEquals("Network: name=,id=,status=UNKNOWN,provider=,vlans=[],subnets=[],shared=", string0); + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + NetworkStatus networkStatus0 = NetworkStatus.NOTFOUND; + networkInfo0.setStatus(networkStatus0); + assertEquals("", networkInfo0.getShared()); + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + NetworkStatus networkStatus0 = NetworkStatus.UNKNOWN; + NetworkInfo networkInfo0 = new NetworkInfo((String) null, networkStatus0); + String string0 = networkInfo0.getName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setShared((String) null); + String string0 = networkInfo0.getShared(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test15() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + String string0 = networkInfo0.getShared(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test16() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + List<String> list0 = networkInfo0.getSubnets(); + Network network0 = mock(Network.class, new ViolatedAssumptionAnswer()); + doReturn("R65k@>rbu`lzb#").when(network0).getId(); + doReturn("ERROR").when(network0).getName(); + doReturn("DOWN").when(network0).getProviderNetworkType(); + doReturn("u1Z(%z~k-ao5#y", "R65k@>rbu`lzb#").when(network0).getProviderPhysicalNetwork(); + doReturn("R65k@>rbu`lzb#", "R65k@>rbu`lzb#").when(network0).getStatus(); + doReturn(list0).when(network0).getSubnets(); + NetworkInfo networkInfo1 = new NetworkInfo(network0); + networkInfo1.getName(); + assertEquals("R65k@>rbu`lzb#", networkInfo1.getProvider()); + } + + @Test(timeout = 4000) + public void test17() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + List<Integer> list0 = networkInfo0.getVlans(); + networkInfo0.setVlans(list0); + assertEquals("", networkInfo0.getProvider()); + } + + @Test(timeout = 4000) + public void test18() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setName(""); + assertEquals(NetworkStatus.UNKNOWN, networkInfo0.getStatus()); + } + + @Test(timeout = 4000) + public void test19() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + networkInfo0.setSubnets((List<String>) null); + assertEquals("", networkInfo0.getShared()); + } + + @Test(timeout = 4000) + public void test20() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + NetworkStatus networkStatus0 = networkInfo0.getStatus(); + assertEquals(NetworkStatus.UNKNOWN, networkStatus0); + } + + @Test(timeout = 4000) + public void test21() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + String string0 = networkInfo0.getProvider(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test22() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + String string0 = networkInfo0.getId(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test23() throws Throwable { + NetworkInfo networkInfo0 = new NetworkInfo(); + String string0 = networkInfo0.getName(); + assertEquals("", string0); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTestscaffolding.java new file mode 100644 index 0000000000..0c87ca9016 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTestscaffolding.java @@ -0,0 +1,92 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:44:14 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.evosuite.runtime.annotation.EvoSuiteClassExclude; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.After; +import org.junit.AfterClass; +import org.evosuite.runtime.sandbox.Sandbox; + +@EvoSuiteClassExclude +public class NetworkInfoESTestscaffolding { + + @org.junit.Rule + public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); + + private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); + + private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); + + @BeforeClass + public static void initEvoSuiteFramework() { + org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.openstack.beans.NetworkInfo"; + org.evosuite.runtime.GuiSupport.initialize(); + org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; + org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; + org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; + org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; + org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); + org.evosuite.runtime.classhandling.JDKClassResetter.init(); + initializeClasses(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + } + + @AfterClass + public static void clearEvoSuiteFramework(){ + Sandbox.resetDefaultSecurityManager(); + java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); + } + + @Before + public void initTestCase(){ + threadStopper.storeCurrentThreads(); + threadStopper.startRecordingTime(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); + org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); + + org.evosuite.runtime.GuiSupport.setHeadless(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + org.evosuite.runtime.agent.InstrumentingAgent.activate(); + } + + @After + public void doneWithTestCase(){ + threadStopper.killAndJoinClientThreads(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); + org.evosuite.runtime.classhandling.JDKClassResetter.reset(); + resetClasses(); + org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); + org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); + org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); + } + + + private static void initializeClasses() { + org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(NetworkInfoESTestscaffolding.class.getClassLoader() , + "org.codehaus.jackson.annotate.JacksonAnnotation", + "com.woorea.openstack.quantum.model.Network", + "org.codehaus.jackson.annotate.JsonIgnoreProperties", + "com.woorea.openstack.quantum.model.Segment", + "org.openecomp.mso.openstack.beans.NetworkInfo", + "org.openecomp.mso.openstack.beans.NetworkStatus", + "com.woorea.openstack.quantum.model.Network$NetworkType", + "org.codehaus.jackson.map.annotate.JsonRootName" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(NetworkInfoESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.beans.NetworkStatus", + "org.openecomp.mso.openstack.beans.NetworkInfo", + "com.woorea.openstack.quantum.model.Network" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTest.java new file mode 100644 index 0000000000..bad2bde0af --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTest.java @@ -0,0 +1,303 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:55:12 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.junit.Test; +import static org.junit.Assert.*; +import static org.evosuite.shaded.org.mockito.Mockito.*; +import static org.evosuite.runtime.MockitoExtension.*; +import org.openecomp.mso.entity.MsoRequest; + +import java.util.List; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.ViolatedAssumptionAnswer; +import org.junit.runner.RunWith; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class NetworkRollbackESTest extends NetworkRollbackESTestscaffolding { + + @Test(timeout = 4000) + public void test00() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setNetworkStackId("H/r!m+_NT$?ed$IPcLD"); + networkRollback0.setNeutronNetworkId("H/r!m+_NT$?ed$IPcLD"); + MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer()); + doReturn((String) null, (String) null, (String) null).when(msoRequest0).toString(); + networkRollback0.setNetworkStackId(""); + networkRollback0.setMsoRequest((MsoRequest) null); + networkRollback0.setMsoRequest(msoRequest0); + networkRollback0.toString(); + networkRollback0.setNeutronNetworkId("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]"); + networkRollback0.getVlans(); + networkRollback0.setCloudId("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]"); + networkRollback0.setNetworkType("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]"); + networkRollback0.toString(); + networkRollback0.setCloudId("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]"); + networkRollback0.setTenantId("80\u0002<]~y|x(#fl"); + networkRollback0.setCloudId("=:U\"]"); + networkRollback0.toString(); + networkRollback0.getVlans(); + networkRollback0.toString(); + networkRollback0.getVlans(); + networkRollback0.getVlans(); + networkRollback0.getVlans(); + networkRollback0.setVlans((List<Integer>) null); + networkRollback0.toString(); + networkRollback0.getMsoRequest(); + networkRollback0.getVlans(); + networkRollback0.toString(); + networkRollback0.getMsoRequest(); + networkRollback0.getVlans(); + networkRollback0.getMsoRequest(); + networkRollback0.getVlans(); + List<Integer> list0 = networkRollback0.getVlans(); + assertNull(list0); + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setNetworkType((String) null); + networkRollback0.getMsoRequest(); + networkRollback0.setMsoRequest((MsoRequest) null); + networkRollback0.setNetworkId(""); + networkRollback0.setTenantId(""); + networkRollback0.getNetworkId(); + networkRollback0.setNeutronNetworkId(""); + networkRollback0.setCloudId("O;On"); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setCloudId("C5FS|V@CMBag"); + networkRollback0.getVlans(); + networkRollback0.setVlans((List<Integer>) null); + networkRollback0.getPhysicalNetwork(); + networkRollback0.setVlans((List<Integer>) null); + networkRollback0.getNeutronNetworkId(); + networkRollback0.setNetworkType("C5FS|V@CMBag"); + networkRollback0.getNetworkType(); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setNetworkId(", networkName="); + networkRollback0.setNetworkStackId("u)"); + networkRollback0.setNetworkId("u)"); + networkRollback0.setNetworkId(", networkName="); + networkRollback0.getNetworkStackId(); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setNetworkType("V3$f~dKduUu0"); + networkRollback0.setNetworkType(""); + networkRollback0.setTenantId(""); + networkRollback0.getPhysicalNetwork(); + networkRollback0.getVlans(); + networkRollback0.getNetworkType(); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setTenantId("Lu#)!pt2p=<#T."); + networkRollback0.getTenantId(); + networkRollback0.setNetworkStackId("Lu#)!pt2p=<#T."); + networkRollback0.getNeutronNetworkId(); + networkRollback0.setTenantId("Lu#)!pt2p=<#T."); + networkRollback0.setNetworkStackId((String) null); + String string0 = networkRollback0.toString(); + assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=Lu#)!pt2p=<#T., cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.getMsoRequest(); + networkRollback0.setMsoRequest((MsoRequest) null); + String string0 = networkRollback0.toString(); + assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0); + + networkRollback0.setNetworkName(""); + networkRollback0.getNetworkName(); + networkRollback0.setNetworkCreated(true); + networkRollback0.setNetworkName(""); + networkRollback0.getPhysicalNetwork(); + networkRollback0.setTenantId(""); + networkRollback0.setNetworkId(""); + assertTrue(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.getTenantId(); + networkRollback0.setNetworkStackId((String) null); + networkRollback0.getVlans(); + networkRollback0.setTenantId(""); + networkRollback0.getTenantId(); + networkRollback0.setVlans((List<Integer>) null); + String string0 = networkRollback0.toString(); + assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0); + + NetworkRollback networkRollback1 = new NetworkRollback(); + assertFalse(networkRollback1.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setNeutronNetworkId(""); + networkRollback0.setCloudId(""); + networkRollback0.getTenantId(); + networkRollback0.setTenantId(""); + networkRollback0.setNetworkType("Y=x>wx'"); + networkRollback0.getNeutronNetworkId(); + networkRollback0.getVlans(); + networkRollback0.setVlans((List<Integer>) null); + networkRollback0.setNetworkStackId("6P7@4aGo &Kd>V"); + networkRollback0.getCloudId(); + NetworkRollback networkRollback1 = new NetworkRollback(); + assertFalse(networkRollback1.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + assertFalse(networkRollback0.getNetworkCreated()); + + networkRollback0.setNetworkCreated(true); + networkRollback0.toString(); + networkRollback0.setNeutronNetworkId("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=null, cloudId=null, networkType=null, networkCreated=true, networkName=null, physicalNetwork=null]"); + networkRollback0.getPhysicalNetwork(); + boolean boolean0 = networkRollback0.getNetworkCreated(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setNetworkId(", tenantId="); + networkRollback0.setNetworkId(""); + networkRollback0.setTenantId(", tenantId="); + networkRollback0.setNetworkName("+*"); + networkRollback0.getNetworkName(); + networkRollback0.setNetworkStackId(", tenantId="); + networkRollback0.setCloudId("+*"); + networkRollback0.getCloudId(); + NetworkRollback networkRollback1 = new NetworkRollback(); + assertFalse(networkRollback1.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setPhysicalNetwork("!(>41heY7e"); + networkRollback0.setTenantId("j"); + networkRollback0.setNeutronNetworkId("j"); + networkRollback0.getPhysicalNetwork(); + networkRollback0.getVlans(); + NetworkRollback networkRollback1 = new NetworkRollback(); + networkRollback1.getMsoRequest(); + networkRollback0.setMsoRequest((MsoRequest) null); + networkRollback0.setNetworkCreated(false); + networkRollback0.setNeutronNetworkId("j"); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setPhysicalNetwork(""); + networkRollback0.setNetworkStackId(""); + networkRollback0.setNeutronNetworkId(""); + networkRollback0.getNetworkStackId(); + networkRollback0.getMsoRequest(); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setCloudId("7u@lc[l##+g`2V"); + networkRollback0.getVlans(); + networkRollback0.setVlans((List<Integer>) null); + networkRollback0.setNetworkType(""); + networkRollback0.setCloudId(", physicalNetwork="); + networkRollback0.setPhysicalNetwork(""); + networkRollback0.setNeutronNetworkId(", physicalNetwork="); + networkRollback0.getPhysicalNetwork(); + networkRollback0.getNeutronNetworkId(); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.getNetworkId(); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test15() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.getMsoRequest(); + networkRollback0.setMsoRequest((MsoRequest) null); + networkRollback0.getNetworkCreated(); + networkRollback0.setNetworkId(", networkName="); + networkRollback0.getNeutronNetworkId(); + networkRollback0.setPhysicalNetwork((String) null); + networkRollback0.getNetworkId(); + NetworkRollback networkRollback1 = new NetworkRollback(); + String string0 = networkRollback1.toString(); + assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0); + + networkRollback1.getVlans(); + networkRollback0.setVlans((List<Integer>) null); + networkRollback0.getNetworkId(); + networkRollback1.getPhysicalNetwork(); + networkRollback1.setNetworkCreated(false); + assertFalse(networkRollback1.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test16() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.getNetworkType(); + networkRollback0.setTenantId((String) null); + networkRollback0.setNetworkName(" networkStacId="); + networkRollback0.getCloudId(); + networkRollback0.getTenantId(); + networkRollback0.setNetworkStackId(" networkStacId="); + networkRollback0.setNeutronNetworkId((String) null); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test17() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.getNetworkName(); + assertFalse(networkRollback0.getNetworkCreated()); + } + + @Test(timeout = 4000) + public void test18() throws Throwable { + NetworkRollback networkRollback0 = new NetworkRollback(); + networkRollback0.setNetworkType("uK+JCvyg\"J(C d.w["); + networkRollback0.setCloudId("uK+JCvyg\"J(C d.w["); + networkRollback0.getNetworkStackId(); + assertFalse(networkRollback0.getNetworkCreated()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTestscaffolding.java new file mode 100644 index 0000000000..1665732f62 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTestscaffolding.java @@ -0,0 +1,79 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:55:12 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.evosuite.runtime.annotation.EvoSuiteClassExclude; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.After; +import org.junit.AfterClass; +import org.evosuite.runtime.sandbox.Sandbox; + +@EvoSuiteClassExclude +public class NetworkRollbackESTestscaffolding { + + @org.junit.Rule + public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); + + private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); + + private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); + + @BeforeClass + public static void initEvoSuiteFramework() { + org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.openstack.beans.NetworkRollback"; + org.evosuite.runtime.GuiSupport.initialize(); + org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; + org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; + org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; + org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; + org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); + org.evosuite.runtime.classhandling.JDKClassResetter.init(); + initializeClasses(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + } + + @AfterClass + public static void clearEvoSuiteFramework(){ + Sandbox.resetDefaultSecurityManager(); + java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); + } + + @Before + public void initTestCase(){ + threadStopper.storeCurrentThreads(); + threadStopper.startRecordingTime(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); + org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); + + org.evosuite.runtime.GuiSupport.setHeadless(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + org.evosuite.runtime.agent.InstrumentingAgent.activate(); + } + + @After + public void doneWithTestCase(){ + threadStopper.killAndJoinClientThreads(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); + org.evosuite.runtime.classhandling.JDKClassResetter.reset(); + resetClasses(); + org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); + org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); + org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); + } + + + private static void initializeClasses() { + org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(NetworkRollbackESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.entity.MsoRequest", + "org.openecomp.mso.openstack.beans.NetworkRollback" + ); + } + + private static void resetClasses() { + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTest.java new file mode 100644 index 0000000000..0ec588ded9 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTest.java @@ -0,0 +1,70 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:49:52 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.junit.Test; +import static org.junit.Assert.*; + +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.junit.runner.RunWith; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class PoolESTest extends PoolESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + Pool pool0 = new Pool(); + pool0.setStart("Allocation_pool [start=null, end=null]"); + String string0 = pool0.getStart(); + assertEquals("Allocation_pool [start=null, end=null]", string0); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + Pool pool0 = new Pool(); + pool0.setEnd("Allocation_pool [start=null, end=null]"); + String string0 = pool0.getEnd(); + assertEquals("Allocation_pool [start=null, end=null]", string0); + } + + @Test(timeout = 4000) + public void test2() throws Throwable { + Pool pool0 = new Pool(); + String string0 = pool0.getEnd(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test3() throws Throwable { + Pool pool0 = new Pool(); + pool0.setStart(""); + String string0 = pool0.getStart(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test4() throws Throwable { + Pool pool0 = new Pool(); + String string0 = pool0.toString(); + assertEquals("Allocation_pool [start=null, end=null]", string0); + } + + @Test(timeout = 4000) + public void test5() throws Throwable { + Pool pool0 = new Pool(); + pool0.setEnd(""); + String string0 = pool0.getEnd(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test6() throws Throwable { + Pool pool0 = new Pool(); + String string0 = pool0.getStart(); + assertNull(string0); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTestscaffolding.java new file mode 100644 index 0000000000..8ce9cb88b7 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTestscaffolding.java @@ -0,0 +1,78 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:49:52 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.evosuite.runtime.annotation.EvoSuiteClassExclude; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.After; +import org.junit.AfterClass; +import org.evosuite.runtime.sandbox.Sandbox; + +@EvoSuiteClassExclude +public class PoolESTestscaffolding { + + @org.junit.Rule + public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); + + private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); + + private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); + + @BeforeClass + public static void initEvoSuiteFramework() { + org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.openstack.beans.Pool"; + org.evosuite.runtime.GuiSupport.initialize(); + org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; + org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; + org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; + org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; + org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); + org.evosuite.runtime.classhandling.JDKClassResetter.init(); + initializeClasses(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + } + + @AfterClass + public static void clearEvoSuiteFramework(){ + Sandbox.resetDefaultSecurityManager(); + java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); + } + + @Before + public void initTestCase(){ + threadStopper.storeCurrentThreads(); + threadStopper.startRecordingTime(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); + org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); + + org.evosuite.runtime.GuiSupport.setHeadless(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + org.evosuite.runtime.agent.InstrumentingAgent.activate(); + } + + @After + public void doneWithTestCase(){ + threadStopper.killAndJoinClientThreads(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); + org.evosuite.runtime.classhandling.JDKClassResetter.reset(); + resetClasses(); + org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); + org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); + org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); + } + + + private static void initializeClasses() { + org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(PoolESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.beans.Pool" + ); + } + + private static void resetClasses() { + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTest.java new file mode 100644 index 0000000000..7be8339439 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTest.java @@ -0,0 +1,221 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:52:14 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.junit.Test; +import static org.junit.Assert.*; + +import java.util.List; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.junit.runner.RunWith; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class SubnetESTest extends SubnetESTestscaffolding { + + @Test(timeout = 4000) + public void test00() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setSubnetName("lu[c8x"); + subnet0.getSubnetName(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setSubnetName(""); + subnet0.getSubnetName(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setSubnetId("nL"); + subnet0.getSubnetId(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setSubnetId(""); + subnet0.getSubnetId(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setNeutronId("`jC)vXXeOG"); + subnet0.getNeutronId(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setIpVersion(""); + String string0 = subnet0.getIpVersion(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setGatewayIp((String) null); + subnet0.getGatewayIp(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setGatewayIp("Subnet [subnetName=null, neutronId=null, subnetId=null, cidr=null, gatewayIp=, ipVersion=4, enableDHCP=false, hostRoutes=null, allocationPools=null, dnsNameServers=null]"); + subnet0.getGatewayIp(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setCidr("H3%q_*bOC2"); + subnet0.getCidr(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setIpVersion((String) null); + String string0 = subnet0.getIpVersion(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setAllocationPools((List<Pool>) null); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getNeutronId(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getHostRoutes(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + Subnet subnet0 = new Subnet(); + String string0 = subnet0.toString(); + assertEquals("Subnet [subnetName=null, neutronId=null, subnetId=null, cidr=null, gatewayIp=, ipVersion=4, enableDHCP=false, hostRoutes=null, allocationPools=null, dnsNameServers=null]", string0); + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getSubnetName(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test15() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setNeutronId(""); + subnet0.getNeutronId(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test16() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setCidr(""); + subnet0.getCidr(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test17() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getDnsNameServers(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test18() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setHostRoutes((List<String>) null); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test19() throws Throwable { + Subnet subnet0 = new Subnet(); + String string0 = subnet0.getIpVersion(); + assertEquals("4", string0); + } + + @Test(timeout = 4000) + public void test20() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getSubnetId(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test21() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setEnableDHCP((Boolean) null); + subnet0.getEnableDHCP(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test22() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getAllocationPools(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test23() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getCidr(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test24() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.getGatewayIp(); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test25() throws Throwable { + Subnet subnet0 = new Subnet(); + subnet0.setDnsNameServers((List<String>) null); + assertEquals("4", subnet0.getIpVersion()); + } + + @Test(timeout = 4000) + public void test26() throws Throwable { + Subnet subnet0 = new Subnet(); + Boolean boolean0 = subnet0.getEnableDHCP(); + assertFalse(boolean0); + assertEquals("4", subnet0.getIpVersion()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTestscaffolding.java new file mode 100644 index 0000000000..a9bf598355 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTestscaffolding.java @@ -0,0 +1,79 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:52:14 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.evosuite.runtime.annotation.EvoSuiteClassExclude; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.After; +import org.junit.AfterClass; +import org.evosuite.runtime.sandbox.Sandbox; + +@EvoSuiteClassExclude +public class SubnetESTestscaffolding { + + @org.junit.Rule + public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); + + private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); + + private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); + + @BeforeClass + public static void initEvoSuiteFramework() { + org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.openstack.beans.Subnet"; + org.evosuite.runtime.GuiSupport.initialize(); + org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; + org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; + org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; + org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; + org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); + org.evosuite.runtime.classhandling.JDKClassResetter.init(); + initializeClasses(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + } + + @AfterClass + public static void clearEvoSuiteFramework(){ + Sandbox.resetDefaultSecurityManager(); + java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); + } + + @Before + public void initTestCase(){ + threadStopper.storeCurrentThreads(); + threadStopper.startRecordingTime(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); + org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); + + org.evosuite.runtime.GuiSupport.setHeadless(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + org.evosuite.runtime.agent.InstrumentingAgent.activate(); + } + + @After + public void doneWithTestCase(){ + threadStopper.killAndJoinClientThreads(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); + org.evosuite.runtime.classhandling.JDKClassResetter.reset(); + resetClasses(); + org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); + org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); + org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); + } + + + private static void initializeClasses() { + org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(SubnetESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.beans.Pool", + "org.openecomp.mso.openstack.beans.Subnet" + ); + } + + private static void resetClasses() { + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTest.java new file mode 100644 index 0000000000..e76ce410d4 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTest.java @@ -0,0 +1,403 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:51:17 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.junit.Test; +import static org.junit.Assert.*; +import static org.evosuite.shaded.org.mockito.Mockito.*; + +import org.openecomp.mso.entity.MsoRequest; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.ViolatedAssumptionAnswer; +import org.junit.runner.RunWith; + +@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) +public class VnfRollbackESTest extends VnfRollbackESTestscaffolding { + + @Test(timeout = 4000) + public void test00() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVolumeGroupName(", vnfCreated="); + vnfRollback0.getVolumeGroupName(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVolumeGroupId("}mvn2f6!r5FG1/_M~M"); + vnfRollback0.getVolumeGroupId(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVolumeGroupId(""); + vnfRollback0.getVolumeGroupId(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVolumeGroupHeatStackId("Z^t$4-eOKP9"); + vnfRollback0.getVolumeGroupHeatStackId(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getVnfId(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVnfId(""); + vnfRollback0.getVnfId(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVfModuleStackId("8y*`!>A$@*l8#a>"); + vnfRollback0.getVfModuleStackId(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVfModuleStackId(""); + vnfRollback0.getVfModuleStackId(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(", tenant=", ", tenant=", ", tenant=", false, false, (MsoRequest) null, ", tenant=", "f5`2h^e^.-x", ", tenant="); + String string0 = vnfRollback0.getTenantId(); + assertFalse(vnfRollback0.getVnfCreated()); + assertEquals(", tenant=", vnfRollback0.getCloudSiteId()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + assertEquals(", tenant=", vnfRollback0.getRequestType()); + assertEquals("f5`2h^e^.-x", vnfRollback0.getVolumeGroupId()); + assertEquals(", tenant=", vnfRollback0.getVolumeGroupName()); + assertEquals(", tenant=", vnfRollback0.getVnfId()); + assertEquals(", tenant=", string0); + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setTenantId(""); + vnfRollback0.getTenantId(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + assertFalse(vnfRollback0.getTenantCreated()); + + vnfRollback0.setTenantCreated(true); + boolean boolean0 = vnfRollback0.getTenantCreated(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer()); + VnfRollback vnfRollback0 = new VnfRollback("", ", vnf=", "Jvr", false, false, msoRequest0, "", "f'D", "VnfRollback: cloud="); + String string0 = vnfRollback0.getRequestType(); + assertFalse(vnfRollback0.isBase()); + assertEquals("Jvr", vnfRollback0.getCloudSiteId()); + assertEquals("", vnfRollback0.getVnfId()); + assertFalse(vnfRollback0.getTenantCreated()); + assertEquals("f'D", vnfRollback0.getVolumeGroupId()); + assertEquals(", vnf=", vnfRollback0.getTenantId()); + assertEquals("VnfRollback: cloud=", string0); + assertFalse(vnfRollback0.getVnfCreated()); + assertEquals("", vnfRollback0.getVolumeGroupName()); + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setRequestType(""); + vnfRollback0.getRequestType(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer()); + doReturn("Jvr").when(msoRequest0).toString(); + VnfRollback vnfRollback0 = new VnfRollback("", ", vnf=", "Jvr", false, false, msoRequest0, "", "f'D", "VnfRollback: cloud="); + vnfRollback0.getMsoRequest(); + assertEquals("Jvr", vnfRollback0.getCloudSiteId()); + assertEquals("", vnfRollback0.getVnfId()); + assertFalse(vnfRollback0.isBase()); + assertEquals(", vnf=", vnfRollback0.getTenantId()); + assertEquals("", vnfRollback0.getVolumeGroupName()); + assertEquals("f'D", vnfRollback0.getVolumeGroupId()); + assertEquals("VnfRollback: cloud=", vnfRollback0.getRequestType()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(", tenant=", ", tenant=", ", tenant=", false, false, (MsoRequest) null, ", tenant=", "f5`2h^e^.-x", ", tenant="); + String string0 = vnfRollback0.getCloudSiteId(); + assertFalse(vnfRollback0.isBase()); + assertEquals(", tenant=", string0); + assertEquals("f5`2h^e^.-x", vnfRollback0.getVolumeGroupId()); + assertFalse(vnfRollback0.getVnfCreated()); + assertEquals(", tenant=", vnfRollback0.getVnfId()); + assertFalse(vnfRollback0.getTenantCreated()); + assertEquals(", tenant=", vnfRollback0.getVolumeGroupName()); + assertEquals(", tenant=", vnfRollback0.getRequestType()); + assertEquals(", tenant=", vnfRollback0.getTenantId()); + } + + @Test(timeout = 4000) + public void test15() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setCloudSiteId(""); + vnfRollback0.getCloudSiteId(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + } + + @Test(timeout = 4000) + public void test16() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setBaseGroupHeatStackId("3(6Q^)Ic kf:zj"); + vnfRollback0.getBaseGroupHeatStackId(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test17() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setBaseGroupHeatStackId(""); + vnfRollback0.getBaseGroupHeatStackId(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + } + + @Test(timeout = 4000) + public void test18() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + assertFalse(vnfRollback0.isBase()); + + vnfRollback0.setIsBase(true); + boolean boolean0 = vnfRollback0.isBase(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test19() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getVfModuleStackId(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test20() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getVolumeGroupName(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + } + + @Test(timeout = 4000) + public void test21() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVolumeGroupName(""); + vnfRollback0.getVolumeGroupName(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test22() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + boolean boolean0 = vnfRollback0.getTenantCreated(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(boolean0); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test23() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + boolean boolean0 = vnfRollback0.isBase(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test24() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + String string0 = vnfRollback0.toString(); + assertFalse(vnfRollback0.isBase()); + assertEquals("VnfRollback: cloud=null, tenant=null, vnf=null, tenantCreated=false, vnfCreated=false, requestType = null", string0); + } + + @Test(timeout = 4000) + public void test25() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + boolean boolean0 = vnfRollback0.getVnfCreated(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(boolean0); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test26() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getVolumeGroupHeatStackId(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test27() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getBaseGroupHeatStackId(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test28() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getCloudSiteId(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test29() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getTenantId(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test30() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer()); + vnfRollback0.setMsoRequest(msoRequest0); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test31() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getMsoRequest(); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test32() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + assertFalse(vnfRollback0.getVnfCreated()); + + vnfRollback0.setVnfCreated(true); + boolean boolean0 = vnfRollback0.getVnfCreated(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test33() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getVolumeGroupId(); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.isBase()); + } + + @Test(timeout = 4000) + public void test34() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.getRequestType(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test35() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(); + vnfRollback0.setVolumeGroupHeatStackId(""); + vnfRollback0.getVolumeGroupHeatStackId(); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertFalse(vnfRollback0.getVnfCreated()); + } + + @Test(timeout = 4000) + public void test36() throws Throwable { + VnfRollback vnfRollback0 = new VnfRollback(", tenant=", ", tenant=", ", tenant=", false, false, (MsoRequest) null, ", tenant=", "f5`2h^e^.-x", ", tenant="); + String string0 = vnfRollback0.getVnfId(); + assertEquals(", tenant=", string0); + assertEquals(", tenant=", vnfRollback0.getTenantId()); + assertFalse(vnfRollback0.getVnfCreated()); + assertFalse(vnfRollback0.isBase()); + assertFalse(vnfRollback0.getTenantCreated()); + assertEquals(", tenant=", vnfRollback0.getCloudSiteId()); + assertEquals(", tenant=", vnfRollback0.getVolumeGroupName()); + assertEquals(", tenant=", vnfRollback0.getRequestType()); + assertEquals("f5`2h^e^.-x", vnfRollback0.getVolumeGroupId()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTestscaffolding.java new file mode 100644 index 0000000000..e07b2cfee3 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTestscaffolding.java @@ -0,0 +1,79 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:51:17 GMT 2016 + */ + +package org.openecomp.mso.openstack.beans; + +import org.evosuite.runtime.annotation.EvoSuiteClassExclude; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.After; +import org.junit.AfterClass; +import org.evosuite.runtime.sandbox.Sandbox; + +@EvoSuiteClassExclude +public class VnfRollbackESTestscaffolding { + + @org.junit.Rule + public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); + + private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); + + private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); + + @BeforeClass + public static void initEvoSuiteFramework() { + org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.openstack.beans.VnfRollback"; + org.evosuite.runtime.GuiSupport.initialize(); + org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; + org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; + org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; + org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; + org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); + org.evosuite.runtime.classhandling.JDKClassResetter.init(); + initializeClasses(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + } + + @AfterClass + public static void clearEvoSuiteFramework(){ + Sandbox.resetDefaultSecurityManager(); + java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); + } + + @Before + public void initTestCase(){ + threadStopper.storeCurrentThreads(); + threadStopper.startRecordingTime(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); + org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); + + org.evosuite.runtime.GuiSupport.setHeadless(); + org.evosuite.runtime.Runtime.getInstance().resetRuntime(); + org.evosuite.runtime.agent.InstrumentingAgent.activate(); + } + + @After + public void doneWithTestCase(){ + threadStopper.killAndJoinClientThreads(); + org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); + org.evosuite.runtime.classhandling.JDKClassResetter.reset(); + resetClasses(); + org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); + org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); + org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); + } + + + private static void initializeClasses() { + org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(VnfRollbackESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.beans.VnfRollback", + "org.openecomp.mso.entity.MsoRequest" + ); + } + + private static void resetClasses() { + } +} |