Java Mailing List Archive

http://www.gg3721.com/

Home » user.jmock »

[jmock-user] 2.6.0-RC2 depends upon junit:junit-dep:4.4, which doesn't include org.junit.runners.BlockJUnit4ClassRunner

Duncan Jones

2012-02-29


Author LoginPost Reply
Hi,

I'm usingĀ 2.6.0-RC2, sourced from a Maven repository. I've noticed
that org.jmock.integration.junit4.JMock extends
org.junit.runners.BlockJUnit4ClassRunner, which is not present in the
version of JUnit that JMock depends upon.

The `jmock-junit4' POM file contains:

  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit-dep</artifactId>
   <version>4.4</version>
  </dependency>

As a result, when I attempt to execute test classes that have
`@(protected)
BlockJUnit4ClassRunner class. To solve this, I've had to add a
dependency on a more modern version of JUnit to my project POM, and
specifically exclude this version of junit-dep.

So this:

  <dependency>
   <groupId>org.jmock</groupId>
   <artifactId>jmock-junit4</artifactId>
   <version>2.6.0-RC2</version>
   <scope>test</scope>
  </dependency>

has become this:

  <dependency>
   <groupId>org.jmock</groupId>
   <artifactId>jmock-junit4</artifactId>
   <version>2.6.0-RC2</version>
   <scope>test</scope>
   <exclusions>
    <exclusion>
      <groupId>junit</groupId>
      <artifactId>junit-dep</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.hamcrest</groupId>
   <artifactId>hamcrest-core</artifactId>
   <version>1.3.RC2</version>
   <scope>test</scope>
  </dependency>
  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.9</version>
   <scope>test</scope>
  </dependency>

Note that I also had to specifically reference the hamcrest-core
dependency to avoid other errors. Have I done something wrong that has
caused the need for all my workarounds?

Thanks,

Duncan

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.