diff --git a/jmock-example/pom.xml b/jmock-example/pom.xml index 83b71f56c..f98e9c5d3 100644 --- a/jmock-example/pom.xml +++ b/jmock-example/pom.xml @@ -5,14 +5,14 @@ org.jmock jmock-example - 2.8.1 + 2.8.2 jar jMock Examples org.jmock jmock-parent - 2.8.1 + 2.8.2 ../pom.xml diff --git a/jmock-junit3/pom.xml b/jmock-junit3/pom.xml index 49d81fe8c..596f6bbf8 100644 --- a/jmock-junit3/pom.xml +++ b/jmock-junit3/pom.xml @@ -5,7 +5,7 @@ org.jmock jmock-parent - 2.8.1 + 2.8.2 jmock-junit3 diff --git a/jmock-junit4/pom.xml b/jmock-junit4/pom.xml index 615fc8add..5d943beb1 100644 --- a/jmock-junit4/pom.xml +++ b/jmock-junit4/pom.xml @@ -8,7 +8,7 @@ org.jmock jmock-parent - 2.8.1 + 2.8.2 diff --git a/jmock-legacy/pom.xml b/jmock-legacy/pom.xml index 203dd63de..74034864e 100644 --- a/jmock-legacy/pom.xml +++ b/jmock-legacy/pom.xml @@ -8,7 +8,7 @@ org.jmock jmock-parent - 2.8.1 + 2.8.2 diff --git a/jmock-legacy/src/test/java/org/jmock/test/unit/lib/legacy/Java8Issue79UnitTest.java b/jmock-legacy/src/test/java/org/jmock/test/unit/lib/legacy/Java8Issue79UnitTest.java new file mode 100644 index 000000000..4155d3a61 --- /dev/null +++ b/jmock-legacy/src/test/java/org/jmock/test/unit/lib/legacy/Java8Issue79UnitTest.java @@ -0,0 +1,28 @@ +package org.jmock.test.unit.lib.legacy; + +import java.io.File; + +import org.jmock.integration.junit4.JUnitRuleMockery; +import org.jmock.lib.legacy.ClassImposteriser; +import org.junit.Rule; +import org.junit.Test; + +/** + * This used to fail in Java 8 as cglib-nodep used asm:5.0.3 which required jdk<=7 + * Now we use cglib (not cglib-nodep) and override asm to 5.0.4 + * @see https://github.com/jmock-developers/jmock-library/issues/79 + * @see https://github.com/cglib/cglib/issues/20 + */ +public class Java8Issue79UnitTest { + @Rule + public final JUnitRuleMockery _context = new JUnitRuleMockery() { + { + setImposteriser(ClassImposteriser.INSTANCE); + } + }; + + @Test + public void testMock() { + _context.mock(File.class); + } +} diff --git a/jmock/pom.xml b/jmock/pom.xml index 5108b1b38..bfa0e8dec 100644 --- a/jmock/pom.xml +++ b/jmock/pom.xml @@ -9,7 +9,7 @@ org.jmock jmock-parent - 2.8.1 + 2.8.2 @@ -32,7 +32,7 @@ cglib - cglib-nodep + cglib org.ow2.asm diff --git a/jmock/src/test/java/org/jmock/test/acceptance/NullAndNonNullAcceptanceTests.java b/jmock/src/test/java/org/jmock/test/acceptance/NullAndNonNullAcceptanceTests.java index 415c554cf..ca4d574a7 100644 --- a/jmock/src/test/java/org/jmock/test/acceptance/NullAndNonNullAcceptanceTests.java +++ b/jmock/src/test/java/org/jmock/test/acceptance/NullAndNonNullAcceptanceTests.java @@ -38,8 +38,21 @@ public void testNonNullParameterMatcher() { catch (ExpectationError expected) {} } + public void testAnyParameterMatcher() { + context.checking(new Expectations() {{ + allowing (mock).doSomethingWith(with(any(String.class))); + }}); + + mock.doSomethingWith("not null"); + + try { + mock.doSomethingWith(null); + fail("should have thrown ExpectationError"); + } + catch (ExpectationError expected) {} + } // A defect in Hamcrest - public void DISABLED_testNullArrayParameter() { + public void testNullArrayParameter() { context.checking(new Expectations() {{ allowing (mock).doSomethingWithArray(null); }}); diff --git a/pom.xml b/pom.xml index 6585c2dc9..d900d64e0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jmock jmock-parent - 2.8.1 + 2.8.2 pom jMock 2 Parent @@ -42,10 +42,9 @@ true 1.3 hamcrest-src - 4.11 - 2.8.0 - 3.1 - 5.0.3 + 4.12 + 3.2.0 + 5.0.4 2.1 1.3.0 @@ -98,8 +97,6 @@ maven-compiler-plugin - 1.6 1.6 @@ -173,7 +170,7 @@ cglib - cglib-nodep + cglib ${cglib.version} diff --git a/testjar/pom.xml b/testjar/pom.xml index 076a78842..e08974fca 100644 --- a/testjar/pom.xml +++ b/testjar/pom.xml @@ -10,7 +10,7 @@ org.jmock jmock-parent - 2.8.1 + 2.8.2 ../pom.xml