Browse files

ErrorCollector-Beispiel

  • Loading branch information...
1 parent 5f3e4cb commit 54e82f3e85a94507a920272e61f9d49b5b3f696a @marcphilipp committed Oct 10, 2011
Showing with 19 additions and 0 deletions.
  1. +19 −0 junit-rules/src/test/java/org/junit/rules/verifier/ErrorCollectingTest.java
View
19 junit-rules/src/test/java/org/junit/rules/verifier/ErrorCollectingTest.java
@@ -0,0 +1,19 @@
+package org.junit.rules.verifier;
+
+import static org.hamcrest.CoreMatchers.is;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ErrorCollector;
+
+public class ErrorCollectingTest {
+
+ @Rule
+ public ErrorCollector collector = new ErrorCollector();
+
+ @Test
+ public void test() {
+ collector.checkThat(1 + 1, is(3));
+ collector.addError(new Exception("something went wrong"));
+ }
+}

0 comments on commit 54e82f3

Please sign in to comment.