Initial OpenECOMP MSO commit
[so.git] / asdc-controller / src / test / java / org / openecomp / mso / asdc / installer / ASDCElementInfoESTest.java
1 /*
2  * This file was automatically generated by EvoSuite
3  * Fri Nov 25 13:35:55 GMT 2016
4  */
5
6 package org.openecomp.mso.asdc.installer;
7
8 import org.junit.Test;
9 import static org.junit.Assert.*;
10 import static org.evosuite.shaded.org.mockito.Mockito.*;
11 import static org.evosuite.runtime.EvoAssertions.*;
12
13 import java.util.List;
14 import java.util.Map;
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;
24
25 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
26 public class ASDCElementInfoESTest extends ASDCElementInfoESTestscaffolding {
27
28   @Test(timeout = 4000)
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);
38   }
39
40   @Test(timeout = 4000)
41   public void test01()  throws Throwable  {
42       ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfModuleStructure((VfModuleStructure) null);
43       Map<String, String> map0 = aSDCElementInfo0.getElementInfoMap();
44       assertTrue(map0.isEmpty());
45   }
46
47   @Test(timeout = 4000)
48   public void test02()  throws Throwable  {
49       Map<String, String> map0 = ASDCElementInfo.EMPTY_INSTANCE.getElementInfoMap();
50       assertTrue(map0.isEmpty());
51   }
52
53   @Test(timeout = 4000)
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!
65       try { 
66         aSDCElementInfo1.toString();
67         fail("Expecting exception: NullPointerException");
68       
69       } catch(NullPointerException e) {
70          //
71          // no message in exception (getMessage() returned null)
72          //
73          verifyException("org.openecomp.mso.asdc.installer.ASDCElementInfo", e);
74       }
75   }
76
77   @Test(timeout = 4000)
78   public void test05()  throws Throwable  {
79       ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.EMPTY_INSTANCE;
80       aSDCElementInfo0.addElementInfo("V$", (String) null);
81       assertEquals("", aSDCElementInfo0.getType());
82   }
83
84   @Test(timeout = 4000)
85   public void test06()  throws Throwable  {
86       ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfModuleStructure((VfModuleStructure) null);
87       String string0 = aSDCElementInfo0.EMPTY_INSTANCE.getType();
88       assertEquals("", string0);
89   }
90
91   @Test(timeout = 4000)
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;
98       try {
99         vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0);
100         fail("Expecting exception: NullPointerException");
101       
102       } catch(NullPointerException e) {
103          //
104          // no message in exception (getMessage() returned null)
105          //
106          verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e);
107       }
108   }
109
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);
120   }
121
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());
127   }
128
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();
137       assertNull(string0);
138   }
139 }