Package com.eviware.soapui.model.testsuite

Examples of com.eviware.soapui.model.testsuite.TestStep


    }
  }

  public void afterStep( TestCaseRunner testRunner, TestCaseRunContext runContext, TestStepResult result )
  {
    TestStep currentStep = result.getTestStep();
    TestCase testCase = currentStep.getTestCase();

    if( result.getStatus() == TestStepStatus.FAILED )
    {
      if( maxErrors > 0 )
      {
View Full Code Here


    this.startStep = startStep;
  }

  public void onCancel( String reason )
  {
    TestStep currentStep = getRunContext().getCurrentStep();
    if( currentStep != null )
      currentStep.cancel();
  }
View Full Code Here

      currentStep.cancel();
  }

  public void onFail( String reason )
  {
    TestStep currentStep = getRunContext().getCurrentStep();
    if( currentStep != null )
      currentStep.cancel();
  }
View Full Code Here

    }
  }

  public void gotoStepByName( String stepName )
  {
    TestStep testStep = getTestCase().getTestStepByName( stepName );
    if( testStep != null )
      gotoStep( getTestCase().getIndexOfTestStep( testStep ) );
  }
View Full Code Here

    return getProperty( name, testStep, testStep == null ? null : ( WsdlTestCase )testStep.getTestCase() );
  }

  public Object getProperty( String testStepName, String propertyName )
  {
    TestStep ts = testStep == null ? null : testStep.getTestCase().getTestStepByName( testStepName );
    return ts == null ? null : ts.getPropertyValue( propertyName );
  }
View Full Code Here

  {
  }

  public void beforeStep( TestCaseRunner testRunner, TestCaseRunContext runContext, TestStep testStep )
  {
    TestStep currentStep = testStep;
    WsdlTestCase testCase = ( WsdlTestCase )runContext.getTestCase();
    if( currentStep instanceof WsdlTestRequestStep && testCase.getWsrmEnabled() )
    {
      if( wsrmMap == null )
      {
View Full Code Here

    while( popup.getComponentCount() > 1 )
      popup.remove( 1 );

    if( row < statisticsTable.getRowCount() - 1 )
    {
      TestStep testStep = loadTest.getStatisticsModel().getTestStepAtRow( row );
      ActionSupport.addActions( ActionListBuilder.buildActions( testStep ), popup );
    }

    popup.setLocation( ( int )( statisticsTable.getLocationOnScreen().getX() + e.getPoint().getX() ),
        ( int )( statisticsTable.getLocationOnScreen().getY() + e.getPoint().getY() ) );
View Full Code Here

  private String getScopedProperty( PropertyExpansionContext context, String pe, boolean globalOverride )
  {
    ModelItem modelItem = context.getModelItem();

    TestStep testStep = null;
    TestCase testCase = null;
    TestSuite testSuite = null;
    Project 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 WsdlLoadTest )
    {
      testCase = ( ( WsdlLoadTest )modelItem ).getTestCase();
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlTestSuite )
    {
      testSuite = ( WsdlTestSuite )modelItem;
      project = testSuite.getProject();
    }
    else if( modelItem instanceof WsdlInterface )
    {
      project = ( ( WsdlInterface )modelItem ).getProject();
    }
    else if( modelItem instanceof WsdlProject )
    {
      project = ( WsdlProject )modelItem;
    }
    else if( modelItem instanceof WsdlMockService )
    {
      mockService = ( WsdlMockService )modelItem;
      project = mockService.getProject();
    }
    else if( modelItem instanceof TestRequest )
    {
      testStep = ( ( TestRequest )modelItem ).getTestStep();
      testCase = testStep.getTestCase();
      testSuite = testCase.getTestSuite();
      project = testSuite.getProject();
    }
    else if( modelItem instanceof AbstractHttpRequestInterface<?> )
    {
View Full Code Here

  }

  public void afterStep( TestCaseRunner testRunner, TestCaseRunContext runContext, TestStepResult result )
  {
    super.afterStep( testRunner, runContext, result );
    TestStep currentStep = runContext.getCurrentStep();

    if( currentStep instanceof Assertable )
    {
      Assertable requestStep = ( Assertable )currentStep;
      for( int c = 0; c < requestStep.getAssertionCount(); c++ )
      {
        TestAssertion assertion = requestStep.getAssertionAt( c );
        log.info( "Assertion [" + assertion.getName() + "] has status " + assertion.getStatus() );
        if( assertion.getStatus() == AssertionStatus.FAILED )
        {
          for( AssertionError error : assertion.getErrors() )
            log.error( "ASSERTION FAILED -> " + error.getMessage() );

          assertions.add( assertion );
          assertionResults.put( assertion, ( WsdlTestStepResult )result );
        }

        testAssertionCount++ ;
      }
    }

    String countPropertyName = currentStep.getName() + " run count";
    Long count = ( Long )runContext.getProperty( countPropertyName );
    if( count == null )
    {
      count = new Long( 0 );
    }

    runContext.setProperty( countPropertyName, new Long( count.longValue() + 1 ) );

    if( result.getStatus() == TestStepStatus.FAILED || exportAll )
    {
      try
      {
        String exportSeparator = System.getProperty( SOAPUI_EXPORT_SEPARATOR, "-" );

        TestCase tc = currentStep.getTestCase();
        String nameBase = StringUtils.createFileName( tc.getTestSuite().getName(), '_' ) + exportSeparator
            + StringUtils.createFileName( tc.getName(), '_' ) + exportSeparator
            + StringUtils.createFileName( currentStep.getName(), '_' ) + "-" + count.longValue() + "-"
            + result.getStatus();

        WsdlTestCaseRunner callingTestCaseRunner = ( WsdlTestCaseRunner )runContext
            .getProperty( "#CallingTestCaseRunner#" );

        if( callingTestCaseRunner != null )
        {
          WsdlTestCase ctc = callingTestCaseRunner.getTestCase();
          WsdlRunTestCaseTestStep runTestCaseTestStep = ( WsdlRunTestCaseTestStep )runContext
              .getProperty( "#CallingRunTestCaseStep#" );

          nameBase = StringUtils.createFileName( ctc.getTestSuite().getName(), '_' ) + exportSeparator
              + StringUtils.createFileName( ctc.getName(), '_' ) + exportSeparator
              + StringUtils.createFileName( runTestCaseTestStep.getName(), '_' ) + exportSeparator
              + StringUtils.createFileName( tc.getTestSuite().getName(), '_' ) + exportSeparator
              + StringUtils.createFileName( tc.getName(), '_' ) + exportSeparator
              + StringUtils.createFileName( currentStep.getName(), '_' ) + "-" + count.longValue() + "-"
              + result.getStatus();
        }

        String absoluteOutputFolder = getAbsoluteOutputFolder( ModelSupport.getModelItemProject( tc ) );
        String fileName = absoluteOutputFolder + File.separator + nameBase + ".txt";

        if( result.getStatus() == TestStepStatus.FAILED )
          log.error( currentStep.getName() + " failed, exporting to [" + fileName + "]" );

        new File( fileName ).getParentFile().mkdirs();

        PrintWriter writer = new PrintWriter( fileName );
        result.writeTo( writer );
View Full Code Here

    {
      int ix = name.indexOf( PROPERTY_SEPARATOR );
      if( ix > 0 )
      {
        String teststepname = name.substring( 0, ix );
        TestStep refTestStep = testCase.getTestStepByName( teststepname );
        if( refTestStep != null )
        {
          TestProperty property = refTestStep.getProperty( name.substring( ix + 1 ) );
          return property == null ? null : property.getValue();
        }
      }

      if( testCase.getSearchProperties() )
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.testsuite.TestStep

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.