SOAPUI Junit

Feel free to talk about anything and everything in this board. We will put up general announcements here.

SOAPUI Junit

Postby P » 19 Apr 2010 23:32

I would like to test a Web Service from the JUnit using the xml file into which the test suites are extracted.

I use WsdlProject project = new WsdlProject("src/com/test/soapui/soapui-test.xml") to enable test of the web service using java.

The problem I am facing is that the host of web service can change with time. Can I reset the endpoint of the service in the Junit ?.
P
User
 
Posts: 1
Joined: 19 Apr 2010 23:24

Re: SOAPUI Junit

Postby b6429527 » 06 Feb 2012 16:04

It would also be interested in me:

WsdlTestSuite testSuite = project.getTestSuiteByName("Test Suite Name");
WsdlTestCase testCase = testSuite.getTestCaseByName("Test Case Name");

StringToObjectMap properties = new PropertiesMap();
WsdlTestCaseRunner testRunner = testCase.run(properties, false);


It probably goes through the properties, but they are not documented anywhere :-\.
b6429527
User
 
Posts: 2
Joined: 06 Feb 2012 15:56

Re: SOAPUI Junit

Postby b6429527 » 07 Feb 2012 10:05

Ok, I found solution by SoapUITestCaseRunner:

SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
runner.setEndpoint("http://myserver:9001");
runner.setOutputFolder("target/soapui-errors");
runner.setProjectFile(projectXmlFile);
runner.setTestSuite(testSuiteName);
runner.setTestCase(testCaseName);

try {
runner.run();
} catch (Exception ex) {
throw new AssertionError(buildTestCaseReport(testCase, testRunner) + " " + ex.toString());
}


It's a bad solution, because I can not cache the project xml and load test takes a long time. But other solutions did not work.

Boys, it needs more documentation! O0
b6429527
User
 
Posts: 2
Joined: 06 Feb 2012 15:56


Return to General



cron