Package org.junit.runner.notification

Examples of org.junit.runner.notification.Failure


      log.info("**********************测试报告开始**********************");
      log.info(String.format("测试 结束,运行[%d] 成功[%d] 失败[%d] 忽略[%d] 持续%d毫秒",
          total,succeedCount,failCount,ignoreCount,result.getRunTime()));
      log.info("+失败的测试");
      for(int i=0;i<result.getFailureCount();i++){
        Failure failure = result.getFailures().get(i);
        log.info(String.format("%d.%s 原因:%s",i+1,failure.getDescription(),failure.getMessage()));
        String className = failure.getDescription().getClassName();
        String methodName = failure.getDescription().getMethodName();
        String traceLog = failure.getTrace();
        log.info(String.format("\t%s %s",failure.getException(),getTraceFileLineDescription(traceLog,className+"."+methodName)));
      }
      log.info("**********************测试报告结束**********************");
    }
View Full Code Here


        }
        catch ( Exception e )
        {
            LOG.error( I18n.err( I18n.ERR_181, getTestClass().getName() ) );
            LOG.error( e.getLocalizedMessage() );
            notifier.fireTestFailure( new Failure( getDescription(), e ) );
        }
        finally
        {
            // help GC to get rid of the directory service with all its references
            classDS = null;
View Full Code Here

        }
        catch ( Exception e )
        {
            LOG.error( I18n.err( I18n.ERR_182, method.getName() ) );
            LOG.error( "", e );
            notifier.fireTestFailure( new Failure( getDescription(), e ) );
        }
    }
View Full Code Here

   * Fire a failure for the supplied <code>exception</code> with the
   * {@link RunNotifier}.
   * @param exception the exception upon which to base the failure
   */
  protected void addFailure(Throwable exception) {
    this.notifier.fireTestFailure(new Failure(this.description, exception));
  }
View Full Code Here

    System.out.println(fDescription.getMethodName() + " Failed (Cause --> "
        + targetException + ")");
    updateResultMap(fDescription.getClassName(),
        fDescription.getMethodName(), " Failed (Cause --> "
            + targetException + " )");
    fNotifier.fireTestFailure(new Failure(fDescription, targetException));
  }
View Full Code Here

    // writeToFile(e.getMessage());
    System.out.println(fDescription.getMethodName() + " Failed (Cause --> "
        + e);
    updateResultMap(fDescription.getClassName(),
        fDescription.getMethodName(), " Failed (Cause --> " + e + " )");
    fNotifier.fireTestAssumptionFailed(new Failure(fDescription, e));
  }
View Full Code Here

   
   
    protected void testAborted( RunNotifier notifier, Description description, Throwable cause )
    {
        notifier.fireTestStarted( description );
        notifier.fireTestFailure( new Failure( description, cause ) );
        notifier.fireTestFinished( description );
    }
View Full Code Here


    private static void testAborted( RunNotifier notifier, Description description, Throwable cause )
    {
        notifier.fireTestStarted( description );
        notifier.fireTestFailure( new Failure( description, cause ) );
        notifier.fireTestFinished( description );
    }
View Full Code Here

                cleanup();
                destroy();
            }
            catch ( Exception e )
            {
                notifier.fireTestFailure( new Failure( getDescription(), e ) );
            }
        }
    }
View Full Code Here

            }
            catch ( Exception e )
            {
                LOG.error( "Encountered exception while trying to cleanup after test class: "
                    + this.getDescription().getDisplayName(), e );
                notifier.fireTestFailure( new Failure( getDescription(), e ) );
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.junit.runner.notification.Failure

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.