    1   /*
    2    *  soapUI, copyright (C) 2004-2007 eviware.com
    3    *
    4    *  soapUI is free software; you can redistribute it and/or modify it under the
    5    *  terms of version 2.1 of the GNU Lesser General Public License as published by
    6    *  the Free Software Foundation.
    7    *
    8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    9    *  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  {
    28  	public void testAssert() throws Exception
    29  	{
    30  		WsdlProject project = new WsdlProject("src" + File.separatorChar + "test-resources" + File.separatorChar + "sample-soapui-project.xml");
    31        TestSuite testSuite = project.getTestSuiteByName("Test Suite");
    32        com.eviware.soapui.model.testsuite.TestCase testCase =
    33           testSuite.getTestCaseByName("Test Conversions");
    34
    35        WsdlTestRequestStep testStep = ( WsdlTestRequestStep ) testCase.getTestStepByName("SEK to USD Test");
    36
    37        MockTestRunner testRunner = new MockTestRunner( (WsdlTestCase) testStep.getTestCase() );
    38        MockTestRunContext testRunContext = new MockTestRunContext( testRunner, (WsdlTestStep) testStep );
    39
    40        TestStepResult result = testStep.run( testRunner, testRunContext );
    41
    42        WsdlTestRequestStepResult wsdlResult = (WsdlTestRequestStepResult)result;
    43        assertEquals(TestStepResult.TestStepStatus.OK, wsdlResult.getStatus());
    44  	}
    45  }