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

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


    {
      String compositeLoadTestName = loadTests[0];
      String[] names = compositeLoadTestName.split( " - " );
      String testCaseName = names[0];
      String loadTestName = names[1];
      WsdlTestCase testCase = testSuite.getTestCaseByName( testCaseName );
      HashMap<String, Object> firstSamplerSettings = new HashMap<String, Object>();
      // String loadUITestCaseAddedTo = "";
      String loadUIProjectAddedTo = "";
      if( testCase != null )
      {
        WsdlLoadTest loadTest = ( WsdlLoadTest )testCase.getLoadTestByName( loadTestName );
        if( loadTest != null )
        {
          firstSamplerSettings = exportLoadTestToLoadUI( loadTest, loadUIProject, CREATE_NEW_OPTION,
              CREATE_NEW_OPTION );
          // loadUITestCaseAddedTo = ( String )firstSamplerSettings.get(
          // ContextMapping.LOADUI_TEST_CASE_NAME );
          loadUIProjectAddedTo = ( String )firstSamplerSettings.get( ContextMapping.LOADUI_PROJECT_NAME );
        }

      }

      for( int i = 1; i < loadTests.length; i++ )
      {
        compositeLoadTestName = loadTests[i];
        loadTestName = loadTests[i];
        WsdlLoadTest loadTest = ( WsdlLoadTest )testCase.getLoadTestByName( loadTestName );
        testCaseName = names[0];
        loadTestName = names[1];
        testCase = testSuite.getTestCaseByName( testCaseName );
        if( testCase != null )
        {
          loadTest = ( WsdlLoadTest )testCase.getLoadTestByName( loadTestName );
          if( loadTest != null )
          {
            exportLoadTestToLoadUI( loadTest, loadUIProjectAddedTo, CREATE_NEW_OPTION, CREATE_NEW_OPTION );
          }
View Full Code Here


      currentStep.cancel();
  }

  public void internalRun( T2 runContext ) throws Exception
  {
    WsdlTestCase testCase = getTestCase();

    gotoStepIndex = -1;
    testStepResults.clear();

    // create state for testcase if specified
    if( testCase.getKeepSession() )
    {
      runContext.setProperty( SubmitContext.HTTP_STATE_PROPERTY, new HttpState() );
    }

    fillInTestRunnableListeners();
    runSetupScripts( runContext );
    if( !isRunning() )
      return;

    if( testCase.getTimeout() > 0 )
    {
      startTimeoutTimer( testCase.getTimeout() );
    }

    notifyBeforeRun();
    if( !isRunning() )
      return;

    initCount = getStartStep();

    setStartTime();
    for( ; initCount < testCase.getTestStepCount() && isRunning(); initCount++ )
    {
      WsdlTestStep testStep = testCase.getTestStepAt( initCount );
      if( testStep.isDisabled() )
        continue;

      try
      {
        testStep.prepare( this, runContext );
      }
      catch( Exception e )
      {
        setStatus( Status.FAILED );
        SoapUI.logError( e );
        throw new Exception( "Failed to prepare testStep [" + testStep.getName() + "]; " + e.toString() );
      }
    }

    int currentStepIndex = startStep;
    runContext.setCurrentStep( currentStepIndex );

    for( ; isRunning() && currentStepIndex < testCase.getTestStepCount(); currentStepIndex++ )
    {
      if( ( currentStepIndex = runCurrentTestStep( runContext, currentStepIndex ) ) == -2 )
      {
        return;
      }
View Full Code Here

   */
  protected abstract int runCurrentTestStep( T2 runContext, int currentStepIndex ) throws Exception;

  protected void internalFinally( T2 runContext )
  {
    WsdlTestCase testCase = getTestCase();

    for( int c = 0; c < initCount && c < testCase.getTestStepCount(); c++ )
    {
      WsdlTestStep testStep = testCase.getTestStepAt( c );
      if( !testStep.isDisabled() )
        testStep.finish( this, runContext );
    }

    try
View Full Code Here

  {
    if( testRunner.getTestCase() instanceof WsdlTestCase )
    {
      try
      {
        WsdlTestCase wsdlTestCase = ( WsdlTestCase )testRunner.getTestCase();

        if( wsdlTestCase.getConfig().getAmfAuthorisation() )
        {
          if( noAMFTestSteps( wsdlTestCase ) )
            return;

          String endpoint = runContext.expand( wsdlTestCase.getConfig().getAmfEndpoint() );
          String username = runContext.expand( wsdlTestCase.getConfig().getAmfLogin() );
          String password = runContext.expand( wsdlTestCase.getConfig().getAmfPassword() );

          SoapUIAMFConnection amfConnection = null;

          if( StringUtils.hasContent( endpoint ) )
          {
View Full Code Here

  {
    // create transfer menus
    targetMenu.removeAll();

    WsdlTestStep testStep = null;
    WsdlTestCase testCase = null;
    WsdlTestSuite testSuite = null;
    WsdlProject project = null;
    WsdlMockService mockService = null;
    WsdlMockResponse mockResponse = null;
    SecurityTest securityTest = null;

    if( modelItem instanceof WsdlTestStep )
    {
      testStep = ( WsdlTestStep )modelItem;
      testCase = testStep.getTestCase();
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlTestCase )
    {
      testCase = ( WsdlTestCase )modelItem;
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlTestSuite )
    {
      testSuite = ( WsdlTestSuite )modelItem;
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlMockService )
    {
      project = ( ( WsdlMockService )modelItem ).getProject();
    }
    else if( modelItem instanceof WsdlMockResponse )
    {
      mockResponse = ( WsdlMockResponse )modelItem;
      mockService = ( mockResponse ).getMockOperation().getMockService();
      project = mockService.getProject();
    }
    else if( modelItem instanceof WsdlProject )
    {
      project = ( WsdlProject )modelItem;
    }
    else if( modelItem instanceof AbstractHttpRequestInterface<?> )
    {
      project = ( ( AbstractHttpRequest<?> )modelItem ).getOperation().getInterface().getProject();
    }
    else if( modelItem instanceof Operation )
    {
      project = ( WsdlProject )( ( Operation )modelItem ).getInterface().getProject();
    }
    else if( modelItem instanceof SecurityTest )
    {
      securityTest = ( SecurityTest )modelItem;
      testCase = securityTest.getTestCase();
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }

    TestPropertyHolder globalProperties = PropertyExpansionUtils.getGlobalProperties();
    if( globalProperties.getProperties().size() > 0 )
      targetMenu.add( createPropertyMenu( "Global", globalProperties ) );

    if( project != null )
      targetMenu.add( createPropertyMenu( "Project: [" + project.getName() + "]", project ) );

    if( testSuite != null )
      targetMenu.add( createPropertyMenu( "TestSuite: [" + testSuite.getName() + "]", testSuite ) );

    if( mockService != null )
      targetMenu.add( createPropertyMenu( "MockService: [" + mockService.getName() + "]", mockService ) );

    if( mockResponse != null )
      targetMenu.add( createPropertyMenu( "MockResponse: [" + mockResponse.getName() + "]", mockResponse ) );

    if( testCase != null )
    {
      targetMenu.add( createPropertyMenu( "TestCase: [" + testCase.getName() + "]", testCase ) );

      for( int c = 0; c < testCase.getTestStepCount(); c++ )
      {
        testStep = testCase.getTestStepAt( c );
        if( testStep.getPropertyNames().length == 0 )
          continue;

        if( targetMenu.getComponentCount() == 3 )
          targetMenu.add( new JSeparator() );
View Full Code Here

    super( modelItem );

    project = getModelItem().getTestCase().getTestSuite().getProject();

    getModelItem().addPropertyChangeListener( WsdlRunTestCaseTestStep.TARGET_TESTCASE, this );
    WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
    if( targetTestCase != null )
    {
      targetTestCase.addPropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
      targetTestCase.getTestSuite().addPropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
    }

    buildUI();
    setEnabledState();
View Full Code Here

    return propertiesTable;
  }

  private String createTitleForBorder()
  {
    WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
    return "TestCase ["
        + ( targetTestCase == null ? "- none selected -" : targetTestCase.getTestSuite().getName() + ":"
            + targetTestCase.getName() ) + "] Run Properties";
  }
View Full Code Here

  public boolean onClose( boolean canCancel )
  {
    getModelItem().removePropertyChangeListener( WsdlRunTestCaseTestStep.TARGET_TESTCASE, this );

    WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
    if( targetTestCase != null )
    {
      targetTestCase.removePropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
      targetTestCase.getTestSuite().removePropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
    }

    testRunLog.release();
    if( optionsDialog != null )
    {
View Full Code Here

  {
    super.propertyChange( evt );

    if( evt.getPropertyName().equals( WsdlRunTestCaseTestStep.TARGET_TESTCASE ) )
    {
      WsdlTestCase targetTestCase = ( WsdlTestCase )evt.getOldValue();
      if( targetTestCase != null )
      {
        targetTestCase.removePropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
        targetTestCase.getTestSuite().removePropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
      }

      targetTestCase = ( WsdlTestCase )evt.getNewValue();
      if( targetTestCase != null )
      {
        targetTestCase.addPropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
        targetTestCase.getTestSuite().addPropertyChangeListener( WsdlTestCase.NAME_PROPERTY, this );
      }
    }

    setEnabledState();
    titledBorder.setTitle( createTitleForBorder() );
View Full Code Here

    Set<Interface> requiredInterfaces = new HashSet<Interface>();

    for( int i = 0; i < testSuite.getTestCaseCount(); i++ )
    {
      WsdlTestCase testCase = testSuite.getTestCaseAt( i );

      for( int y = 0; y < testCase.getTestStepCount(); y++ )
      {
        WsdlTestStep testStep = testCase.getTestStepAt( y );
        requiredInterfaces.addAll( testStep.getRequiredInterfaces() );
      }
    }

    if( !DragAndDropSupport.importRequiredInterfaces( target, requiredInterfaces, title ) )
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.