import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.model.iface.MessageExchange;
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 org.junit.Assert;
import java.util.List;
public class SoapUITest
{
public final static void main(String [] args) throws Exception {
WsdlProject project = new WsdlProject("C:\\WebService\\WebServiceTest\\src\\main\\java\\weather.xml");
List<TestSuite> testSuites = project.getTestSuiteList();
for (TestSuite testSuite: testSuites)
{
System.out.println("Running Test Suite: "+ testSuite.getName());
List<TestCase> testCases = testSuite.getTestCaseList();
for(TestCase testCase:testCases)
{
System.out.println("Running Test Case: " + testCase.getName());
WsdlTestCaseRunner runner = new WsdlTestCaseRunner((WsdlTestCase) testCase, new StringToObjectMap(testCase.getProperties()) );
for(TestStep testStep: testSteps){
//calling the above get method here
String response = runStepAndGetResponseContent(runner, testStep);
System.out.print("Received response is :" + response);
}
Assert.assertEquals(TestRunner.Status.FINISHED,testRunner.getStatus());
//Exception in the below line
//System.out.println(((MessageExchange)testRunner).getResponseContent());
}
}
System.out.print("Testing finished successfully");