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.testcase.WsdlTestCase;
16  import com.eviware.soapui.impl.wsdl.teststeps.WsdlRunTestCaseTestStep;
17  import com.eviware.soapui.support.resolver.ResolveContext.Resolver;
18  
19  public class CreateNewEmptyTestCase implements Resolver
20  {
21  
22  	private boolean resolved;
23  	private WsdlRunTestCaseTestStep testStep;
24  
25  	public CreateNewEmptyTestCase( WsdlRunTestCaseTestStep wsdlRunTestCaseTestStep )
26  	{
27  		testStep = wsdlRunTestCaseTestStep;
28  	}
29  
30  	public String getDescription()
31  	{
32  		return "Create new empty test case";
33  	}
34  
35  	@Override
36  	public String toString()
37  	{
38  		return getDescription();
39  	}
40  
41  	public String getResolvedPath()
42  	{
43  		return null;
44  	}
45  
46  	public boolean isResolved()
47  	{
48  		return resolved;
49  	}
50  
51  	public boolean resolve()
52  	{
53  		WsdlTestCase tCase = testStep.getTestCase().getTestSuite().addNewTestCase( "New Test Case" );
54  		testStep.setTargetTestCase( tCase );
55  		resolved = true;
56  		return resolved;
57  	}
58  
59  }