Skip to content

Commit 974a9c6

Browse files
author
Oli Bye
committed
Resolve #79 by moving cglib-nodep:3.1 to cglib:3.2.1 and adding asm:5.0.4
1 parent 554c7da commit 974a9c6

File tree

9 files changed

+55
-17
lines changed

9 files changed

+55
-17
lines changed

jmock-example/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
<groupId>org.jmock</groupId>
77
<artifactId>jmock-example</artifactId>
8-
<version>2.8.1</version>
8+
<version>2.8.2</version>
99
<packaging>jar</packaging>
1010
<name>jMock Examples</name>
1111

1212
<parent>
1313
<groupId>org.jmock</groupId>
1414
<artifactId>jmock-parent</artifactId>
15-
<version>2.8.1</version>
15+
<version>2.8.2</version>
1616
<relativePath>../pom.xml</relativePath>
1717
</parent>
1818

jmock-junit3/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.jmock</groupId>
77
<artifactId>jmock-parent</artifactId>
8-
<version>2.8.1</version>
8+
<version>2.8.2</version>
99
</parent>
1010

1111
<artifactId>jmock-junit3</artifactId>

jmock-junit4/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>org.jmock</groupId>
1010
<artifactId>jmock-parent</artifactId>
11-
<version>2.8.1</version>
11+
<version>2.8.2</version>
1212
</parent>
1313

1414
<properties>

jmock-legacy/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>org.jmock</groupId>
1010
<artifactId>jmock-parent</artifactId>
11-
<version>2.8.1</version>
11+
<version>2.8.2</version>
1212
</parent>
1313

1414
<properties>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.jmock.test.unit.lib.legacy;
2+
3+
import java.io.File;
4+
5+
import org.jmock.integration.junit4.JUnitRuleMockery;
6+
import org.jmock.lib.legacy.ClassImposteriser;
7+
import org.junit.Rule;
8+
import org.junit.Test;
9+
10+
/**
11+
* This used to fail in Java 8 as cglib-nodep used asm:5.0.3 which required jdk<=7
12+
* Now we use cglib (not cglib-nodep) and override asm to 5.0.4
13+
* @see https://github.com/jmock-developers/jmock-library/issues/79
14+
* @see https://github.com/cglib/cglib/issues/20
15+
*/
16+
public class Java8Issue79UnitTest {
17+
@Rule
18+
public final JUnitRuleMockery _context = new JUnitRuleMockery() {
19+
{
20+
setImposteriser(ClassImposteriser.INSTANCE);
21+
}
22+
};
23+
24+
@Test
25+
public void testMock() {
26+
_context.mock(File.class);
27+
}
28+
}

jmock/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>org.jmock</groupId>
1111
<artifactId>jmock-parent</artifactId>
12-
<version>2.8.1</version>
12+
<version>2.8.2</version>
1313
<!-- mvn versions:set -DoldVersion=2.8.1-SNAPSHOT -DnewVersion=2.8.1
1414
-DgroupId=org.jmock -->
1515
<!-- find . -name pom.xml.versionsBackup -exec rm {} \; -->
@@ -32,7 +32,7 @@
3232

3333
<dependency>
3434
<groupId>cglib</groupId>
35-
<artifactId>cglib-nodep</artifactId>
35+
<artifactId>cglib</artifactId>
3636
</dependency>
3737
<dependency>
3838
<groupId>org.ow2.asm</groupId>

jmock/src/test/java/org/jmock/test/acceptance/NullAndNonNullAcceptanceTests.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,21 @@ public void testNonNullParameterMatcher() {
3838
catch (ExpectationError expected) {}
3939
}
4040

41+
public void testAnyParameterMatcher() {
42+
context.checking(new Expectations() {{
43+
allowing (mock).doSomethingWith(with(any(String.class)));
44+
}});
45+
46+
mock.doSomethingWith("not null");
47+
48+
try {
49+
mock.doSomethingWith(null);
50+
fail("should have thrown ExpectationError");
51+
}
52+
catch (ExpectationError expected) {}
53+
}
4154
// A defect in Hamcrest
42-
public void DISABLED_testNullArrayParameter() {
55+
public void testNullArrayParameter() {
4356
context.checking(new Expectations() {{
4457
allowing (mock).doSomethingWithArray(null);
4558
}});

pom.xml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.jmock</groupId>
77
<artifactId>jmock-parent</artifactId>
8-
<version>2.8.1</version>
8+
<version>2.8.2</version>
99
<packaging>pom</packaging>
1010
<name>jMock 2 Parent</name>
1111

@@ -42,10 +42,9 @@
4242
<downloadSources>true</downloadSources>
4343
<hamcrest.version>1.3</hamcrest.version>
4444
<hamcrest.src>hamcrest-src</hamcrest.src>
45-
<junit.version>4.11</junit.version>
46-
<jmock.version>2.8.0</jmock.version>
47-
<cglib.version>3.1</cglib.version>
48-
<asm.version>5.0.3</asm.version>
45+
<junit.version>4.12</junit.version>
46+
<cglib.version>3.2.0</cglib.version>
47+
<asm.version>5.0.4</asm.version>
4948
<objenesis.version>2.1</objenesis.version>
5049
<bsh.version>1.3.0</bsh.version>
5150
</properties>
@@ -98,8 +97,6 @@
9897
<plugin>
9998
<artifactId>maven-compiler-plugin</artifactId>
10099
<configuration>
101-
<!-- If we use 1.5 then you can't mark interface
102-
methods as @Override -->
103100
<source>1.6</source>
104101
<target>1.6</target>
105102
</configuration>
@@ -173,7 +170,7 @@
173170
</dependency>
174171
<dependency>
175172
<groupId>cglib</groupId>
176-
<artifactId>cglib-nodep</artifactId>
173+
<artifactId>cglib</artifactId>
177174
<version>${cglib.version}</version>
178175
</dependency>
179176
<dependency>

testjar/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.jmock</groupId>
1212
<artifactId>jmock-parent</artifactId>
13-
<version>2.8.1</version>
13+
<version>2.8.2</version>
1414
<relativePath>../pom.xml</relativePath>
1515
</parent>
1616

0 commit comments

Comments
 (0)