Forum Discussion

vasanthsjc's avatar
13 years ago

Junit Integration : runner.run always return false status

I was trying to execute a test case by invoking the testrunner from JUnit-tests. But I find that if the test case involves any SOAP request, runner.run always returning "Failed" status. Whereas in the test case if I just have a groovy script/property test step, the status(TestRunner.getStatus()) of the run was 'Successful". Here is the code that I have :

public class DemoClass {
test
public void fullControl() throws Exception {
WsdlProject project = new WsdlProject("D://My Projects//demo.xml");

List<TestSuite> testSuites = project.getTestSuiteList();
List<TestCase> testCases = testSuites.get(0).getTestCaseList(); // Get all the test case under the first test suite
System.out.println("Running SoapUI test [" + testCases.get(0).getName() + "]");
TestRunner runner2 = testCases.get(0).run(new PropertiesMap(), false); // Run the first test case
assertEquals(Status.FINISHED, runner2.getStatus());
}
}
No RepliesBe the first to reply