Update of /cvsroot/junit/junit/src/org/junit/experimental/theories/test/runner In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28163/src/org/junit/experimental/theories/test/runner Modified Files: TheoriesTest.java DataPointMethodTest.java TheoryContainerReferenceTest.java ParameterizedAssertionErrorTest.java Log Message: No tests rely on hamcrest-all Index: TheoriesTest.java =================================================================== RCS file: /cvsroot/junit/junit/src/org/junit/experimental/theories/test/runner/TheoriesTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TheoriesTest.java 2 Jul 2007 18:11:10 -0000 1.1 +++ TheoriesTest.java 9 Jul 2007 18:49:20 -0000 1.2 @@ -1,11 +1,12 @@ package org.junit.experimental.theories.test.runner; import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.not; +import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertThat; import static org.junit.Assume.assumeThat; +import static org.junit.experimental.results.ResultMatchers.failureCountIs; import static org.junit.experimental.results.ResultMatchers.hasSingleFailureContaining; +import static org.junit.experimental.theories.matchers.api.StringContains.containsString; import org.hamcrest.Matcher; import org.junit.Test; import org.junit.experimental.results.PrintableResult; @@ -160,8 +161,7 @@ @Test public void honorTimeout() throws Exception { - assertThat(PrintableResult.testResult(HonorTimeout.class) - .getFailures().size(), is(1)); + assertThat(PrintableResult.testResult(HonorTimeout.class), failureCountIs(1)); } @RunWith(Theories.class) Index: DataPointMethodTest.java =================================================================== RCS file: /cvsroot/junit/junit/src/org/junit/experimental/theories/test/runner/DataPointMethodTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DataPointMethodTest.java 2 Jul 2007 18:11:10 -0000 1.1 +++ DataPointMethodTest.java 9 Jul 2007 18:49:20 -0000 1.2 @@ -1,13 +1,13 @@ package org.junit.experimental.theories.test.runner; -import static org.hamcrest.Matchers.nullValue; +import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertThat; +import static org.junit.experimental.theories.matchers.api.Each.each; import java.util.List; import org.hamcrest.Matcher; import org.junit.Test; -import org.junit.experimental.theories.matchers.api.Each; import org.junit.experimental.theories.methods.api.DataPoint; import org.junit.experimental.theories.methods.api.Theory; import org.junit.experimental.theories.runner.api.Theories; @@ -16,7 +16,6 @@ import org.junit.runner.notification.Failure; public class DataPointMethodTest { - @RunWith(Theories.class) public static class HasDataPointMethod { @DataPoint @@ -64,6 +63,6 @@ private Matcher<Iterable<Failure>> empty() { Matcher<Failure> nullValue= nullValue(); - return Each.each(nullValue); + return each(nullValue); } } Index: TheoryContainerReferenceTest.java =================================================================== RCS file: /cvsroot/junit/junit/src/org/junit/experimental/theories/test/runner/TheoryContainerReferenceTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TheoryContainerReferenceTest.java 2 Jul 2007 18:11:11 -0000 1.1 +++ TheoryContainerReferenceTest.java 9 Jul 2007 18:49:20 -0000 1.2 @@ -1,14 +1,12 @@ package org.junit.experimental.theories.test.runner; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.hasToString; -import static org.hamcrest.Matchers.is; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertThat; import java.util.Date; import java.util.List; -import org.hamcrest.Matchers; import org.junit.Test; import org.junit.experimental.imposterization.FunctionPointer; import org.junit.experimental.theories.methods.api.DataPoint; @@ -17,6 +15,7 @@ import org.junit.experimental.theories.runner.TheoryContainerReference; import org.junit.experimental.theories.runner.api.Theories; import org.junit.runner.RunWith; +import static org.junit.experimental.theories.matchers.api.StringContains.containsString; public class TheoryContainerReferenceTest { private FunctionPointer method = new FunctionPointer(); @@ -48,15 +47,14 @@ @Test public void pickUpDataPointMethods() throws SecurityException, InstantiationException, IllegalAccessException { method.calls(test).allIntsOk(0); - assertThat(potentialValues(), hasToString(containsString("100"))); + assertThat(potentialValues().toString(), containsString("100")); } @Test public void ignoreDataPointMethodsWithWrongTypes() throws SecurityException, InstantiationException, IllegalAccessException { method.calls(test).onlyStringsOk(null); - assertThat(potentialValues().toString(), Matchers - .not(hasToString(containsString("100")))); + assertThat(potentialValues().toString(), not(containsString("100"))); } @Test public void ignoreDataPointMethodsWithoutAnnotation() Index: ParameterizedAssertionErrorTest.java =================================================================== RCS file: /cvsroot/junit/junit/src/org/junit/experimental/theories/test/runner/ParameterizedAssertionErrorTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ParameterizedAssertionErrorTest.java 2 Jul 2007 18:11:11 -0000 1.1 +++ ParameterizedAssertionErrorTest.java 9 Jul 2007 18:49:20 -0000 1.2 @@ -1,10 +1,10 @@ package org.junit.experimental.theories.test.runner; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; +import static org.junit.experimental.theories.matchers.api.StringContains.containsString; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertThat; import static org.junit.Assume.assumeThat; -import org.hamcrest.Matchers; import org.junit.experimental.theories.methods.api.Theory; import org.junit.experimental.theories.runner.ParameterizedAssertionError; import org.junit.experimental.theories.runner.api.Theories; @@ -54,7 +54,6 @@ @Theory(nullsAccepted= false) public void buildParameterizedAssertionError(String methodName, String param) { assertThat(new ParameterizedAssertionError(new RuntimeException(), - methodName, param).toString(), Matchers - .containsString(methodName)); + methodName, param).toString(), containsString(methodName)); } } |