1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl;
14
15 import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
16 import com.eviware.soapui.model.ModelItem;
17 import com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils;
18 import com.eviware.soapui.model.settings.Settings;
19 import com.eviware.soapui.model.support.AbstractSubmitContext;
20 import com.eviware.soapui.model.testsuite.TestStep;
21
22 /***
23 * Default implementation
24 */
25
26 public class WsdlSubmitContext extends AbstractSubmitContext
27 {
28 private final TestStep step;
29
30 public WsdlSubmitContext( ModelItem context )
31 {
32 super( context );
33 step = context instanceof TestStep ? ( TestStep ) context : null;
34 }
35
36 public Object getProperty(String name)
37 {
38 return getProperty( name, step, (WsdlTestCase) (step == null ? null : step.getTestCase()) );
39 }
40
41 @Override
42 public Object get( Object key )
43 {
44 if( "settings".equals(key))
45 return getSettings();
46
47 return getProperty( key.toString() );
48 }
49
50 @Override
51 public Object put( String key, Object value )
52 {
53 Object oldValue = get( key );
54 setProperty( key, value );
55 return oldValue;
56 }
57
58 public Settings getSettings()
59 {
60 return step == null ? step.getSettings() : null;
61 }
62
63 public String expand( String content )
64 {
65 return PropertyExpansionUtils.expandProperties( this, content );
66 }
67 }