ttomcat-1778514358873.zip-extract/_dependencies/maven/junit_junit-4.13.2/org/junit/rules/Verifier.java

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

      
    
Rootfs path

      
    
Size
1258 (1.2 KB)
MD5
12882adfa82430636d305903573f0923
SHA1
cd2422a96e0cfe8ead6e13dd77ee48aa6f10dcf8
SHA256
533fdf0c806c2991bc13259b519a4efb404c5ff9c3f7b70785e2bb271bd38821
SHA512

      
    
SHA1_git
7a03b0cb56d31979c10f2f7412c16b54039c221c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
Verifier.java | 1.2 KB |

package org.junit.rules; import org.junit.runner.Description; import org.junit.runners.model.Statement; /** * Verifier is a base class for Rules like ErrorCollector, which can turn * otherwise passing test methods into failing tests if a verification check is * failed * * <pre> * public static class ErrorLogVerifier { * private ErrorLog errorLog = new ErrorLog(); * * &#064;Rule * public Verifier verifier = new Verifier() { * &#064;Override public void verify() { * assertTrue(errorLog.isEmpty()); * } * } * * &#064;Test public void testThatMightWriteErrorLog() { * // ... * } * } * </pre> * * @since 4.7 */ public abstract class Verifier implements TestRule { public Statement apply(final Statement base, Description description) { return new Statement() { @Override public void evaluate() throws Throwable { base.evaluate(); verify(); } }; } /** * Override this to add verification logic. Overrides should throw an * exception to indicate that verification failed. */ protected void verify() throws Throwable { } }