View Javadoc

1   /*
2    * soapUI, copyright (C) 2004-2009 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.support.resolver;
14  
15  import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep;
16  import com.eviware.soapui.support.UISupport;
17  import com.eviware.soapui.support.resolver.ResolveContext.Resolver;
18  
19  public class RunTestCaseRemoveResolver implements Resolver
20  {
21  	private WsdlTestStep testStep;
22  	private boolean resolved;
23  
24  	public RunTestCaseRemoveResolver( WsdlTestStep testStep )
25  	{
26  		this.testStep = testStep;
27  	}
28  
29  	public void perform( WsdlTestStep target, Object param )
30  	{
31  		target.setDisabled( true );
32  	}
33  
34  	@Override
35  	public String toString()
36  	{
37  		return getDescription();
38  	}
39  
40  	public String getDescription()
41  	{
42  		return "Disable Run Test step";
43  	}
44  
45  	public String getResolvedPath()
46  	{
47  		// TODO Auto-generated method stub
48  		return null;
49  	}
50  
51  	public boolean isResolved()
52  	{
53  		return resolved;
54  	}
55  
56  	public boolean resolve()
57  	{
58  
59  		if( UISupport.confirm( "Are you sure to disable test step?", "Disable Test Step" ) && testStep != null )
60  		{
61  			testStep.setDisabled( true );
62  			resolved = true;
63  		}
64  		return resolved;
65  	}
66  }