Permalink
Browse files

Files referring to the new CauseMatcher including the CauseMatcher it…

…self
  • Loading branch information...
arjenw committed May 24, 2012
1 parent 07045d9 commit e381886b42fb190e3ebb82503330e8ca2788a929
@@ -3,10 +3,10 @@
import org.hamcrest.Description;
import org.hamcrest.Matcher;
-public class ThrowableMatcher extends TypeSafeMatcher<Throwable> {
+public class CauseMatcher extends TypeSafeMatcher<Throwable> {
private final Matcher<? super Throwable> fCauseMatcher;
- public ThrowableMatcher(final Matcher<? super Throwable> causeMatcher) {
+ public CauseMatcher(final Matcher<? super Throwable> causeMatcher) {
fCauseMatcher= causeMatcher;
}
@@ -5,7 +5,7 @@
import org.junit.internal.matchers.Each;
import org.junit.internal.matchers.IsCollectionContaining;
import org.junit.internal.matchers.StringContains;
-import org.junit.internal.matchers.ThrowableMatcher;
+import org.junit.internal.matchers.CauseMatcher;
/**
* Convenience import class: these are useful matchers for use with the assertThat method, but they are
@@ -87,6 +87,6 @@
* @return a matcher matching the cause of the exception with the given {@code causeMatcher}
*/
public static Matcher<Throwable> causedBy(final Matcher<? super Throwable> causeMatcher) {
- return new ThrowableMatcher(causeMatcher);
+ return new CauseMatcher(causeMatcher);
}
}
@@ -9,7 +9,7 @@
import org.junit.tests.assertion.BothTest;
import org.junit.tests.assertion.EachTest;
import org.junit.tests.assertion.MultipleFailureExceptionTest;
-import org.junit.tests.assertion.ThrowableMatcherTest;
+import org.junit.tests.assertion.CauseMatcherTest;
import org.junit.tests.deprecated.JUnit4ClassRunnerTest;
import org.junit.tests.description.AnnotatedDescriptionTest;
import org.junit.tests.description.SuiteDescriptionTest;
@@ -160,7 +160,7 @@
RuleFieldValidatorTest.class,
RuleChainTest.class,
BlockJUnit4ClassRunnerTest.class,
- ThrowableMatcherTest.class
+ CauseMatcherTest.class
})
public class AllTests {
public static Test suite() {
@@ -5,7 +5,7 @@
import static org.junit.matchers.JUnitMatchers.causedBy;
import org.junit.Test;
-public class ThrowableMatcherTest {
+public class CauseMatcherTest {
@Test
public void causedByCorrect() {
assertThat(new IllegalStateException(new IllegalArgumentException()), causedBy(instanceOf(IllegalArgumentException.class)));

0 comments on commit e381886

Please sign in to comment.