1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.actions.teststep;
14
15 import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
16 import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner;
17 import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep;
18 import com.eviware.soapui.model.testsuite.TestCaseRunContext;
19 import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
20 import com.eviware.soapui.support.types.StringToObjectMap;
21
22 /***
23 * Renames a WsdlTestStep
24 *
25 * @author Ole.Matzura
26 */
27
28 public class RunFromTestStepAction extends AbstractSoapUIAction<WsdlTestStep>
29 {
30 public RunFromTestStepAction()
31 {
32 super( "Run from here", "Runs the TestCase starting at this step" );
33 }
34
35 public void perform( WsdlTestStep testStep, Object param )
36 {
37 StringToObjectMap properties = recoverContextProperties( testStep );
38 properties.put( TestCaseRunContext.INTERACTIVE, Boolean.TRUE );
39
40
41 WsdlTestCaseRunner testCaseRunner = new WsdlTestCaseRunner( testStep.getTestCase(), properties );
42 testCaseRunner.setStartStep( testStep.getTestCase().getIndexOfTestStep( testStep ) );
43 testCaseRunner.start( true );
44 }
45
46
47
48 private StringToObjectMap recoverContextProperties( WsdlTestStep testStep )
49 {
50 StringToObjectMap properties = null;
51 try
52 {
53 if( testStep.getParent() instanceof WsdlTestCase )
54 {
55 properties = ( ( WsdlTestCase )testStep.getParent() ).getRunFromHereContext();
56 }
57 else
58 {
59 properties = new StringToObjectMap();
60 }
61 }
62 catch( Exception e )
63 {
64 properties = new StringToObjectMap();
65 }
66 return properties;
67 }
68 }