FileDocCategorySizeDatePackage
TestFailure.javaAPI DocAndroid 1.5 API1389Wed May 06 22:41:02 BST 2009junit.framework

TestFailure

public class TestFailure extends Object
A TestFailure collects a failed test together with the caught exception.
see
TestResult

Fields Summary
protected Test
fFailedTest
protected Throwable
fThrownException
Constructors Summary
public TestFailure(Test failedTest, Throwable thrownException)
Constructs a TestFailure with the given test and exception.

		fFailedTest= failedTest;
		fThrownException= thrownException;
	
Methods Summary
public java.lang.StringexceptionMessage()

		return thrownException().getMessage();
	
public junit.framework.TestfailedTest()
Gets the failed test.

	    return fFailedTest;
	
public booleanisFailure()

		return thrownException() instanceof AssertionFailedError;
	
public java.lang.ThrowablethrownException()
Gets the thrown exception.

	    return fThrownException;
	
public java.lang.StringtoString()
Returns a short description of the failure.

	    StringBuffer buffer= new StringBuffer();
	    buffer.append(fFailedTest+": "+fThrownException.getMessage());
	    return buffer.toString();
	
public java.lang.Stringtrace()

		StringWriter stringWriter= new StringWriter();
		PrintWriter writer= new PrintWriter(stringWriter);
		thrownException().printStackTrace(writer);
		StringBuffer buffer= stringWriter.getBuffer();
		return buffer.toString();