View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2010 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.registry;
14  
15  import com.eviware.soapui.config.ManualTestStepConfig;
16  import com.eviware.soapui.config.TestStepConfig;
17  import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
18  import com.eviware.soapui.impl.wsdl.teststeps.ManualTestStep;
19  import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep;
20  
21  public class ManualTestStepFactory extends WsdlTestStepFactory
22  {
23  	public static final String MANUAL_TEST_STEP = "manualTestStep";
24  
25  	public ManualTestStepFactory()
26  	{
27  		super( MANUAL_TEST_STEP, "Manual TestStep", "Submits a Manual TestStep", "/manualteststep.gif" );
28  	}
29  
30  	public WsdlTestStep buildTestStep( WsdlTestCase testCase, TestStepConfig config, boolean forLoadTest )
31  	{
32  		return new ManualTestStep( testCase, config, forLoadTest );
33  	}
34  
35  	public TestStepConfig createNewTestStep( WsdlTestCase testCase, String name )
36  	{
37  		TestStepConfig testStepConfig = TestStepConfig.Factory.newInstance();
38  		testStepConfig.setType( MANUAL_TEST_STEP );
39  		testStepConfig.setName( name );
40  		return testStepConfig;
41  	}
42  
43  	public boolean canCreate()
44  	{
45  		return true;
46  	}
47  
48  	public TestStepConfig createConfig( String stepName )
49  	{
50  		ManualTestStepConfig testRequestConfig = ManualTestStepConfig.Factory.newInstance();
51  
52  		TestStepConfig testStep = TestStepConfig.Factory.newInstance();
53  		testStep.setType( MANUAL_TEST_STEP );
54  		testStep.setConfig( testRequestConfig );
55  		testStep.setName( stepName );
56  		return testStep;
57  	}
58  }