Package com.eviware.soapui.config

Examples of com.eviware.soapui.config.TestSuiteDocumentConfig


    {
      UISupport.showErrorMessage( "Error loading test case " );
      return;
    }

    TestSuiteDocumentConfig newTestSuiteConfig = null;

    try
    {
      newTestSuiteConfig = TestSuiteDocumentConfig.Factory.parse( file );
    }
    catch( Exception e )
    {
      SoapUI.logError( e );
    }

    if( newTestSuiteConfig == null )
    {
      UISupport.showErrorMessage( "Not valild test case xml" );
    }
    else
    {
      TestSuiteConfig config = ( TestSuiteConfig )projectDocument.getSoapuiProject().addNewTestSuite()
          .set( newTestSuiteConfig.getTestSuite() );
      WsdlTestSuite testSuite = buildTestSuite( config );

      ModelSupport.unsetIds( testSuite );
      testSuite.afterLoad();

      /*
       * security test keeps reference to test step by id, which gets changed
       * during importing, so old values needs to be rewritten to new ones.
       *
       * Create tarnsition table ( old id , new id ) and use it to replace
       * all old ids in new imported test case.
       *
       * 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() );

View Full Code Here


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

        TestSuiteDocumentConfig newTestSuiteConfig = null;

        try {
            newTestSuiteConfig = TestSuiteDocumentConfig.Factory.parse(file);
        } catch (Exception e) {
            SoapUI.logError(e);
        }

        if (newTestSuiteConfig == null) {
            UISupport.showErrorMessage("Not valid test case xml");
        } else {
            TestSuiteConfig config = (TestSuiteConfig) projectDocument.getSoapuiProject().addNewTestSuite()
                    .set(newTestSuiteConfig.getTestSuite());
            WsdlTestSuite testSuite = buildTestSuite(config);

            ModelSupport.createNewIds(testSuite);
            testSuite.afterLoad();

      /*
             * security test keeps reference to test step by id, which gets changed
       * during importing, so old values needs to be rewritten to new ones.
       *
       * Create tarnsition table ( old id , new id ) and use it to replace
       * all old ids in new imported test case.
       *
       * 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());
                }
View Full Code Here

TOP

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

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.