void runTestMethod(Statement methodInvoker, RunNotifier notifier) {
    Description methodDescription = describeMethod();
    Description methodWithParams = findChildForParams(methodInvoker, methodDescription);

    notifier.fireTestStarted(methodWithParams);
    runMethodInvoker(notifier, methodDescription, methodInvoker, methodWithParams);
    notifier.fireTestFinished(methodWithParams);
  }
Ejemplo n.º 2
0
 public void afterScenario() {
   notifier.fireTestFinished(currentScenario);
   if (scenarioDescriptions.hasNext()) {
     currentScenario = scenarioDescriptions.next();
     finishedDescriptions.clear();
   }
 }
 private void runMethodInvoker(
     RunNotifier notifier,
     Description description,
     Statement methodInvoker,
     Description methodWithParams) {
   try {
     methodInvoker.evaluate();
   } catch (Throwable e) {
     notifier.fireTestFailure(new Failure(methodWithParams, e));
   }
 }
Ejemplo n.º 4
0
 public void successful(String step) {
   currentStep = getStepDescription(step);
   notifier.fireTestStarted(currentStep);
   notifier.fireTestFinished(currentStep);
   finishedDescriptions.add(currentStep);
 }
Ejemplo n.º 5
0
 public void failed(String step, Throwable e) {
   currentStep = getStepDescription(step);
   notifier.fireTestStarted(currentStep);
   notifier.fireTestFailure(new Failure(currentStep, e));
   finishedDescriptions.add(currentStep);
 }
Ejemplo n.º 6
0
 public void beforeStory(StoryDefinition story, boolean embeddedStory) {
   notifier.fireTestStarted(storyDescription);
 }
Ejemplo n.º 7
0
 public void beforeScenario(String title) {
   notifier.fireTestStarted(currentScenario);
 }
Ejemplo n.º 8
0
 public void afterStory(boolean embeddedStory) {
   notifier.fireTestFinished(storyDescription);
 }
 /** {@inheritDoc} */
 @Override
 public void run(RunNotifier notifier) {
   notifier.fireTestIgnored(getDescription());
 }
  private void reportTestAsNotApplicableInCurrentTestRun(Method method) {
    Class<?> testClass = method.getDeclaringClass();
    Description testDescription = Description.createTestDescription(testClass, method.getName());

    runNotifier.fireTestAssumptionFailed(new Failure(testDescription, NOT_APPLICABLE));
  }