Package br.eti.kinoshita.tap4j.model

Examples of br.eti.kinoshita.tap4j.model.TestResult


   
    for( TapResult tapLine : tapLines )
    {
      if ( tapLine instanceof TestResult )
      {
        TestResult testResult = (TestResult) tapLine ;
        pw.print( testResult.getStatus() );
        pw.print( testResult.getTestNumber() );
       
        if ( ! StringUtils.isEmpty( testResult.getDescription() ) )
        {
          pw.print(" " + testResult.getDescription());
        }
        if ( testResult.getDirective() != null )
        {
          pw.print(" " + testResult.getDirective().toString());
        }
        pw.println();
      }
      else
      {
View Full Code Here


   */
  @Override
  public void onTestSuccess(ITestResult tr)
  {
    counter+=1;
    TestResult testResult = new TestResult(StatusValues.OK, counter);
    testResult.setDescription( tr.getMethod().getMethodName() );
    this.tapProducer.addTestResult( testResult );
  }
View Full Code Here

   */
  @Override
  public void onTestFailure(ITestResult tr)
  {
    counter+=1;
    TestResult testResult = new TestResult(StatusValues.NOT_OK, counter);
       
    this.makeDiagnostic ( tr, testResult );
   
    this.tapProducer.addTestResult( testResult );
   
View Full Code Here

   */
  @Override
  public void onTestSkipped(ITestResult tr)
  {
    counter+=1;
    TestResult testResult = new TestResult(StatusValues.OK, counter);
    Directive skipDirective = new Directive(DirectiveValues.SKIP, "previous test failed or was skipped.");
    testResult.setDirective( skipDirective );
    this.tapProducer.addTestResult( testResult );
  }
View Full Code Here

  /* (non-Javadoc)
   * @see br.eti.kinoshita.tap4j.TapConsumer#getTestResult(java.lang.Integer)
   */
  public TestResult getTestResult( Integer testNumber )
  {
    TestResult foundTestResult = null;
   
    for( TestResult testResult : this.testResults )
    {
      if ( testResult.getTestNumber() != null && testResult.getTestNumber().equals(testNumber) )
      {
View Full Code Here

  /**
   * @param matcher REGEX Matcher.
   */
  protected void extractTestResult( Matcher matcher )
  {
    TestResult testResult = null;
   
    final String okOrNotOk = matcher.group(1);
    StatusValues status = null;
    if ( okOrNotOk.trim().equals("ok"))
    {
      status = StatusValues.OK;
    }
    else // regex mate...
    {
      status = StatusValues.NOT_OK;
    }
   
    Integer testNumber = Integer.parseInt(matcher.group(2));
    testResult = new TestResult( status, testNumber );     
   
    testResult.setDescription(matcher.group(3));
   
    String directiveToken = matcher.group(4);
    if ( directiveToken != null )
    {
      String directiveText = matcher.group(5);
      DirectiveValues directiveValue = null;
      if ( directiveText.trim().equals("TODO"))
      {
        directiveValue = DirectiveValues.TODO;
      } else
      {
        directiveValue = DirectiveValues.SKIP;
      }
      String reason = matcher.group( 6 );
      Directive directive = new Directive( directiveValue, reason );
      testResult.setDirective( directive );
    }
   
    String commentToken = matcher.group( 7 );
    if ( commentToken != null )
    {
      String text = matcher.group ( 8 );
      final Comment comment = new Comment( text );
      testResult.setComment( comment );
    }
   
    this.testResults.add( testResult );
    this.tapLines.add( testResult );
  }
View Full Code Here

TOP

Related Classes of br.eti.kinoshita.tap4j.model.TestResult

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.