Search in sources :

Example 1 with TestStep

use of com.eviware.soapui.model.testsuite.TestStep in project microcks by microcks.

the class SoapUIProjectImporter method collectRestTestRequests.

/**
 * Collect and filter by operation all the WsldTestrequest from the current project.
 */
private Map<String, RestTestRequest> collectRestTestRequests(Operation operation) {
    Map<String, RestTestRequest> result = new HashMap<String, RestTestRequest>();
    for (TestSuite testsuite : project.getTestSuiteList()) {
        for (TestCase testcase : testsuite.getTestCaseList()) {
            for (TestStep teststep : testcase.getTestStepList()) {
                if (teststep instanceof RestTestRequestStep) {
                    RestTestRequestStep rs = (RestTestRequestStep) teststep;
                    RestTestRequest rr = rs.getTestRequest();
                    if (rs.getResourcePath().equals(operation.getName())) {
                        result.put(rr.getName(), rr);
                    }
                }
            }
        }
    }
    return result;
}
Also used : TestStep(com.eviware.soapui.model.testsuite.TestStep) TestSuite(com.eviware.soapui.model.testsuite.TestSuite) TestCase(com.eviware.soapui.model.testsuite.TestCase) RestTestRequest(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest) RestTestRequestStep(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep)

Example 2 with TestStep

use of com.eviware.soapui.model.testsuite.TestStep in project microcks by microcks.

the class SoapUIProjectImporter method collectWsdlTestRequests.

/**
 * Collect and filter by operation all the WsldTestrequest from the current project.
 */
private Map<String, WsdlTestRequest> collectWsdlTestRequests(Operation operation) {
    Map<String, WsdlTestRequest> result = new HashMap<>();
    for (TestSuite testsuite : project.getTestSuiteList()) {
        for (TestCase testcase : testsuite.getTestCaseList()) {
            for (TestStep teststep : testcase.getTestStepList()) {
                if (teststep instanceof WsdlTestRequestStep) {
                    WsdlTestRequestStep ws = (WsdlTestRequestStep) teststep;
                    WsdlTestRequest wr = ws.getHttpRequest();
                    if (wr.getOperationName().equals(operation.getName())) {
                        result.put(wr.getName(), wr);
                    }
                }
            }
        }
    }
    return result;
}
Also used : TestStep(com.eviware.soapui.model.testsuite.TestStep) WsdlTestRequestStep(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep) TestSuite(com.eviware.soapui.model.testsuite.TestSuite) TestCase(com.eviware.soapui.model.testsuite.TestCase) WsdlTestRequest(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequest)

Aggregations

TestCase (com.eviware.soapui.model.testsuite.TestCase)2 TestStep (com.eviware.soapui.model.testsuite.TestStep)2 TestSuite (com.eviware.soapui.model.testsuite.TestSuite)2 RestTestRequest (com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest)1 RestTestRequestStep (com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep)1 WsdlTestRequest (com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequest)1 WsdlTestRequestStep (com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep)1