All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.junit.internal.runners.model.EachTestNotifier Maven / Gradle / Ivy

Go to download

JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java.

There is a newer version: 4.11
Show newest version
/**
 * 
 */
package org.junit.internal.runners.model;


import org.junit.internal.AssumptionViolatedException;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunNotifier;

public class EachTestNotifier {
	private final RunNotifier fNotifier;

	private final Description fDescription;

	public EachTestNotifier(RunNotifier notifier, Description description) {
		fNotifier= notifier;
		fDescription= description;
	}
	
	public void addFailure(Throwable targetException) {
		if (targetException instanceof MultipleFailureException) {
			MultipleFailureException mfe= (MultipleFailureException) targetException;
			for (Throwable each : mfe.getFailures())
				addFailure(each);
			return;
		}
		fNotifier.fireTestFailure(new Failure(fDescription, targetException));
	}

	public void addFailedAssumption(AssumptionViolatedException e) {
		fNotifier.fireTestAssumptionFailed(new Failure(fDescription, e));
	}

	public void fireTestFinished() {
		fNotifier.fireTestFinished(fDescription);
	}

	public void fireTestStarted() {
		fNotifier.fireTestStarted(fDescription);
	}

	public void fireTestIgnored() {
		fNotifier.fireTestIgnored(fDescription);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy