Package com.eviware.soapui.impl.wsdl.testcase

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase


  }

  private void generateSingleTestCase( WsdlTestSuite testSuite, RestService service, boolean createLoadTest,
      List<String> resources )
  {
    WsdlTestCase testCase = testSuite.addNewTestCase( service.getName() + " TestSuite" );

    for( RestResource resource : service.getAllResources() )
    {
      if( !resources.contains( resource.getName() + ": " + resource.getFullPath( false ) ) )
        continue;

      if( resource.getRequestCount() > 0 )
      {
        for( int x = 0; x < resource.getRequestCount(); x++ )
        {
          testCase.addTestStep( RestRequestStepFactory.createConfig( resource.getRequestAt( x ),
              resource.getName() ) );
        }
      }
    }

    if( createLoadTest )
    {
      testCase.addNewLoadTest( "LoadTest 1" );
    }
  }
View Full Code Here


  public void perform( RestRequest request, Object param )
  {
    WsdlProject project = request.getOperation().getInterface().getProject();

    WsdlTestCase testCase = getTargetTestCase( project );
    if( testCase != null )
      addRequest( testCase, request, -1 );
  }
View Full Code Here

    for( RestResource resource : service.getAllResources() )
    {
      if( !resources.contains( resource.getName() + ": " + resource.getFullPath( false ) ) )
        continue;

      WsdlTestCase testCase = testSuite.addNewTestCase( resource.getName() + " TestCase" );
      testCase.setDescription( "TestCase generated for REST Resource [" + resource.getName() + "] located at ["
          + resource.getFullPath( false ) + "]" );

      if( resource.getRequestCount() > 0 )
      {
        for( int x = 0; x < resource.getRequestCount(); x++ )
        {
          RestRequest request = resource.getRequestAt( x );
          testCase.addTestStep( RestRequestStepFactory.createConfig( request, request.getName() ) );
        }
      }

      if( createLoadTest )
      {
        testCase.addNewLoadTest( "LoadTest 1" );
      }
    }
  }
View Full Code Here

      name = UISupport.prompt( "Specify unique name of TestCase", "Rename TestCase", name );
      if( StringUtils.isNullOrEmpty( name ) )
        return;
    }

    WsdlTestCase testCase = testSuite.addNewTestCase( name );
    UISupport.showDesktopPanel( testCase );
  }
View Full Code Here

  protected WsdlTestCase getTargetTestCase( WsdlProject project )
  {
    List<WsdlTestCase> testCases = new ArrayList<WsdlTestCase>();
    List<WsdlTestSuite> testSuites = new ArrayList<WsdlTestSuite>();
    List<String> testCaseNames = new ArrayList<String>();
    WsdlTestCase testCase = null;

    if( project.getTestSuiteCount() == 0 )
    {
      return addNewTestSuiteAndTestCase( project );
    }

    for( int c = 0; c < project.getTestSuiteCount(); c++ )
    {
      WsdlTestSuite testSuite = ( WsdlTestSuite )project.getTestSuiteAt( c );
      for( int i = 0; i < testSuite.getTestCaseCount(); i++ )
      {
        testCase = ( WsdlTestCase )testSuite.getTestCaseAt( i );

        testCases.add( testCase );
        testCaseNames.add( ( testCaseNames.size() + 1 ) + ": " + testSuite.getName() + " - " + testCase.getName() );
        testSuites.add( testSuite );
      }

      testCases.add( null );
      testSuites.add( testSuite );
View Full Code Here

    super( "Add as MockResponse Step", "Creates a MockResponseStep from this Request" );
  }

  public void perform( WsdlRequest request, Object param )
  {
    WsdlTestCase testCase = getTargetTestCase( request.getOperation().getInterface().getProject() );
    if( testCase != null )
      addMockResponse( testCase, request );
  }
View Full Code Here

    {
      targetTestCase.getTestSuite().removeTestSuiteListener( testSuiteListener );
      targetTestCase.removeTestPropertyListener( testPropertyListener );
    }

    WsdlTestCase oldTestCase = this.targetTestCase;
    this.targetTestCase = testCase;

    if( testCase != null )
    {
      stepConfig.setTargetTestCase( testCase.getId() );
View Full Code Here

    {
      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;
    }
    catch( Throwable e )
    {
      SoapUI.logError( e );
View Full Code Here

   * and configured for LoadTesting
   */

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

    if( blueprintConfig == null )
    {
      try
      {
        blueprintConfig = TestCaseConfig.Factory.parse( testCase.getConfig().xmlText() );
        blueprintConfig.setLoadTestArray( new LoadTestConfig[0] );
        blueprintConfig.setSecurityTestArray( new SecurityTestConfig[0] );
      }
      catch( XmlException e )
      {
        e.printStackTrace();
      }
    }

    config = ( TestCaseConfig )blueprintConfig.copy();

    // clone entire testCase
    WsdlTestCase tc = testCase.getTestSuite().buildTestCase( config, true );
    tc.afterLoad();
    tc.addTestRunListener( testRunListener );
    Settings settings = tc.getSettings();
    settings.setBoolean( HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN,
        loadTest.getSettings().getBoolean( HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN ) );
    settings.setBoolean( HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN,
        loadTest.getSettings().getBoolean( HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN ) );
    settings.setBoolean( HttpSettings.CLOSE_CONNECTIONS,
        loadTest.getSettings().getBoolean( HttpSettings.CLOSE_CONNECTIONS ) );

    // disable default pretty-printing since it takes time
    settings.setBoolean( WsdlSettings.PRETTY_PRINT_RESPONSE_MESSAGES, false );

    // don't discard.. the WsdlLoadTests internal listener will discard after
    // asserting..
    tc.setDiscardOkResults( false );
    tc.setMaxResults( 0 );
    return tc;
  }
View Full Code Here

    testRunListener = new InternalTestRunListener();
    testSuiteListener = new InternalTestSuiteListener();
    propertyChangeListener = new InternalPropertyChangeListener();

    WsdlTestCase testCase = loadTest.getTestCase();
    loadTest.addPropertyChangeListener( propertyChangeListener );
    loadTest.addLoadTestRunListener( testRunListener );
    testCase.getTestSuite().addTestSuiteListener( testSuiteListener );

    for( TestStep testStep : testCase.getTestStepList() )
    {
      testStep.addPropertyChangeListener( propertyChangeListener );
    }

    history = new StatisticsHistory( this );
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

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.