2 * This file was automatically generated by EvoSuite
3 * Wed Feb 22 12:31:50 GMT 2017
6 package org.openecomp.mso.adapters.catalogrest;
9 import static org.junit.Assert.*;
10 import static org.evosuite.shaded.org.mockito.Mockito.*;
11 import static org.evosuite.runtime.MockitoExtension.*;
12 import static org.evosuite.runtime.EvoAssertions.*;
13 import java.util.Collection;
14 import java.util.ConcurrentModificationException;
15 import java.util.LinkedList;
16 import java.util.List;
17 import org.evosuite.runtime.EvoRunner;
18 import org.evosuite.runtime.EvoRunnerParameters;
19 import org.evosuite.runtime.ViolatedAssumptionAnswer;
20 import org.junit.runner.RunWith;
21 import org.openecomp.mso.adapters.catalogrest.QueryServiceVnfs;
22 import org.openecomp.mso.db.catalog.beans.VnfResource;
24 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
25 public class QueryServiceVnfsESTest extends QueryServiceVnfsESTestscaffolding {
28 public void test00() throws Throwable {
29 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
30 queryServiceVnfs0.setServiceVnfs((List<VnfResource>) null);
31 List<VnfResource> list0 = queryServiceVnfs0.getServiceVnfs();
36 public void test01() throws Throwable {
37 LinkedList<VnfResource> linkedList0 = new LinkedList<VnfResource>();
38 VnfResource vnfResource0 = new VnfResource();
39 linkedList0.add(vnfResource0);
40 List<VnfResource> list0 = linkedList0.subList(1, 1);
41 linkedList0.add(vnfResource0);
42 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
43 queryServiceVnfs0.setServiceVnfs(list0);
44 // Undeclared exception!
46 queryServiceVnfs0.toString();
47 fail("Expecting exception: ConcurrentModificationException");
49 } catch(ConcurrentModificationException e) {
51 // no message in exception (getMessage() returned null)
53 verifyException("java.util.SubList", e);
58 public void test02() throws Throwable {
59 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
60 queryServiceVnfs0.setServiceVnfs((List<VnfResource>) null);
61 // Undeclared exception!
63 queryServiceVnfs0.toString();
64 fail("Expecting exception: NullPointerException");
66 } catch(NullPointerException e) {
68 // no message in exception (getMessage() returned null)
70 verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceVnfs", e);
75 public void test03() throws Throwable {
76 LinkedList<VnfResource> linkedList0 = new LinkedList<VnfResource>();
77 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
78 Object[] objectArray0 = new Object[3];
79 objectArray0[1] = (Object) queryServiceVnfs0;
80 queryServiceVnfs0.setServiceVnfs(linkedList0);
81 Collection<VnfResource> collection0 = (Collection<VnfResource>) mock(Collection.class, new ViolatedAssumptionAnswer());
82 doReturn(objectArray0).when(collection0).toArray();
83 linkedList0.addAll(collection0);
84 // Undeclared exception!
86 queryServiceVnfs0.toString();
87 fail("Expecting exception: ClassCastException");
89 } catch(ClassCastException e) {
91 // org.openecomp.mso.adapters.catalogrest.QueryServiceVnfs cannot be cast to org.openecomp.mso.db.catalog.beans.VnfResource
93 verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceVnfs", e);
98 public void test04() throws Throwable {
99 LinkedList<VnfResource> linkedList0 = new LinkedList<VnfResource>();
100 linkedList0.add((VnfResource) null);
101 QueryServiceVnfs queryServiceVnfs0 = null;
103 queryServiceVnfs0 = new QueryServiceVnfs((List<VnfResource>) linkedList0);
104 fail("Expecting exception: NullPointerException");
106 } catch(NullPointerException e) {
108 // no message in exception (getMessage() returned null)
110 verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceVnfs", e);
114 @Test(timeout = 4000)
115 public void test05() throws Throwable {
116 LinkedList<VnfResource> linkedList0 = new LinkedList<VnfResource>();
117 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
118 Object[] objectArray0 = new Object[8];
119 objectArray0[0] = (Object) queryServiceVnfs0;
120 Collection<VnfResource> collection0 = (Collection<VnfResource>) mock(Collection.class, new ViolatedAssumptionAnswer());
121 doReturn(objectArray0).when(collection0).toArray();
122 linkedList0.addAll(0, collection0);
123 QueryServiceVnfs queryServiceVnfs1 = null;
125 queryServiceVnfs1 = new QueryServiceVnfs((List<VnfResource>) linkedList0);
126 fail("Expecting exception: ClassCastException");
128 } catch(ClassCastException e) {
130 // org.openecomp.mso.adapters.catalogrest.QueryServiceVnfs cannot be cast to org.openecomp.mso.db.catalog.beans.VnfResource
132 verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceVnfs", e);
136 @Test(timeout = 4000)
137 public void test06() throws Throwable {
138 LinkedList<VnfResource> linkedList0 = new LinkedList<VnfResource>();
139 VnfResource vnfResource0 = new VnfResource();
140 linkedList0.add(vnfResource0);
141 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
142 queryServiceVnfs0.setServiceVnfs(linkedList0);
143 linkedList0.add(vnfResource0);
144 String string0 = queryServiceVnfs0.toString();
145 assertEquals("1\tVNF=null,version=null,mode=null,template=null,envtId=null,asdcUuid=null,aicVersionMin=null,aicVersionMax=null,modelInvariantUuid=null,modelVersion=null,modelCustomizationName=null,modelName=null,serviceModelInvariantUUID=null,modelCustomizationUuid=nullVfModules: NONE1\t\nVNF=null,version=null,mode=null,template=null,envtId=null,asdcUuid=null,aicVersionMin=null,aicVersionMax=null,modelInvariantUuid=null,modelVersion=null,modelCustomizationName=null,modelName=null,serviceModelInvariantUUID=null,modelCustomizationUuid=nullVfModules: NONE", string0);
148 @Test(timeout = 4000)
149 public void test07() throws Throwable {
150 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
151 String string0 = queryServiceVnfs0.toString();
152 assertEquals("", string0);
155 @Test(timeout = 4000)
156 public void test08() throws Throwable {
157 LinkedList<VnfResource> linkedList0 = new LinkedList<VnfResource>();
158 VnfResource vnfResource0 = new VnfResource();
159 linkedList0.add(vnfResource0);
160 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs((List<VnfResource>) linkedList0);
161 List<VnfResource> list0 = queryServiceVnfs0.getServiceVnfs();
162 assertEquals(1, list0.size());
165 @Test(timeout = 4000)
166 public void test09() throws Throwable {
167 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
168 List<VnfResource> list0 = queryServiceVnfs0.getServiceVnfs();
169 queryServiceVnfs0.setServiceVnfs(list0);
170 assertTrue(list0.isEmpty());
173 @Test(timeout = 4000)
174 public void test10() throws Throwable {
175 QueryServiceVnfs queryServiceVnfs0 = new QueryServiceVnfs();
176 // Undeclared exception!
178 queryServiceVnfs0.toJsonString();
179 fail("Expecting exception: VerifyError");
181 } catch(VerifyError e) {
183 // (class: org/codehaus/jackson/map/MapperConfig, method: <clinit> signature: ()V) Bad type in putfield/putstatic
185 verifyException("org.codehaus.jackson.map.ObjectMapper", e);