Package org.junit.runner.notification

Examples of org.junit.runner.notification.Failure


        this.eg = example;
        this.notifier = notifier;
    }

    private ExampleState fail(Throwable e) {
        notifier.fireTestFailure(new Failure(eg.description, e));
        return RED;
    }
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

                try {
                    command.execute( context );
                    this.notifier.fireTestFinished( descr );
                    return null;
                } catch ( Exception e ) {
                    this.notifier.fireTestFailure( new Failure( descr,
                                                                e ) );
                    return null;
                }
            } else {
                return command.execute( context );
View Full Code Here

            this.suiteDescription = suiteDescription;
        }

        @Override
        public void testFailure(Failure failure) throws Exception {
            this.qunitRunNotifier.fireTestFailure(new Failure(this.suiteDescription, failure.getException()));
        }
View Full Code Here

                // notify that test started
                this.getNotifier().fireTestStarted(testDescription);
                if (qunitTest.isFailed()) {
                    // notify test failure
                    this.getNotifier().fireTestFailure(
                            new Failure(testDescription, new AssertionError(generateFailedAssertionMessage(qunitTest
                                    .getAssertions()))));
                } else {
                    // notify test finished
                    this.getNotifier().fireTestFinished(testDescription);
                }
View Full Code Here

            final List<String> expectedTests = expectedTestsMap.get(this.getTestMethod().getQUnitTestSuiteFilePath());
            for (String test : expectedTests) {
                final Description testDescription = this.getTestSuite().getTestDescriptions()
                        .get(NamingUtils.createUniqueTestName(test));
                notifier.fireTestStarted(testDescription);
                notifier.fireTestFailure(new Failure(testDescription, new Exception(
                        "QUnit test was not executed or stuck and did not finish within time")));
            }
        }
    }
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()) {
              Failure failure = null;
             
              if (result.failures().hasMoreElements()) {
                failure = new Failure(description, result.failures().nextElement().thrownException());
              }
              else if (result.errors().hasMoreElements()) {
                failure = new Failure(description, result.errors().nextElement().thrownException());
              }
             
              notifier.fireTestFailure(failure);
            }
            else {
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 (Exception 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

                            statement.evaluate();
                        } finally {
                            try {
                                BMUnit.unloadScriptFile(testKlazz, name);
                            } catch (Exception e) {
                                fnotifier.fireTestFailure(new Failure(description, e));
                            }
                        }
                    } catch (Exception e) {
                        fnotifier.fireTestFailure(new Failure(description, e));
                    }
                }
            };
        }
    }
View Full Code Here

                                nextStatement.evaluate();
                            } finally {
                                try {
                                    BMUnit.unloadScriptFile(testKlazz, name);
                                } catch (Exception e) {
                                    fnotifier.fireTestFailure(new Failure(description, e));
                                }
                            }
                        } catch (Exception e) {
                            fnotifier.fireTestFailure(new Failure(description, e));
                        }
                    }
                };
            }
            return result;
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.