    1   /*
    2    *  soapUI, copyright (C) 2004-2007 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.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  	//	assertEquals( testSteps.get( 1 ), step3 );
    49  		assertEquals( testSteps.get( 2 ), step2 );
    50  	}
    51  }