File tree Expand file tree Collapse file tree 9 files changed +55
-17
lines changed
src/test/java/org/jmock/test/unit/lib/legacy
src/test/java/org/jmock/test/acceptance Expand file tree Collapse file tree 9 files changed +55
-17
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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 {} \; -->
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 >
Original file line number Diff line number Diff 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 }});
Original file line number Diff line number Diff line change 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
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 >
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 >
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 >
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments