How to run testsuite with java?
Hi,
i want to run soapui testsuite with java.
i have soapui-5.6.0 open source.
in Eclipse i created a project.
with JRE1.8
Then i added all jars from lib into the java project and also this one soapui-5.6.0.jar
It looks there is a problem with groovy-all-2.4.17.jar
1-Should i use an older version of soapui for all jars?
2-Should i replace the groovy-all-2.4.17.jar by another version?
3-Is it correct to use the soapui open source jars here? or is it working only with pro version?
Thank you
It throws this error:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/Program%20Files/SmartBear/SoapUI-5.6.0/lib/groovy-all-2.4.17.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
i have this code in java:
import java.util.List;
import org.junit.Test;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.model.support.PropertiesMap;
import com.eviware.soapui.model.testsuite.TestCase;
import com.eviware.soapui.model.testsuite.TestRunner;
import com.eviware.soapui.model.testsuite.TestSuite;
import com.eviware.soapui.model.testsuite.TestRunner.Status;
import com.eviware.soapui.tools.SoapUITestCaseRunner;
import static org.junit.Assert.*;
public class SoapUITest {
test
public void lessControl() throws Exception {
SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
runner.setProjectFile("C:\\temp\\test.xml");
runner.setPrintReport(true);
runner.run();
}
test
public void fullControl() throws Exception {
WsdlProject project = new WsdlProject("C:\\temp\\test.xml");
List<TestSuite> testSuites = project.getTestSuiteList();
for( TestSuite suite : testSuites ) {
List<TestCase> testCases = suite.getTestCaseList();
for( TestCase testCase : testCases ) {
System.out.println("Running SoapUI test [" + testCase.getName() + "]");
TestRunner runner2 = testCase.run(new PropertiesMap(), false);
assertEquals(Status.FINISHED, runner2.getStatus());
}
}
}
}