ttomcat-1778514358873.zip-extract/_dependencies/maven/junit_junit-4.13.2/junit/framework/TestFailure.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/junit_junit-4.13.2/junit/framework/TestFailure.java
Status
scanned
Type
file
Name
TestFailure.java
Extension
.java
Programming language
Java
Mime type
text/x-java
File type
Java source, ASCII text
Tag

      
    
Rootfs path

      
    
Size
1629 (1.6 KB)
MD5
35ae6b31dec430fc928e610eac538ee4
SHA1
560581d5f6e9838b586e096d045b49b3351071ec
SHA256
abc935cc6a11753f417fdb6e07c84ada2adf1c3f0eb3d6141434bc4e3ff5adc0
SHA512

      
    
SHA1_git
d1ddfbc293570716addf45f9a8e0bd248bce36ff
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestFailure.java | 1.6 KB |

package junit.framework; import org.junit.internal.Throwables; /** * A {@code TestFailure} collects a failed test together with * the caught exception. * * @see TestResult */ public class TestFailure { protected Test fFailedTest; protected Throwable fThrownException; /** * Constructs a TestFailure with the given test and exception. */ public TestFailure(Test failedTest, Throwable thrownException) { fFailedTest = failedTest; fThrownException = thrownException; } /** * Gets the failed test. */ public Test failedTest() { return fFailedTest; } /** * Gets the thrown exception. */ public Throwable thrownException() { return fThrownException; } /** * Returns a short description of the failure. */ @Override public String toString() { return fFailedTest + ": " + fThrownException.getMessage(); } /** * Returns a String containing the stack trace of the error * thrown by TestFailure. */ public String trace() { return Throwables.getStacktrace(thrownException()); } /** * Returns a String containing the message from the thrown exception. */ public String exceptionMessage() { return thrownException().getMessage(); } /** * Returns {@code true} if the error is considered a failure * (i.e. if it is an instance of {@code AssertionFailedError}), * {@code false} otherwise. */ public boolean isFailure() { return thrownException() instanceof AssertionFailedError; } }