Skip to content

Commit

Permalink
Resolve #79 by moving cglib-nodep:3.1 to cglib:3.2.1 and adding asm:5…
Browse files Browse the repository at this point in the history
….0.4
  • Loading branch information
Oli Bye committed Jan 25, 2016
1 parent 554c7da commit 974a9c6
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 17 deletions.
4 changes: 2 additions & 2 deletions jmock-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<groupId>org.jmock</groupId>
<artifactId>jmock-example</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<packaging>jar</packaging>
<name>jMock Examples</name>

<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion jmock-junit3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</parent>

<artifactId>jmock-junit3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jmock-junit4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion jmock-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
4 changes: 2 additions & 2 deletions jmock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<!-- mvn versions:set -DoldVersion=2.8.1-SNAPSHOT -DnewVersion=2.8.1
-DgroupId=org.jmock -->
<!-- find . -name pom.xml.versionsBackup -exec rm {} \; -->
Expand All @@ -32,7 +32,7 @@

<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<artifactId>cglib</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}});
Expand Down
13 changes: 5 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<packaging>pom</packaging>
<name>jMock 2 Parent</name>

Expand Down Expand Up @@ -42,10 +42,9 @@
<downloadSources>true</downloadSources>
<hamcrest.version>1.3</hamcrest.version>
<hamcrest.src>hamcrest-src</hamcrest.src>
<junit.version>4.11</junit.version>
<jmock.version>2.8.0</jmock.version>
<cglib.version>3.1</cglib.version>
<asm.version>5.0.3</asm.version>
<junit.version>4.12</junit.version>
<cglib.version>3.2.0</cglib.version>
<asm.version>5.0.4</asm.version>
<objenesis.version>2.1</objenesis.version>
<bsh.version>1.3.0</bsh.version>
</properties>
Expand Down Expand Up @@ -98,8 +97,6 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- If we use 1.5 then you can't mark interface
methods as @Override -->
<source>1.6</source>
<target>1.6</target>
</configuration>
Expand Down Expand Up @@ -173,7 +170,7 @@
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<artifactId>cglib</artifactId>
<version>${cglib.version}</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion testjar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit 974a9c6

Please sign in to comment.