Package com.eviware.soapui.config

Examples of com.eviware.soapui.config.TestCaseConfig


       *
       * Here needs to be done for all test cases separatly.
       */
      for( int cnt2 = 0; cnt2 < config.getTestCaseList().size(); cnt2++ )
      {
        TestCaseConfig newTestCase = config.getTestCaseList().get( cnt2 );
        TestCaseConfig importTestCaseConfig = newTestSuiteConfig.getTestSuite().getTestCaseList().get( cnt2 );
        LinkedHashMap<String, String> oldNewIds = new LinkedHashMap<String, String>();
        for( int cnt = 0; cnt < importTestCaseConfig.getTestStepList().size(); cnt++ )
          oldNewIds.put( importTestCaseConfig.getTestStepList().get( cnt ).getId(), newTestCase.getTestStepList()
              .get( cnt ).getId() );

        for( SecurityTestConfig scan : newTestCase.getSecurityTestList() )
          for( TestStepSecurityTestConfig secStepConfig : scan.getTestStepSecurityTestList() )
            if( oldNewIds.containsKey( secStepConfig.getTestStepId() ) )
View Full Code Here


    testSteps.remove( ix );
    testSteps.add( ix + offset, step );

    TestStepConfig[] configs = new TestStepConfig[testSteps.size()];

    TestCaseConfig conf = getConfig();
    for( int c = 0; c < testSteps.size(); c++ )
    {
      if( offset > 0 )
      {
        if( c < ix )
          configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
        else if( c < ( ix + offset ) )
          configs[c] = ( TestStepConfig )conf.getTestStepArray( c + 1 ).copy();
        else if( c == ix + offset )
          configs[c] = ( TestStepConfig )conf.getTestStepArray( ix ).copy();
        else
          configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
      }
      else
      {
        if( c < ix + offset )
          configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
        else if( c == ix + offset )
          configs[c] = ( TestStepConfig )conf.getTestStepArray( ix ).copy();
        else if( c <= ix )
          configs[c] = ( TestStepConfig )conf.getTestStepArray( c - 1 ).copy();
        else
          configs[c] = ( TestStepConfig )conf.getTestStepArray( c ).copy();
      }
    }

    conf.setTestStepArray( configs );
    for( int c = 0; c < configs.length; c++ )
    {
      ( testSteps.get( c ) ).resetConfigOnMove( conf.getTestStepArray( c ) );
    }

    ( getTestSuite() ).fireTestStepMoved( step, ix, offset );
  }
View Full Code Here

public class MoveXmlTestCase extends TestCase
{
  public void testMoveXml() throws Exception
  {
    TestCaseConfig testCase = TestCaseConfig.Factory.newInstance();
    TestStepConfig step1 = testCase.addNewTestStep();
    TestStepConfig step2 = testCase.addNewTestStep();
    TestStepConfig step3 = testCase.addNewTestStep();

    List<TestStepConfig> testSteps = testCase.getTestStepList();
    assertEquals( 3, testSteps.size() );
    assertEquals( testSteps.get( 0 ), step1 );
    assertEquals( testSteps.get( 1 ), step2 );
    assertEquals( testSteps.get( 2 ), step3 );
View Full Code Here

  }

  public WsdlTestCase cloneTestCase( WsdlTestCase testCase, String name )
  {
    testCase.beforeSave();
    TestCaseConfig newTestCase = getConfig().addNewTestCase();
    newTestCase.set( testCase.getConfig() );
    newTestCase.setName( name );
    WsdlTestCase newWsdlTestCase = buildTestCase( newTestCase, false );
    ModelSupport.unsetIds( newWsdlTestCase );
    newWsdlTestCase.afterLoad();

    testCases.add( newWsdlTestCase );
View Full Code Here

    testCase.beforeSave();

    if( index >= testCases.size() )
      index = -1;

    TestCaseConfig testCaseConfig = index == -1 ? ( TestCaseConfig )getConfig().addNewTestCase().set(
        testCase.getConfig().copy() ) : ( TestCaseConfig )getConfig().insertNewTestCase( index ).set(
        testCase.getConfig().copy() );
    testCaseConfig.setName( name );

    if( !includeLoadTests )
      testCaseConfig.setLoadTestArray( new LoadTestConfig[0] );

    if( createCopy )
      testCaseConfig.setSecurityTestArray( new SecurityTestConfig[0] );

    WsdlTestCase oldTestCase = testCase;
    testCase = buildTestCase( testCaseConfig, false );

    if( createCopy )
View Full Code Here

    {
      testCase.release();
      getConfig().removeTestCase( ix );
    }

    TestCaseConfig newConfig = ( TestCaseConfig )getConfig().insertNewTestCase( ix ).set( newTestCase ).changeType(
        TestCaseConfig.type );
    testCase = buildTestCase( newConfig, false );
    testCases.add( ix, testCase );
    testCase.afterLoad();
    fireTestCaseAdded( testCase );
View Full Code Here

    resolveImportedTestCase( testCase );
  }

  public void importTestCase( File file )
  {
    TestCaseConfig importTestCaseConfig = null;

    if( !file.exists() )
    {
      UISupport.showErrorMessage( "Error loading test case " );
      return;
    }

    try
    {
      importTestCaseConfig = TestCaseDocumentConfig.Factory.parse( file ).getTestCase();
    }
    catch( Exception e )
    {
      SoapUI.logError( e );
    }

    if( importTestCaseConfig != null )
    {
      TestCaseConfig newConfig = ( TestCaseConfig )getConfig().addNewTestCase().set( importTestCaseConfig )
          .changeType( TestCaseConfig.type );
      WsdlTestCase newTestCase = buildTestCase( newConfig, false );
      ModelSupport.unsetIds( newTestCase );

      /*
 
View Full Code Here

    // clone config and remove and loadtests
    testCase.beforeSave();

    try
    {
      TestCaseConfig config = TestCaseConfig.Factory.parse( testCase.getConfig().xmlText() );
      config.setLoadTestArray( new LoadTestConfig[0] );

      // clone entire testCase
      WsdlTestCase wsdlTestCase = testCase.getTestSuite().buildTestCase( config, true );
      wsdlTestCase.afterLoad();
      return wsdlTestCase;
View Full Code Here

   */

  private synchronized WsdlTestCase createTestCase()
  {
    WsdlTestCase testCase = loadTest.getTestCase();
    TestCaseConfig config = null;

    if( blueprintConfig == null )
    {
      try
      {
View Full Code Here

public class MoveXmlTest {

    @Test
    public void movesXmlCorrectly() throws Exception {
        TestCaseConfig testCase = TestCaseConfig.Factory.newInstance();
        TestStepConfig step1 = testCase.addNewTestStep();
        TestStepConfig step2 = testCase.addNewTestStep();
        TestStepConfig step3 = testCase.addNewTestStep();

        List<TestStepConfig> testSteps = testCase.getTestStepList();
        assertEquals(3, testSteps.size());
        assertEquals(testSteps.get(0), step1);
        assertEquals(testSteps.get(1), step2);
        assertEquals(testSteps.get(2), step3);
View Full Code Here

TOP

Related Classes of com.eviware.soapui.config.TestCaseConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.