Examples of RunNotifier


Examples of org.junit.runner.notification.RunNotifier

            return suite;
        }
    }

    public RunNotifier getNotifier(final TestResult result, final JUnit4TestAdapter adapter) {
        RunNotifier notifier = new RunNotifier();
        notifier.addListener(new RunListener() {
            @Override
            public void testFailure(Failure failure) throws Exception {
                result.addError(asTest(failure.getDescription()), failure.getException());
            }
View Full Code Here

Examples of org.junit.runner.notification.RunNotifier

  /**
   * Create a new <code>JUnitCore</code> to run tests.
   */
  public JUnitCore() {
    fNotifier= new RunNotifier();
  }
View Full Code Here

Examples of org.junit.runner.notification.RunNotifier

    }
  }

  public RunNotifier getNotifier(final TestResult result,
      final JUnit4TestAdapter adapter) {
    RunNotifier notifier = new RunNotifier();
    notifier.addListener(new RunListener() {
      @Override
      public void testFailure(Failure failure) throws Exception {
        result.addError(asTest(failure.getDescription()), failure.getException());
      }
View Full Code Here

Examples of org.junit.runner.notification.RunNotifier

    this.registryManager = new TestRegistryManager(type);
  }

  @Override
  public void run(RunNotifier notifier) {
    RunNotifier wrapper = new RegistryManagerRunNotifier(registryManager, notifier);
    super.run(wrapper);
  }
View Full Code Here

Examples of org.junit.runner.notification.RunNotifier

    {
        if (classSingleScriptAnnotation == null) {
            return statement;
        } else {
            final String name = computeBMRulesName(classSingleScriptAnnotation.value(), testKlazz);
            final RunNotifier fnotifier = notifier;
            final Description description = Description.createTestDescription(testKlazz, getName(), classSingleScriptAnnotation);
            final String loadDirectory = normaliseLoadDirectory(classSingleScriptAnnotation);
            return new Statement() {
                public void evaluate() throws Throwable {
                    try {
                        BMUnit.loadScriptFile(testKlazz, name, loadDirectory);
                        try {
                            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

Examples of org.junit.runner.notification.RunNotifier

            // note we iterate down here because we generate statements by wraparound
            // which means the the outer statement gets executed first
            for (int i = scriptAnnotations.length; i> 0; i--) {
                BMScript scriptAnnotation= scriptAnnotations[i - 1];
                final String name = computeBMRulesName(scriptAnnotation.value(), testKlazz);
                final RunNotifier fnotifier = notifier;
                final Description description = Description.createTestDescription(testKlazz, getName(), scriptAnnotation);
                final String loadDirectory = normaliseLoadDirectory(scriptAnnotation);
                final Statement nextStatement = result;
                result = new Statement() {
                    public void evaluate() throws Throwable {
                        try {
                            BMUnit.loadScriptFile(testKlazz, name, loadDirectory);
                            try {
                                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

Examples of org.junit.runner.notification.RunNotifier

    {
        if (classMultiRuleAnnotation == null) {
            return statement;
        } else {
            final String scriptText = constructScriptText(classMultiRuleAnnotation.rules());
            final RunNotifier fnotifier = notifier;
            final Description description = Description.createTestDescription(testKlazz, getName(), classMultiRuleAnnotation);
            return new Statement() {
                public void evaluate() throws Throwable {
                    try {
                        BMUnit.loadScriptText(testKlazz, null, scriptText);
                        try {
                            statement.evaluate();
                        } finally {
                            try {
                                BMUnit.unloadScriptText(testKlazz, null);
                            } catch (Exception e) {
                                fnotifier.fireTestFailure(new Failure(description, e));
                            }
                        }
                    } catch (Exception e) {
                        fnotifier.fireTestFailure(new Failure(description, e));
                    }
                }
            };
        }
    }
View Full Code Here

Examples of org.junit.runner.notification.RunNotifier

    {
        if (classSingleRuleAnnotation == null) {
            return statement;
        } else {
            final String scriptText = constructScriptText(new BMRule[] {classSingleRuleAnnotation});
            final RunNotifier fnotifier = notifier;
            final Description description = Description.createTestDescription(testKlazz, getName(), classSingleRuleAnnotation);
            return new Statement() {
                public void evaluate() throws Throwable {
                    try {
                        BMUnit.loadScriptText(testKlazz, null, scriptText);
                        try {
                            statement.evaluate();
                        } finally {
                            try {
                                BMUnit.unloadScriptText(testKlazz, null);
                            } catch (Exception e) {
                                fnotifier.fireTestFailure(new Failure(description, e));
                            }
                        }
                    } catch (Exception e) {
                        fnotifier.fireTestFailure(new Failure(description, e));
                    }
                }
            };
        }
    }
View Full Code Here

Examples of org.junit.runner.notification.RunNotifier

      return;
    }

    try {
      OSGiBDTJUnitRunner runner = new OSGiBDTJUnitRunner(testClass, testArguments, findBundle(testBundle), parameters);
      RunNotifier notifier = new RunNotifier();
      OSGiBDTFitRunListener listener = new OSGiBDTFitRunListener();
      notifier.addListener(listener);
      runner.run(notifier);
    } catch (InitializationError e) {
      exception(getCell(0, 0), e);
    }
View Full Code Here

Examples of org.junit.runner.notification.RunNotifier

    OSGiBDTTestWrapper testArguments = new OSGiBDTTestWrapper(null, null, framework, StartPolicy.ONCE_PER_TEST_CLASS,
        repositoryLocations, null, systemBundle, required, arguments);
   
    try {
      OSGiBDTJUnitRunner runner = new OSGiBDTJUnitRunner(testClass, testArguments, findBundle(testBundle), parameters);
      RunNotifier notifier = new RunNotifier();
      OSGiBDTFitRunListener listener = new OSGiBDTFitRunListener();
      notifier.addListener(listener);
      runner.run(notifier);
      addTestResultRows(cells, listener.getResults());
    } catch (InitializationError e) {
      exception(cells, e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.