01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * 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.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: public void testMoveXml() throws Exception {
26: TestCaseConfig testCase = TestCaseConfig.Factory.newInstance();
27: TestStepConfig step1 = testCase.addNewTestStep();
28: TestStepConfig step2 = testCase.addNewTestStep();
29: TestStepConfig step3 = testCase.addNewTestStep();
30:
31: List<TestStepConfig> testSteps = testCase.getTestStepList();
32: assertEquals(3, testSteps.size());
33: assertEquals(testSteps.get(0), step1);
34: assertEquals(testSteps.get(1), step2);
35: assertEquals(testSteps.get(2), step3);
36:
37: XmlCursor cursor1 = step3.newCursor();
38: XmlCursor cursor2 = step2.newCursor();
39:
40: cursor1.moveXml(cursor2);
41:
42: cursor1.dispose();
43: cursor2.dispose();
44:
45: assertEquals(testSteps.get(0), step1);
46: // assertEquals( testSteps.get( 1 ), step3 );
47: assertEquals(testSteps.get(2), step2);
48: }
49: }
|