Package org.junit.runner.notification

Examples of org.junit.runner.notification.Failure


            addFailure(each);
        }
    }

    public void addFailedAssumption(AssumptionViolatedException e) {
        notifier.fireTestAssumptionFailed(new Failure(description, e));
    }
View Full Code Here


                iocClientTestCase.setName(method.getName());
                JUnitShell.runTest(iocClientTestCase, result);
              }
            }
            catch (GenerationException e) {
              notifier.fireTestFailure(new Failure(description, e));
            }
            catch (InvocationTargetException e) {
              notifier.fireTestFailure(new Failure(description, e.getTargetException()));
              return;
            }
            catch (Throwable e) {
              notifier.fireTestFailure(new Failure(description, e));
              return;
            }

            notifier.fireTestRunFinished(new Result());

            if (!result.wasSuccessful()) {
              notifier.fireTestFailure(new Failure(description, null));
            }
            else {
              notifier.fireTestFinished(description);
            }
          }
View Full Code Here

                    case SUCCESS :
                        notifier.fireTestFinished( test.getDescription() );
                        break;
                    case ERROR :
                    case FAILURE :
                        notifier.fireTestFailure( new Failure( test.getDescription(),
                                                               new AssertionError( testResult.errorMsgs ) ) );
                        break;
                }

            } catch ( Throwable e ) {
                notifier.fireTestFailure( new Failure( test.getDescription(),
                                                       e ) );
            }
            result.add( testResult );
        }
View Full Code Here

  // TODO: this is duplicated in TestClassMethodsRunner
  @Override
  public void run(RunNotifier notifier) {
    notifier.fireTestStarted(fDescription);
    notifier.fireTestFailure(new Failure(fDescription, fCause));
    notifier.fireTestFinished(fDescription);
  }
View Full Code Here

      }
   
      // Implement junit.framework.TestListener
      //TODO method not covered
      public void addError(Test test, Throwable t) {
        Failure failure= new Failure(asDescription(test), t);
        notifier.fireTestFailure(failure);
      }
     
      private Description asDescription(Test test) {
        if (test instanceof JUnit4TestCaseFacade) {
View Full Code Here

  private void testAborted(RunNotifier notifier, Description description) {
    // TODO: duped!
    // TODO: envious
    notifier.fireTestStarted(description);
    notifier.fireTestFailure(new Failure(description, new Exception("No runnable methods")));
    notifier.fireTestFinished(description);
  }
View Full Code Here

    fMethod.invoke(fTest);
  }

  @Override
  protected void addFailure(Throwable e) {
    fNotifier.fireTestFailure(new Failure(fDescription, e));
  }
View Full Code Here

      }
   
      // TODO: looks very similar to other method of BeforeAfter, now
      @Override
      protected void addFailure(Throwable targetException) {
        notifier.fireTestFailure(new Failure(getDescription(), targetException));
      }
    };

    runner.runProtected();
  }
View Full Code Here

                    case SUCCESS :
                        notifier.fireTestFinished( test.getDescription() );
                        break;
                    case ERROR :
                    case FAILURE :
                        notifier.fireTestFailure( new Failure( test.getDescription(),
                                                               new AssertionError( testResult.errorMsgs ) ) );
                        break;
                }

            } catch ( Throwable e ) {
                notifier.fireTestFailure( new Failure( test.getDescription(),
                                                       e ) );
            }
            result.add( testResult );
        }
View Full Code Here

                iocClientTestCase.setName(method.getName());
                JUnitShell.runTest(iocClientTestCase, result);
              }
            }
            catch (GenerationException e) {
              notifier.fireTestFailure(new Failure(description, e));
            }
            catch (InvocationTargetException e) {
              notifier.fireTestFailure(new Failure(description, e.getTargetException()));
              return;
            }
            catch (Throwable e) {
              notifier.fireTestFailure(new Failure(description, e));
              return;
            }

            notifier.fireTestRunFinished(new Result());

            if (!result.wasSuccessful()) {
              notifier.fireTestFailure(new Failure(description, null));
            }
            else {
              notifier.fireTestFinished(description);
            }
          }
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.