1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl;
14
15 import java.util.List;
16
17 import junit.framework.TestCase;
18
19 import org.apache.xmlbeans.XmlCursor;
20
21 import com.eviware.soapui.config.TestCaseConfig;
22 import com.eviware.soapui.config.TestStepConfig;
23
24 public class MoveXmlTestCase extends TestCase
25 {
26 public void testMoveXml() throws Exception
27 {
28 TestCaseConfig testCase = TestCaseConfig.Factory.newInstance();
29 TestStepConfig step1 = testCase.addNewTestStep();
30 TestStepConfig step2 = testCase.addNewTestStep();
31 TestStepConfig step3 = testCase.addNewTestStep();
32
33 List<TestStepConfig> testSteps = testCase.getTestStepList();
34 assertEquals( 3, testSteps.size() );
35 assertEquals( testSteps.get( 0 ), step1 );
36 assertEquals( testSteps.get( 1 ), step2 );
37 assertEquals( testSteps.get( 2 ), step3 );
38
39 XmlCursor cursor1 = step3.newCursor();
40 XmlCursor cursor2 = step2.newCursor();
41
42 cursor1.moveXml( cursor2 );
43
44 cursor1.dispose();
45 cursor2.dispose();
46
47 assertEquals( testSteps.get( 0 ), step1 );
48
49 assertEquals( testSteps.get( 2 ), step2 );
50 }
51 }