Created
January 7, 2013 10:39
-
-
Save lauripiispanen/4474031 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
public class CompositeTestRule implements TestRule { | |
private TestRule[] rules; | |
public CompositeTestRule(TestRule... rules) { | |
this.rules = rules; | |
} | |
public Statement apply(Statement statement, Description description) { | |
Statement s = statement; | |
for (TestRule rule: rules) { | |
s = rule.apply(s, description); | |
} | |
return s; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment