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 | |
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')
39 files changed, 4096 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() { + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTest.java new file mode 100644 index 0000000000..ccc5a949b7 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTest.java @@ -0,0 +1,24 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:51:02 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoAdapterExceptionESTest extends MsoAdapterExceptionESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoAdapterException msoAdapterException0 = new MsoAdapterException(""); + MsoAdapterException msoAdapterException1 = new MsoAdapterException("", (Throwable) msoAdapterException0); + assertFalse(msoAdapterException1.equals((Object)msoAdapterException0)); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTestscaffolding.java new file mode 100644 index 0000000000..657b8b28c4 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTestscaffolding.java @@ -0,0 +1,87 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:51:02 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoAdapterExceptionESTestscaffolding { + + @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.exceptions.MsoAdapterException"; + 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(MsoAdapterExceptionESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoAdapterException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoAdapterExceptionESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoAdapterException" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTest.java new file mode 100644 index 0000000000..f840c12025 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTest.java @@ -0,0 +1,30 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:56:48 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoCloudSiteNotFoundESTest extends MsoCloudSiteNotFoundESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound(); + assertEquals(MsoExceptionCategory.USERDATA, msoCloudSiteNotFound0.getCategory()); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound("NQz5T^"); + String string0 = msoCloudSiteNotFound0.toString(); + assertEquals("Cloud Site [NQz5T^] not found", string0); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTestscaffolding.java new file mode 100644 index 0000000000..ba287051dd --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTestscaffolding.java @@ -0,0 +1,87 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:56:48 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoCloudSiteNotFoundESTestscaffolding { + + @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.exceptions.MsoCloudSiteNotFound"; + 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(MsoCloudSiteNotFoundESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound", + "org.openecomp.mso.openstack.exceptions.MsoException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoCloudSiteNotFoundESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTest.java new file mode 100644 index 0000000000..2bd71fb525 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTest.java @@ -0,0 +1,77 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:48:01 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoExceptionESTest extends MsoExceptionESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoTenantNotFound msoTenantNotFound0 = new MsoTenantNotFound("T&~q", "Cloud Site ["); + MsoIOException msoIOException0 = new MsoIOException("", (Throwable) msoTenantNotFound0); + String string0 = msoIOException0.getContextMessage(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + MsoNetworkNotFound msoNetworkNotFound0 = new MsoNetworkNotFound("", "", ""); + msoNetworkNotFound0.addContext(""); + String string0 = msoNetworkNotFound0.getContext(); + assertEquals("", string0); + assertNotNull(string0); + } + + @Test(timeout = 4000) + public void test2() throws Throwable { + MsoAdapterException msoAdapterException0 = new MsoAdapterException(" "); + msoAdapterException0.setContext(" "); + String string0 = msoAdapterException0.getContextMessage(); + assertEquals("[ ] ", string0); + } + + @Test(timeout = 4000) + public void test3() throws Throwable { + MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound(); + MsoAdapterException msoAdapterException0 = new MsoAdapterException("", (Throwable) msoCloudSiteNotFound0); + msoAdapterException0.addContext(""); + msoAdapterException0.addContext(""); + String string0 = msoAdapterException0.getContext(); + assertEquals(":", msoAdapterException0.getContext()); + assertNotNull(string0); + } + + @Test(timeout = 4000) + public void test4() throws Throwable { + MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound((String) null); + MsoExceptionCategory msoExceptionCategory0 = msoCloudSiteNotFound0.getCategory(); + MsoAdapterException msoAdapterException0 = new MsoAdapterException((String) null, (Throwable) msoCloudSiteNotFound0); + msoAdapterException0.setCategory(msoExceptionCategory0); + assertNull(msoAdapterException0.getContext()); + } + + @Test(timeout = 4000) + public void test5() throws Throwable { + MsoNetworkNotFound msoNetworkNotFound0 = new MsoNetworkNotFound("", "", ""); + String string0 = msoNetworkNotFound0.getContext(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test6() throws Throwable { + MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound((String) null); + MsoAdapterException msoAdapterException0 = new MsoAdapterException((String) null, (Throwable) msoCloudSiteNotFound0); + String string0 = msoAdapterException0.getContextMessage(); + assertNull(string0); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTestscaffolding.java new file mode 100644 index 0000000000..8ce85b76bf --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTestscaffolding.java @@ -0,0 +1,101 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:48:01 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoExceptionESTestscaffolding { + + @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.exceptions.MsoException"; + 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(MsoExceptionESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound", + "org.openecomp.mso.openstack.exceptions.MsoIOException", + "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound", + "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoAdapterException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoExceptionESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound", + "org.openecomp.mso.openstack.exceptions.MsoIOException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException", + "org.openecomp.mso.openstack.exceptions.MsoNetworkAlreadyExists", + "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound", + "org.openecomp.mso.openstack.exceptions.MsoStackAlreadyExists", + "org.openecomp.mso.openstack.exceptions.MsoStackNotFound", + "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound", + "org.openecomp.mso.openstack.exceptions.MsoAdapterException", + "org.openecomp.mso.openstack.exceptions.MsoTenantAlreadyExists", + "org.openecomp.mso.openstack.exceptions.MsoException" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTest.java new file mode 100644 index 0000000000..ec2699c3f3 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTest.java @@ -0,0 +1,24 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:50:20 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoIOExceptionESTest extends MsoIOExceptionESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoIOException msoIOException0 = new MsoIOException(""); + MsoIOException msoIOException1 = new MsoIOException("", (Throwable) msoIOException0); + assertNull(msoIOException1.getContext()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTestscaffolding.java new file mode 100644 index 0000000000..e657718fc4 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTestscaffolding.java @@ -0,0 +1,87 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:50:20 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoIOExceptionESTestscaffolding { + + @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.exceptions.MsoIOException"; + 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(MsoIOExceptionESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoIOException", + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoIOExceptionESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoIOException" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTest.java new file mode 100644 index 0000000000..2c423b7405 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTest.java @@ -0,0 +1,23 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:52:37 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoNetworkAlreadyExistsESTest extends MsoNetworkAlreadyExistsESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoNetworkAlreadyExists msoNetworkAlreadyExists0 = new MsoNetworkAlreadyExists((String) null, (String) null, (String) null); + assertNull(msoNetworkAlreadyExists0.getContext()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTestscaffolding.java new file mode 100644 index 0000000000..1c00ba9d8d --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTestscaffolding.java @@ -0,0 +1,89 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:52:37 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoNetworkAlreadyExistsESTestscaffolding { + + @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.exceptions.MsoNetworkAlreadyExists"; + 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(MsoNetworkAlreadyExistsESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoNetworkAlreadyExists", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoNetworkAlreadyExistsESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException", + "org.openecomp.mso.openstack.exceptions.MsoNetworkAlreadyExists" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTest.java new file mode 100644 index 0000000000..418545056c --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTest.java @@ -0,0 +1,23 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:54:45 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoNetworkNotFoundESTest extends MsoNetworkNotFoundESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoNetworkNotFound msoNetworkNotFound0 = new MsoNetworkNotFound("6", "6", "yX9(}I;;7<c%.4HYX"); + assertNull(msoNetworkNotFound0.getContext()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTestscaffolding.java new file mode 100644 index 0000000000..1506836f1e --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTestscaffolding.java @@ -0,0 +1,89 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:54:45 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoNetworkNotFoundESTestscaffolding { + + @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.exceptions.MsoNetworkNotFound"; + 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(MsoNetworkNotFoundESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoNetworkNotFoundESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException", + "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTest.java new file mode 100644 index 0000000000..00d7035c93 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTest.java @@ -0,0 +1,32 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:51:53 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoOpenstackExceptionESTest extends MsoOpenstackExceptionESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoOpenstackException msoOpenstackException0 = new MsoOpenstackException((-20), "zOT*@]B@O~zuv2", "zOT*@]B@O~zuv2"); + MsoOpenstackException msoOpenstackException1 = new MsoOpenstackException((-20), "zOT*@]B@O~zuv2", "zOT*@]B@O~zuv2", (Exception) msoOpenstackException0); + assertEquals(MsoExceptionCategory.OPENSTACK, msoOpenstackException1.getCategory()); + } + + @Test(timeout = 4000) + public void test1() throws Throwable { + MsoOpenstackException msoOpenstackException0 = new MsoOpenstackException((-20), "zOT*@]B@O~zuv2", "zOT*@]B@O~zuv2"); + String string0 = msoOpenstackException0.toString(); + assertNotNull(string0); + assertEquals("-20 zOT*@]B@O~zuv2: zOT*@]B@O~zuv2", string0); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTestscaffolding.java new file mode 100644 index 0000000000..78a71cce45 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTestscaffolding.java @@ -0,0 +1,87 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:51:53 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoOpenstackExceptionESTestscaffolding { + + @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.exceptions.MsoOpenstackException"; + 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(MsoOpenstackExceptionESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoOpenstackExceptionESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTest.java new file mode 100644 index 0000000000..289b2a6aa2 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTest.java @@ -0,0 +1,23 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:55:08 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoStackAlreadyExistsESTest extends MsoStackAlreadyExistsESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoStackAlreadyExists msoStackAlreadyExists0 = new MsoStackAlreadyExists("", "", ""); + assertEquals(MsoExceptionCategory.OPENSTACK, msoStackAlreadyExists0.getCategory()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTestscaffolding.java new file mode 100644 index 0000000000..c7b8c85f67 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTestscaffolding.java @@ -0,0 +1,89 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:55:08 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoStackAlreadyExistsESTestscaffolding { + + @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.exceptions.MsoStackAlreadyExists"; + 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(MsoStackAlreadyExistsESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoStackAlreadyExists", + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoStackAlreadyExistsESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException", + "org.openecomp.mso.openstack.exceptions.MsoStackAlreadyExists" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTest.java new file mode 100644 index 0000000000..e8b6e85e74 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTest.java @@ -0,0 +1,23 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:55:36 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoStackNotFoundESTest extends MsoStackNotFoundESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoStackNotFound msoStackNotFound0 = new MsoStackNotFound("", (String) null, (String) null); + assertEquals(MsoExceptionCategory.OPENSTACK, msoStackNotFound0.getCategory()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTestscaffolding.java new file mode 100644 index 0000000000..3ce09164d8 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTestscaffolding.java @@ -0,0 +1,89 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:55:36 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoStackNotFoundESTestscaffolding { + + @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.exceptions.MsoStackNotFound"; + 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(MsoStackNotFoundESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoStackNotFound", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoStackNotFoundESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException", + "org.openecomp.mso.openstack.exceptions.MsoStackNotFound" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTest.java new file mode 100644 index 0000000000..a47f778cc0 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTest.java @@ -0,0 +1,23 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:56:00 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoTenantAlreadyExistsESTest extends MsoTenantAlreadyExistsESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoTenantAlreadyExists msoTenantAlreadyExists0 = new MsoTenantAlreadyExists("Q]>\u00018.eW8", "Q]>\u00018.eW8"); + assertEquals(MsoExceptionCategory.OPENSTACK, msoTenantAlreadyExists0.getCategory()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTestscaffolding.java new file mode 100644 index 0000000000..11700e6e75 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTestscaffolding.java @@ -0,0 +1,89 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:56:00 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoTenantAlreadyExistsESTestscaffolding { + + @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.exceptions.MsoTenantAlreadyExists"; + 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(MsoTenantAlreadyExistsESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoTenantAlreadyExists", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoTenantAlreadyExistsESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException", + "org.openecomp.mso.openstack.exceptions.MsoTenantAlreadyExists" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTest.java new file mode 100644 index 0000000000..b65bd1f5e4 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTest.java @@ -0,0 +1,23 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:52:17 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoTenantNotFoundESTest extends MsoTenantNotFoundESTestscaffolding { + + @Test(timeout = 4000) + public void test0() throws Throwable { + MsoTenantNotFound msoTenantNotFound0 = new MsoTenantNotFound("", ""); + assertEquals(MsoExceptionCategory.OPENSTACK, msoTenantNotFound0.getCategory()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTestscaffolding.java new file mode 100644 index 0000000000..bd45ba62ad --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTestscaffolding.java @@ -0,0 +1,89 @@ +/** + * Scaffolding file used to store all the setups needed to run + * tests automatically generated by EvoSuite + * Mon Nov 14 08:52:17 GMT 2016 + */ + +package org.openecomp.mso.openstack.exceptions; + +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 MsoTenantNotFoundESTestscaffolding { + + @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.exceptions.MsoTenantNotFound"; + 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(MsoTenantNotFoundESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound", + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException" + ); + } + + private static void resetClasses() { + org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoTenantNotFoundESTestscaffolding.class.getClassLoader()); + + org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( + "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory", + "org.openecomp.mso.openstack.exceptions.MsoException", + "org.openecomp.mso.openstack.exceptions.MsoOpenstackException", + "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound" + ); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntryESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntryESTest.java new file mode 100644 index 0000000000..6eaac45a43 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntryESTest.java @@ -0,0 +1,562 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:40:12 GMT 2016 + */ + +package org.openecomp.mso.openstack.utils; + +import org.junit.Test; +import static org.junit.Assert.*; +import static org.evosuite.shaded.org.mockito.Mockito.*; +import static org.evosuite.runtime.EvoAssertions.*; +import org.openecomp.mso.db.catalog.beans.HeatTemplateParam; + +import java.util.LinkedHashSet; +import java.util.Set; +import org.evosuite.runtime.EvoRunner; +import org.evosuite.runtime.EvoRunnerParameters; +import org.evosuite.runtime.PrivateAccess; +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 MsoHeatEnvironmentEntryESTest { + + @Test(timeout = 4000) + public void test00() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + Set<MsoHeatEnvironmentResource> set0 = (Set<MsoHeatEnvironmentResource>) mock(Set.class, new ViolatedAssumptionAnswer()); + doReturn((-237540137)).when(set0).size(); + msoHeatEnvironmentEntry0.setResources(set0); + boolean boolean0 = msoHeatEnvironmentEntry0.hasResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "valid", (Object) false); + boolean boolean0 = msoHeatEnvironmentEntry0.isValid(); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentResource> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentResource>(); + msoHeatEnvironmentEntry0.setResources(linkedHashSet0); + msoHeatEnvironmentEntry0.getResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("9>KEckx", "8&T!e[SABZ"); + msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0); + msoHeatEnvironmentEntry0.getResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + StringBuilder stringBuilder0 = msoHeatEnvironmentEntry0.toFullString(); + PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "rawEntry", (Object) stringBuilder0); + StringBuilder stringBuilder1 = msoHeatEnvironmentEntry0.getRawEntry(); + assertEquals("\nnull", stringBuilder1.toString()); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + msoHeatEnvironmentEntry0.getParameters(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + msoHeatEnvironmentEntry0.getParameters(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentResource> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentResource>(); + msoHeatEnvironmentEntry0.setResources(linkedHashSet0); + msoHeatEnvironmentEntry0.getNumberOfResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0); + msoHeatEnvironmentEntry0.getNumberOfResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + Set<MsoHeatEnvironmentResource> set0 = (Set<MsoHeatEnvironmentResource>) mock(Set.class, new ViolatedAssumptionAnswer()); + doReturn(0).when(set0).size(); + msoHeatEnvironmentEntry0.setResources(set0); + msoHeatEnvironmentEntry0.getNumberOfResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + msoHeatEnvironmentEntry0.getNumberOfParameters(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + msoHeatEnvironmentEntry0.getNumberOfParameters(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "errorString", (Object) "Param="); + msoHeatEnvironmentEntry0.getErrorString(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + Set<HeatTemplateParam> set0 = (Set<HeatTemplateParam>) mock(Set.class, new ViolatedAssumptionAnswer()); + doReturn((-2945)).when(set0).size(); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(set0); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal Capacity: -2945 + // + verifyException("java.util.ArrayList", e); + } + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + linkedHashSet0.add((MsoHeatEnvironmentParameter) null); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.toFullString(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentEntry", e); + } + } + + @Test(timeout = 4000) + public void test15() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.containsParameter((String) null, ""); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter", e); + } + } + + @Test(timeout = 4000) + public void test16() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + linkedHashSet0.add(msoHeatEnvironmentParameter0); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.containsParameter((String) null); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter", e); + } + } + + @Test(timeout = 4000) + public void test17() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0); + MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource(); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource1); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentResource", e); + } + } + + @Test(timeout = 4000) + public void test18() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter(); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter1); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter", e); + } + } + + @Test(timeout = 4000) + public void test19() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("", ""); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter(""); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test20() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + boolean boolean0 = msoHeatEnvironmentEntry0.hasParameters(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test21() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + msoHeatEnvironmentEntry0.hasParameters(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test22() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + boolean boolean0 = msoHeatEnvironmentEntry0.hasParameters(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test23() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + PrivateAccess.callMethod((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "getResourceRegistryRawEntry"); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test24() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentParameter0.setValue("_BAD"); + HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam(); + linkedHashSet0.add(heatTemplateParam0); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0); + assertTrue(msoHeatEnvironmentEntry0.hasParameters()); + } + + @Test(timeout = 4000) + public void test25() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentParameter0.setValue("t'N`.KI:L9"); + HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam(); + linkedHashSet0.add(heatTemplateParam0); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0); + assertTrue(msoHeatEnvironmentEntry0.hasParameters()); + } + + @Test(timeout = 4000) + public void test26() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam(); + linkedHashSet0.add(heatTemplateParam0); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + } + } + + @Test(timeout = 4000) + public void test27() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>(); + msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0); + assertTrue(msoHeatEnvironmentEntry0.hasParameters()); + } + + @Test(timeout = 4000) + public void test28() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>(); + HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam(); + linkedHashSet0.add(heatTemplateParam0); + msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test29() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + assertFalse(msoHeatEnvironmentEntry0.hasParameters()); + + LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>(); + StringBuilder stringBuilder0 = msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0); + PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "rawEntry", (Object) stringBuilder0); + StringBuilder stringBuilder1 = (StringBuilder)PrivateAccess.callMethod((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "getResourceRegistryRawEntry"); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + assertNull(stringBuilder1); + } + + @Test(timeout = 4000) + public void test30() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("9MTP2Qt0FH.^", ""); + assertTrue(boolean0); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test31() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("dP:* hj", "dP:* hj"); + assertFalse(boolean0); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test32() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0); + boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("", ""); + assertTrue(boolean0); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test33() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = mock(MsoHeatEnvironmentParameter.class, new ViolatedAssumptionAnswer()); + linkedHashSet0.add(msoHeatEnvironmentParameter0); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("kz`LZx"); + assertTrue(msoHeatEnvironmentEntry0.hasParameters()); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test34() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("kz`LZx"); + assertFalse(boolean0); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test35() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter(",=?%4z"); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test36() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = mock(MsoHeatEnvironmentParameter.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(msoHeatEnvironmentParameter0).getName(); + doReturn((String) null).when(msoHeatEnvironmentParameter0).getValue(); + linkedHashSet0.add(msoHeatEnvironmentParameter0); + msoHeatEnvironmentEntry0.setParameters(linkedHashSet0); + msoHeatEnvironmentEntry0.toFullString(); + assertTrue(msoHeatEnvironmentEntry0.hasParameters()); + } + + @Test(timeout = 4000) + public void test37() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(""); + msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0); + boolean boolean0 = msoHeatEnvironmentEntry0.hasResources(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test38() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + Set<MsoHeatEnvironmentResource> set0 = (Set<MsoHeatEnvironmentResource>) mock(Set.class, new ViolatedAssumptionAnswer()); + doReturn(0).when(set0).size(); + msoHeatEnvironmentEntry0.setResources(set0); + boolean boolean0 = msoHeatEnvironmentEntry0.hasResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test39() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + boolean boolean0 = msoHeatEnvironmentEntry0.hasResources(); + assertFalse(boolean0); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test40() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + msoHeatEnvironmentEntry0.setResources((Set<MsoHeatEnvironmentResource>) null); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test41() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + msoHeatEnvironmentEntry0.setParameters((Set<MsoHeatEnvironmentParameter>) null); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + + @Test(timeout = 4000) + public void test43() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.getNumberOfResources(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentEntry", e); + } + } + + @Test(timeout = 4000) + public void test44() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + boolean boolean0 = msoHeatEnvironmentEntry0.isValid(); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test45() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry((StringBuilder) null); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test46() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + // Undeclared exception! + try { + msoHeatEnvironmentEntry0.getNumberOfParameters(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentEntry", e); + } + } + + @Test(timeout = 4000) + public void test47() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + msoHeatEnvironmentEntry0.getRawEntry(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test48() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + msoHeatEnvironmentEntry0.getParameters(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test49() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + msoHeatEnvironmentEntry0.getResources(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } + + @Test(timeout = 4000) + public void test50() throws Throwable { + MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry(); + msoHeatEnvironmentEntry0.getErrorString(); + assertTrue(msoHeatEnvironmentEntry0.isValid()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTest.java new file mode 100644 index 0000000000..6ec389b809 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTest.java @@ -0,0 +1,129 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:45:40 GMT 2016 + */ + +package org.openecomp.mso.openstack.utils; + +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 MsoHeatEnvironmentParameterESTest extends MsoHeatEnvironmentParameterESTestscaffolding { + + @Test(timeout = 4000) + public void test00() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + msoHeatEnvironmentParameter0.hashCode(); + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + boolean boolean0 = msoHeatEnvironmentParameter0.equals(msoHeatEnvironmentParameter0); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + msoHeatEnvironmentParameter0.setValue(""); + String string0 = msoHeatEnvironmentParameter0.getValue(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + String string0 = msoHeatEnvironmentParameter0.getName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("<*+ogA@v;MO4'8{1"); + String string0 = msoHeatEnvironmentParameter0.getName(); + assertEquals("<*+ogA@v;MO4'8{1", string0); + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + String string0 = msoHeatEnvironmentParameter0.getName(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("", "-3Y=_MqzpVL7|^$8"); + String string0 = msoHeatEnvironmentParameter0.getValue(); + assertEquals("-3Y=_MqzpVL7|^$8", string0); + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter("{Ox?zu\"*"); + boolean boolean0 = msoHeatEnvironmentParameter1.equals(msoHeatEnvironmentParameter0); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("?.@!au:}y7xGSg|}8"); + boolean boolean0 = msoHeatEnvironmentParameter0.equals("?.@!au:}y7xGSg|}8"); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + msoHeatEnvironmentParameter0.setName(""); + assertEquals("", msoHeatEnvironmentParameter0.getName()); + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter(""); + boolean boolean0 = msoHeatEnvironmentParameter0.equals(msoHeatEnvironmentParameter1); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + String string0 = msoHeatEnvironmentParameter0.getValue(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + msoHeatEnvironmentParameter0.hashCode(); + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(); + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter(); + // Undeclared exception! + try { + msoHeatEnvironmentParameter0.equals(msoHeatEnvironmentParameter1); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + } + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter(""); + String string0 = msoHeatEnvironmentParameter0.toString(); + assertEquals(": null", string0); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTestscaffolding.java new file mode 100644 index 0000000000..f7e33bb8ce --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTestscaffolding.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:45:40 GMT 2016 + */ + +package org.openecomp.mso.openstack.utils; + +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 MsoHeatEnvironmentParameterESTestscaffolding { + + @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.utils.MsoHeatEnvironmentParameter"; + 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(MsoHeatEnvironmentParameterESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter" + ); + } + + private static void resetClasses() { + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTest.java new file mode 100644 index 0000000000..d3e7d29717 --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTest.java @@ -0,0 +1,129 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 08:45:54 GMT 2016 + */ + +package org.openecomp.mso.openstack.utils; + +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 MsoHeatEnvironmentResourceESTest extends MsoHeatEnvironmentResourceESTestscaffolding { + + @Test(timeout = 4000) + public void test00() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("", ""); + msoHeatEnvironmentResource0.hashCode(); + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("8{,8]8v", "8{,8]8v"); + String string0 = msoHeatEnvironmentResource0.getValue(); + assertEquals("8{,8]8v", string0); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("", ""); + String string0 = msoHeatEnvironmentResource0.getValue(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("\"(_{*)._$D2+w8wk"); + String string0 = msoHeatEnvironmentResource0.getName(); + assertEquals("\"(_{*)._$D2+w8wk", string0); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource(); + // Undeclared exception! + try { + msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource1); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + } + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("", ""); + MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource("", ""); + boolean boolean0 = msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource1); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("m"); + MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource("l", "l"); + boolean boolean0 = msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource1); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + boolean boolean0 = msoHeatEnvironmentResource0.equals("1Z^#74OJV(OBf<=#r"); + assertFalse(boolean0); + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + boolean boolean0 = msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource0); + assertTrue(boolean0); + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + String string0 = msoHeatEnvironmentResource0.getName(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + msoHeatEnvironmentResource0.setName(""); + String string0 = msoHeatEnvironmentResource0.getName(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(""); + String string0 = msoHeatEnvironmentResource0.getValue(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + msoHeatEnvironmentResource0.hashCode(); + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + String string0 = msoHeatEnvironmentResource0.toString(); + assertEquals("\"null\": null", string0); + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource(); + msoHeatEnvironmentResource0.setValue(""); + assertNull(msoHeatEnvironmentResource0.getName()); + } +} diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTestscaffolding.java new file mode 100644 index 0000000000..3917b8904c --- /dev/null +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTestscaffolding.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:45:54 GMT 2016 + */ + +package org.openecomp.mso.openstack.utils; + +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 MsoHeatEnvironmentResourceESTestscaffolding { + + @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.utils.MsoHeatEnvironmentResource"; + 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(MsoHeatEnvironmentResourceESTestscaffolding.class.getClassLoader() , + "org.openecomp.mso.openstack.utils.MsoHeatEnvironmentResource" + ); + } + + private static void resetClasses() { + } +} |