2 * This file was automatically generated by EvoSuite
3 * Fri Nov 25 13:35:55 GMT 2016
6 package org.openecomp.mso.asdc.installer;
9 import static org.junit.Assert.*;
10 import static org.evosuite.shaded.org.mockito.Mockito.*;
11 import static org.evosuite.runtime.EvoAssertions.*;
13 import java.util.List;
15 import org.evosuite.runtime.EvoRunner;
16 import org.evosuite.runtime.EvoRunnerParameters;
17 import org.evosuite.runtime.PrivateAccess;
18 import org.evosuite.runtime.ViolatedAssumptionAnswer;
19 import org.junit.runner.RunWith;
20 import org.openecomp.sdc.api.notification.IArtifactInfo;
21 import org.openecomp.sdc.api.notification.INotificationData;
22 import org.openecomp.sdc.api.notification.IResourceInstance;
23 import org.openecomp.sdc.api.notification.IVfModuleMetadata;
25 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
26 public class ASDCElementInfoESTest extends ASDCElementInfoESTestscaffolding {
29 public void test00() throws Throwable {
30 INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
31 IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
32 doReturn((String) null).when(iResourceInstance0).getResourceInstanceName();
33 doReturn((String) null).when(iResourceInstance0).getResourceInvariantUUID();
34 VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
35 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfResourceStructure(vfResourceStructure0);
36 String string0 = aSDCElementInfo0.getType();
37 assertEquals("VNF_RESOURCE", string0);
41 public void test01() throws Throwable {
42 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfModuleStructure((VfModuleStructure) null);
43 Map<String, String> map0 = aSDCElementInfo0.getElementInfoMap();
44 assertTrue(map0.isEmpty());
48 public void test02() throws Throwable {
49 Map<String, String> map0 = ASDCElementInfo.EMPTY_INSTANCE.getElementInfoMap();
50 assertTrue(map0.isEmpty());
54 public void test03() throws Throwable {
55 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.EMPTY_INSTANCE;
56 IArtifactInfo iArtifactInfo0 = mock(IArtifactInfo.class, new ViolatedAssumptionAnswer());
57 doReturn((String) null).when(iArtifactInfo0).getArtifactName();
58 doReturn((String) null).when(iArtifactInfo0).getArtifactType();
59 doReturn((String) null).when(iArtifactInfo0).getArtifactUUID();
60 ASDCElementInfo aSDCElementInfo1 = ASDCElementInfo.createElementFromVfArtifactInfo(iArtifactInfo0);
61 aSDCElementInfo0.toString();
62 PrivateAccess.setVariable((Class<ASDCElementInfo>) ASDCElementInfo.class, aSDCElementInfo1, "elementInfoMap", (Object) null);
63 aSDCElementInfo0.toString();
64 // Undeclared exception!
66 aSDCElementInfo1.toString();
67 fail("Expecting exception: NullPointerException");
69 } catch(NullPointerException e) {
71 // no message in exception (getMessage() returned null)
73 verifyException("org.openecomp.mso.asdc.installer.ASDCElementInfo", e);
78 public void test05() throws Throwable {
79 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.EMPTY_INSTANCE;
80 aSDCElementInfo0.addElementInfo("V$", (String) null);
81 assertEquals("", aSDCElementInfo0.getType());
85 public void test06() throws Throwable {
86 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfModuleStructure((VfModuleStructure) null);
87 String string0 = aSDCElementInfo0.EMPTY_INSTANCE.getType();
88 assertEquals("", string0);
92 public void test07() throws Throwable {
93 INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
94 VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, (IResourceInstance) null);
95 IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer());
96 doReturn((List) null).when(iVfModuleMetadata0).getArtifacts();
97 VfModuleStructure vfModuleStructure0 = null;
99 vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0);
100 fail("Expecting exception: NullPointerException");
102 } catch(NullPointerException e) {
104 // no message in exception (getMessage() returned null)
106 verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e);
110 @Test(timeout = 4000)
111 public void test08() throws Throwable {
112 INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
113 IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
114 doReturn(" Name").when(iResourceInstance0).getResourceInstanceName();
115 doReturn(" Name").when(iResourceInstance0).getResourceInvariantUUID();
116 VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
117 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfResourceStructure(vfResourceStructure0);
118 String string0 = aSDCElementInfo0.toString();
119 assertEquals("Resource Instance Invariant UUID: Name, Resource Instance Name: Name", string0);
122 @Test(timeout = 4000)
123 public void test09() throws Throwable {
124 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfArtifactInfo((IArtifactInfo) null);
125 aSDCElementInfo0.addElementInfo((String) null, "");
126 assertEquals("", aSDCElementInfo0.getType());
129 @Test(timeout = 4000)
130 public void test10() throws Throwable {
131 IArtifactInfo iArtifactInfo0 = mock(IArtifactInfo.class, new ViolatedAssumptionAnswer());
132 doReturn((String) null).when(iArtifactInfo0).getArtifactName();
133 doReturn((String) null).when(iArtifactInfo0).getArtifactType();
134 doReturn((String) null).when(iArtifactInfo0).getArtifactUUID();
135 ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfArtifactInfo(iArtifactInfo0);
136 String string0 = aSDCElementInfo0.getType();