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.model.propertyexpansion.resolvers;
14
15 import com.eviware.soapui.model.propertyexpansion.PropertyExpansionContext;
16
17 public class TestRunPropertyResolver implements PropertyResolver
18 {
19 public String resolveProperty( PropertyExpansionContext context, String propertyName, boolean globalOverride )
20 {
21 // if( !(context instanceof TestRunContext ))
22 // return null;
23 //
24 // TestRunContext trc = ( TestRunContext ) context;
25 //
26 // TestCase testCase = trc.getTestCase();
27 // if( testCase == null )
28 // return null;
29 // TestSuite testSuite = testCase.getTestSuite();
30 //
31 // if( propertyName.charAt( 0 ) == PropertyExpansion.SCOPE_PREFIX )
32 // {
33 // // explicit item reference?
34 // String value = ResolverUtils.checkForExplicitReference( propertyName,
35 // PropertyExpansion.PROJECT_REFERENCE, testSuite.getProject(), trc,
36 // globalOverride );
37 // if( value != null )
38 // return value;
39 //
40 // value = ResolverUtils.checkForExplicitReference( propertyName,
41 // PropertyExpansion.TESTSUITE_REFERENCE, testSuite, trc, globalOverride
42 // );
43 // if( value != null )
44 // return value;
45 //
46 // value = ResolverUtils.checkForExplicitReference( propertyName,
47 // PropertyExpansion.TESTCASE_REFERENCE, testCase, trc, globalOverride );
48 // if( value != null )
49 // return value;
50 // }
51 //
52 // int sepIx = propertyName.indexOf( PropertyExpansion.PROPERTY_SEPARATOR
53 // );
54 // Object property = null;
55 //
56 // if( sepIx > 0 )
57 // {
58 // String step = propertyName.substring( 0, sepIx );
59 // String name = propertyName.substring( sepIx+1 );
60 //
61 // sepIx = name.indexOf( PropertyExpansion.PROPERTY_SEPARATOR );
62 // if( sepIx != -1 )
63 // {
64 // String xpath = name.substring( sepIx+1 );
65 // name = name.substring( 0, sepIx );
66 //
67 // if( step.length() == 0 )
68 // property = trc.getProperty( name);
69 // else
70 // property = trc.getProperty( step, name);
71 //
72 // if( property != null )
73 // {
74 // property = ResolverUtils.extractXPathPropertyValue( property,
75 // PropertyExpansionUtils.expandProperties( trc, xpath ) );
76 // }
77 // }
78 // else
79 // {
80 // if( step.length() == 0 )
81 // property = trc.getProperty( name);
82 // else
83 // property = trc.getProperty( step, name);
84 // }
85 // }
86 //
87 // return property == null ? null : property.toString();
88
89 return null;
90 }
91 }