01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.impl.wsdl.teststeps;
14:
15: import java.io.File;
16:
17: import junit.framework.TestCase;
18:
19: import com.eviware.soapui.impl.wsdl.WsdlProject;
20: import com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext;
21: import com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner;
22: import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
23: import com.eviware.soapui.model.testsuite.TestStepResult;
24: import com.eviware.soapui.model.testsuite.TestSuite;
25:
26: public class WsdlRequestStepTestCase extends TestCase {
27: public void testAssert() throws Exception {
28: WsdlProject project = new WsdlProject("src"
29: + File.separatorChar + "test-resources"
30: + File.separatorChar + "sample-soapui-project.xml");
31: TestSuite testSuite = project.getTestSuiteByName("Test Suite");
32: com.eviware.soapui.model.testsuite.TestCase testCase = testSuite
33: .getTestCaseByName("Test Conversions");
34:
35: WsdlTestRequestStep testStep = (WsdlTestRequestStep) testCase
36: .getTestStepByName("SEK to USD Test");
37:
38: MockTestRunner testRunner = new MockTestRunner(
39: (WsdlTestCase) testStep.getTestCase());
40: MockTestRunContext testRunContext = new MockTestRunContext(
41: testRunner, (WsdlTestStep) testStep);
42:
43: TestStepResult result = testStep
44: .run(testRunner, testRunContext);
45:
46: WsdlTestRequestStepResult wsdlResult = (WsdlTestRequestStepResult) result;
47: assertEquals(TestStepResult.TestStepStatus.OK, wsdlResult
48: .getStatus());
49: }
50: }
|