Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: marcphilipp/junit
...
head fork: marcphilipp/junit
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 09, 2012
@marcphilipp Update references to Hamcrest JAR a26d3de
@marcphilipp Fix javac build
There seems to be a problem compiling calls of the new

	assertThat(T actual, Matcher<? super T> matcher)

using javac and matchers like `hasItem` and `both` that also use 
`Matcher<? super T>` as parameter.
c2bdb1a
View
2  build.xml
@@ -28,7 +28,7 @@
<property name="javadocdir" location="${dist}/javadoc" />
<property name="javadoczip" location="${dist}-javadoc.zip" />
- <property name="hamcrestlib" location="lib/hamcrest-core-1.1.jar" />
+ <property name="hamcrestlib" location="lib/hamcrest-core-1.3.0RC2.jar" />
<property name="hamcrestsrc" location="${dist}/temp.hamcrest.source" />
<target name="init">
View
2  build/profile_junit.sh
@@ -1,2 +1,2 @@
-java -classpath ../bin:../lib/hamcrest-core-1.1.jar -agentlib:hprof=cpu=samples,depth=18 org.junit.runner.JUnitCore org.junit.tests.AllTests
+java -classpath ../bin:../lib/hamcrest-core-1.3.0RC2.jar -agentlib:hprof=cpu=samples,depth=18 org.junit.runner.JUnitCore org.junit.tests.AllTests
cat java.hprof.txt
View
4 src/test/java/org/junit/tests/experimental/theories/ParameterSignatureTest.java
@@ -1,6 +1,5 @@
package org.junit.tests.experimental.theories;
-import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.isA;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
@@ -10,6 +9,7 @@
import java.lang.reflect.Method;
import java.util.List;
+import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.ParameterSignature;
@@ -51,6 +51,6 @@ public void getAnnotations() throws SecurityException,
List<Annotation> annotations= ParameterSignature.signatures(method)
.get(0).getAnnotations();
assertThat(annotations,
- hasItem(isA(TestedOn.class)));
+ CoreMatchers.<TestedOn> hasItem(isA(TestedOn.class)));
}
}
View
5 src/test/java/org/junit/tests/experimental/theories/runner/UnsuccessfulWithDataPointFields.java
@@ -1,13 +1,14 @@
package org.junit.tests.experimental.theories.runner;
-import static org.hamcrest.CoreMatchers.both;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.experimental.results.PrintableResult.testResult;
import static org.junit.experimental.results.ResultMatchers.failureCountIs;
import static org.junit.experimental.results.ResultMatchers.hasFailureContaining;
import static org.junit.experimental.results.ResultMatchers.hasSingleFailureContaining;
+import org.hamcrest.CoreMatchers;
import org.junit.Test;
+import org.junit.experimental.results.PrintableResult;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
@@ -99,7 +100,7 @@ public void numbers(int x) {
public void dataPointsMustBeStatic() {
assertThat(
testResult(DataPointsMustBeStatic.class),
- both(failureCountIs(2))
+ CoreMatchers.<PrintableResult> both(failureCountIs(2))
.and(
hasFailureContaining("DataPoint field THREE must be static"))
.and(
View
6 src/test/java/org/junit/tests/running/methods/AnnotationTest.java
@@ -9,6 +9,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.hamcrest.CoreMatchers;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -143,7 +144,10 @@ public void testTestAndTeardownFailure() throws Exception {
Result runner= core.run(TestAndTeardownFailureTest.class);
assertEquals(1, runner.getRunCount());
assertEquals(2, runner.getFailureCount());
- assertThat(runner.getFailures().toString(), both(containsString("hereAfter")).and(containsString("inTest")));
+ assertThat(
+ runner.getFailures().toString(),
+ CoreMatchers.<String> both(containsString("hereAfter")).and(
+ containsString("inTest")));
}
static public class TeardownAfterFailureTest {

No commit comments for this range

Something went wrong with that request. Please try again.