2 * This file was automatically generated by EvoSuite
3 * Thu Nov 10 08:35:35 GMT 2016
6 package org.openecomp.mso.properties;
8 import static org.evosuite.runtime.EvoAssertions.verifyException;
9 import static org.junit.Assert.assertEquals;
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertNotNull;
12 import static org.junit.Assert.assertNotSame;
13 import static org.junit.Assert.assertNull;
14 import static org.junit.Assert.assertTrue;
15 import static org.junit.Assert.fail;
17 import java.io.FileNotFoundException;
19 import org.evosuite.runtime.EvoRunner;
20 import org.evosuite.runtime.EvoRunnerParameters;
21 import org.evosuite.runtime.PrivateAccess;
22 import org.evosuite.runtime.testdata.FileSystemHandling;
23 import org.junit.Ignore;
24 import org.junit.Test;
25 import org.junit.runner.RunWith;
27 import org.openecomp.mso.logger.MsoLogger;
29 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
30 public class MsoJavaPropertiesESTest extends MsoJavaPropertiesESTestscaffolding {
33 public void test00() throws Throwable {
34 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
35 msoJavaProperties0.setProperty("", "J6");
36 msoJavaProperties0.hashCode();
40 public void test02() throws Throwable {
41 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
42 String string0 = msoJavaProperties0.getProperty("IK#uRP]", (String) null);
47 public void test03() throws Throwable {
48 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
49 String string0 = msoJavaProperties0.getProperty("", "");
50 assertNotNull(string0);
51 assertEquals("", string0);
55 public void test04() throws Throwable {
56 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
57 int int0 = msoJavaProperties0.getIntProperty("RA_VNF_NOT_EXIST", (-1417));
58 assertEquals((-1417), int0);
62 public void test05() throws Throwable {
63 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
64 String string0 = msoJavaProperties0.getEncryptedProperty("", "", "");
65 assertEquals("", string0);
66 assertNotNull(string0);
70 public void test06() throws Throwable {
71 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
72 msoJavaProperties0.automaticRefreshInMinutes = 1821;
73 MsoJavaProperties msoJavaProperties1 = msoJavaProperties0.clone();
74 assertNotSame(msoJavaProperties1, msoJavaProperties0);
75 assertEquals(1821, msoJavaProperties1.getAutomaticRefreshInMinutes());
79 public void test07() throws Throwable {
80 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
81 msoJavaProperties0.automaticRefreshInMinutes = (-78);
82 MsoJavaProperties msoJavaProperties1 = msoJavaProperties0.clone();
83 assertNotSame(msoJavaProperties1, msoJavaProperties0);
84 assertEquals(-78, msoJavaProperties1.getAutomaticRefreshInMinutes());
88 public void test08() throws Throwable {
89 FileSystemHandling fileSystemHandling0 = new FileSystemHandling();
90 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
91 PrivateAccess.setVariable((Class<MsoJavaProperties>) MsoJavaProperties.class, msoJavaProperties0, "msoProperties", (Object) null);
92 msoJavaProperties0.hashCode();
93 msoJavaProperties0.hashCode();
94 // Undeclared exception!
96 msoJavaProperties0.size();
97 fail("Expecting exception: NullPointerException");
99 } catch(NullPointerException e) {
101 // no message in exception (getMessage() returned null)
103 verifyException("org.openecomp.mso.properties.MsoJavaProperties", e);
107 @Test(timeout = 4000)
108 public void test09() throws Throwable {
109 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
110 // Undeclared exception!
112 msoJavaProperties0.setProperty((String) null, "+UaYo-~&{QxdaN(c");
113 fail("Expecting exception: NullPointerException");
115 } catch(NullPointerException e) {
117 // no message in exception (getMessage() returned null)
122 @Test(timeout = 4000)
123 public void test11() throws Throwable {
124 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
125 MsoJavaProperties msoJavaProperties1 = msoJavaProperties0.clone();
126 msoJavaProperties1.propertiesFileName = "";
128 msoJavaProperties1.reloadPropertiesFile();
129 fail("Expecting exception: FileNotFoundException");
131 } catch(FileNotFoundException e) {
133 // no message in exception (getMessage() returned null)
135 verifyException("org.evosuite.runtime.mock.java.io.MockFileInputStream", e);
140 * TODO: fails when run using maven, but succeeds when run using eclipse
143 @Test(timeout = 4000)
144 public void test12() throws Throwable {
145 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
146 // Undeclared exception!
148 msoJavaProperties0.loadPropertiesFile((String) null);
149 fail("Expecting exception: NullPointerException");
151 } catch(NullPointerException e) {
153 // no message in exception (getMessage() returned null)
155 verifyException("org.evosuite.runtime.mock.java.io.MockFileInputStream", e);
159 @Test(timeout = 4000)
160 public void test13() throws Throwable {
161 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
163 msoJavaProperties0.loadPropertiesFile("");
164 fail("Expecting exception: FileNotFoundException");
166 } catch(FileNotFoundException e) {
168 // no message in exception (getMessage() returned null)
170 verifyException("org.evosuite.runtime.mock.java.io.MockFileInputStream", e);
174 @Test(timeout = 4000)
175 public void test14() throws Throwable {
176 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
177 // Undeclared exception!
179 msoJavaProperties0.getIntProperty((String) null, 0);
180 fail("Expecting exception: NullPointerException");
182 } catch(NullPointerException e) {
184 // no message in exception (getMessage() returned null)
189 @Test(timeout = 4000)
190 public void test15() throws Throwable {
191 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
192 msoJavaProperties0.setProperty("APIH_READ_VNFOUTPUT_CLOB_EXCEPTION", "");
193 // Undeclared exception!
195 msoJavaProperties0.getEncryptedProperty("APIH_READ_VNFOUTPUT_CLOB_EXCEPTION", "", "k$&Fq}");
196 fail("Expecting exception: NumberFormatException");
198 } catch(NumberFormatException e) {
200 // For input string: \"k$\"
202 verifyException("java.lang.NumberFormatException", e);
206 @Test(timeout = 4000)
207 public void test16() throws Throwable {
208 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
209 MsoJavaProperties msoJavaProperties1 = msoJavaProperties0.clone();
210 msoJavaProperties1.clone();
211 msoJavaProperties0.hashCode();
212 MsoJavaProperties msoJavaProperties2 = msoJavaProperties1.clone();
213 PrivateAccess.setVariable((Class<MsoJavaProperties>) MsoJavaProperties.class, msoJavaProperties0, "msoProperties", (Object) null);
214 msoJavaProperties1.equals(msoJavaProperties2);
215 MsoLogger msoLogger0 = AbstractMsoProperties.LOGGER;
216 // Undeclared exception!
218 msoJavaProperties0.clone();
219 fail("Expecting exception: NullPointerException");
221 } catch(NullPointerException e) {
223 // no message in exception (getMessage() returned null)
225 verifyException("java.util.Hashtable", e);
229 @Test(timeout = 4000)
230 public void test18() throws Throwable {
231 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
232 int int0 = msoJavaProperties0.getIntProperty("", 0);
233 assertEquals(0, int0);
236 @Test(timeout = 4000)
237 public void test19() throws Throwable {
238 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
239 msoJavaProperties0.setProperty("-6;qct1", "");
240 String string0 = msoJavaProperties0.toString();
241 assertEquals("Config file null(Timer:0mins):\n-6;qct1=\n\n\n", string0);
244 @Test(timeout = 4000)
245 public void test20() throws Throwable {
246 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
247 boolean boolean0 = msoJavaProperties0.equals("APIH_READ_VNFOUTPUT_CLOB_EXCEPTION");
248 assertFalse(boolean0);
251 @Test(timeout = 4000)
252 public void test21() throws Throwable {
253 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
254 boolean boolean0 = msoJavaProperties0.equals((Object) null);
255 assertFalse(boolean0);
258 @Test(timeout = 4000)
259 public void test22() throws Throwable {
260 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
261 boolean boolean0 = msoJavaProperties0.equals(msoJavaProperties0);
262 assertTrue(boolean0);
265 @Test(timeout = 4000)
266 public void test24() throws Throwable {
267 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
268 msoJavaProperties0.setProperty("APIH_READ_VNFOUTPUT_CLOB_EXCEPTION", "");
269 // Undeclared exception!
271 msoJavaProperties0.getEncryptedProperty("APIH_READ_VNFOUTPUT_CLOB_EXCEPTION", ".", "");
272 fail("Expecting exception: IllegalArgumentException");
274 } catch(IllegalArgumentException e) {
278 verifyException("javax.crypto.spec.SecretKeySpec", e);
282 @Test(timeout = 4000)
283 public void test25() throws Throwable {
284 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
285 String string0 = msoJavaProperties0.getEncryptedProperty("YhmJSc|~L0$
\7f,?/oh", (String) null, "YhmJSc|~L0$
\7f,?/oh");
289 @Test(timeout = 4000)
290 public void test26() throws Throwable {
291 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
292 msoJavaProperties0.setProperty("M;WrYY%E,;sa&4F", "M;WrYY%E,;sa&4F");
293 boolean boolean0 = msoJavaProperties0.getBooleanProperty("M;WrYY%E,;sa&4F", false);
294 assertFalse(boolean0);
297 @Test(timeout = 4000)
298 public void test27() throws Throwable {
299 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
300 boolean boolean0 = msoJavaProperties0.getBooleanProperty("", true);
301 assertTrue(boolean0);
304 @Test(timeout = 4000)
305 public void test28() throws Throwable {
306 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
307 msoJavaProperties0.setProperty("M;WrYY%E,;sa&4F", "M;WrYY%E,;sa&4F");
308 int int0 = msoJavaProperties0.getIntProperty("M;WrYY%E,;sa&4F", 0);
309 assertEquals(0, int0);
312 @Test(timeout = 4000)
313 public void test29() throws Throwable {
314 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
315 msoJavaProperties0.setProperty("", "J6");
316 String string0 = msoJavaProperties0.getProperty("", "mso.properties.reload.time.minutes");
317 assertNotNull(string0);
318 assertEquals("J6", string0);
321 * TODO: fails when run using maven, but succeeds when run using eclipse
324 @Test(timeout = 4000)
325 public void test30() throws Throwable {
326 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
327 // Undeclared exception!
329 msoJavaProperties0.reloadPropertiesFile();
330 fail("Expecting exception: NullPointerException");
332 } catch(NullPointerException e) {
334 // no message in exception (getMessage() returned null)
336 verifyException("org.evosuite.runtime.mock.java.io.MockFileInputStream", e);
340 @Test(timeout = 4000)
341 public void test31() throws Throwable {
342 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
343 MsoJavaProperties msoJavaProperties1 = msoJavaProperties0.clone();
344 assertTrue(msoJavaProperties1.equals((Object)msoJavaProperties0));
346 msoJavaProperties0.setProperty("", "");
347 boolean boolean0 = msoJavaProperties0.equals(msoJavaProperties1);
348 assertFalse(boolean0);
349 assertFalse(msoJavaProperties1.equals((Object)msoJavaProperties0));
352 @Test(timeout = 4000)
353 public void test32() throws Throwable {
354 MsoJavaProperties msoJavaProperties0 = new MsoJavaProperties();
355 int int0 = msoJavaProperties0.size();
356 assertEquals(0, int0);