a14934193eee12883cd4fb01c812cc1b6f191118
[so.git] / bpmn / MSOCoreBPMN / src / test / java / org / openecomp / mso / bpmn / core / XQueryScriptTaskESTest.java
1 /*
2  * This file was automatically generated by EvoSuite
3  * Mon Nov 14 11:28:14 GMT 2016
4  */
5
6 package org.openecomp.mso.bpmn.core;
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.io.IOException;
14 import net.sf.saxon.s9api.XQueryCompiler;
15 import net.sf.saxon.s9api.XQueryExecutable;
16 import org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl;
17 import org.evosuite.runtime.EvoRunner;
18 import org.evosuite.runtime.EvoRunnerParameters;
19 import org.evosuite.runtime.PrivateAccess;
20 import org.evosuite.runtime.ViolatedAssumptionAnswer;
21 import org.junit.runner.RunWith;
22
23 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
24 public class XQueryScriptTaskESTest extends XQueryScriptTaskESTestscaffolding {
25
26   @Test(timeout = 4000)
27   public void test0()  throws Throwable  {
28       XQueryScriptTask xQueryScriptTask0 = new XQueryScriptTask();
29       XQueryCompiler xQueryCompiler0 = mock(XQueryCompiler.class, new ViolatedAssumptionAnswer());
30       doReturn((XQueryExecutable) null).when(xQueryCompiler0).compile(any(java.io.InputStream.class));
31       Object object0 = PrivateAccess.callMethod((Class<XQueryScriptTask>) XQueryScriptTask.class, xQueryScriptTask0, "compile", (Object) xQueryCompiler0, (Class<?>) XQueryCompiler.class, (Object) "", (Class<?>) String.class);
32       assertNull(object0);
33   }
34
35   @Test(timeout = 4000)
36   public void test1()  throws Throwable  {
37       XQueryScriptTask xQueryScriptTask0 = new XQueryScriptTask();
38       XQueryCompiler xQueryCompiler0 = mock(XQueryCompiler.class, new ViolatedAssumptionAnswer());
39       try { 
40         PrivateAccess.callMethod((Class<XQueryScriptTask>) XQueryScriptTask.class, xQueryScriptTask0, "compile", (Object) xQueryCompiler0, (Class<?>) XQueryCompiler.class, (Object) "Sk##N$V^.", (Class<?>) String.class);
41         fail("Expecting exception: IOException");
42       
43       } catch(IOException e) {
44          //
45          // Resource not found: Sk##N$V^.
46          //
47          verifyException("org.openecomp.mso.bpmn.core.XQueryScriptTask", e);
48       }
49   }
50
51   @Test(timeout = 4000)
52   public void test2()  throws Throwable  {
53       XQueryScriptTask xQueryScriptTask0 = new XQueryScriptTask();
54       try { 
55         PrivateAccess.callMethod((Class<XQueryScriptTask>) XQueryScriptTask.class, xQueryScriptTask0, "compile", (Object) null, (Class<?>) XQueryCompiler.class, (Object) "", (Class<?>) String.class);
56         fail("Expecting exception: NullPointerException");
57       
58       } catch(NullPointerException e) {
59          //
60          // no message in exception (getMessage() returned null)
61          //
62          verifyException("org.openecomp.mso.bpmn.core.XQueryScriptTask", e);
63       }
64   }
65
66   @Test(timeout = 4000)
67   public void test3()  throws Throwable  {
68       XQueryScriptTask xQueryScriptTask0 = new XQueryScriptTask();
69       ExecutionImpl executionImpl0 = new ExecutionImpl();
70       try { 
71         xQueryScriptTask0.execute(executionImpl0);
72         fail("Expecting exception: RuntimeException");
73       
74       } catch(RuntimeException e) {
75          //
76          // XQueryScriptTask injected field 'scriptFile' is bad: missing required field
77          //
78          verifyException("org.openecomp.mso.bpmn.core.BaseTask", e);
79       }
80   }
81 }