1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.submit.filters;
14
15 import junit.framework.TestCase;
16
17 import com.eviware.soapui.impl.wsdl.WsdlSubmitContext;
18
19 public class PropertyExpansionTestCase extends TestCase
20 {
21 public void testExpansion() throws Exception
22 {
23 WsdlSubmitContext context = new WsdlSubmitContext( null );
24
25 context.setProperty( "test", "value" );
26
27 assertEquals( "value", PropertyExpansionRequestFilter.expandProperties( context, "${test}" ));
28 assertEquals( "value", PropertyExpansionRequestFilter.expandProperties( context, "${#test}" ));
29 assertEquals( " value ", PropertyExpansionRequestFilter.expandProperties( context, " ${test} " ));
30 assertEquals( "${testa}", PropertyExpansionRequestFilter.expandProperties( context, "${testa}" ));
31 assertEquals( "valuevalue", PropertyExpansionRequestFilter.expandProperties( context, "${test}${test}" ));
32 assertEquals( "${testvalue}", PropertyExpansionRequestFilter.expandProperties( context, "${test${test}}" ));
33 }
34
35 public void testXPathExpansion() throws Exception
36 {
37 WsdlSubmitContext context = new WsdlSubmitContext( null );
38
39 context.setProperty( "test", "<test><value>hello</value></test>" );
40 assertEquals( "hello", PropertyExpansionRequestFilter.expandProperties( context, "${#test#//value/text()}" ));
41 }
42 }