Use JUnit 4 to perform magic ‘classmethod’ test in gradle Scala unit test

I'm in Scala language extension for vert X encountered the problem of gradle, JUnit and scala test execution Recently we've been from vert x 2.1. Upgrade RC1 to 2.1.1 RC2, we began to see that in some environments, such as our cloudbees instance, the test execution seemed to use a phantom method named classmethod in the test class. The method did not exist and the test timed out As a result, the rest of the tests failed

In this console instance, you can see:

org.vertx.scala.tests.core.http.HttpTest > classMethod Failed
    java.lang.AssertionError: Timed out waiting for test to complete

We don't know what this classmethod is, where it comes from, etc What's worse, I can't copy it in my OSX and Linux (rhel7) environments, whether using JDK 1.7u45 or 1.7u51

So far, we have found that the only way to fix it is to restore to vert x 2.1. RC1 (see rc00's console of run), but we really can't see the connection between this and this mysterious classmethod

We have tried to upgrade to gradle 1.11 in case of problems with gradle itself, but we have no luck We are currently using JUnit 4.11

The only thing that seems a little suspicious is that even if the project uses Scala 2.10 4. The gradle Scala plug-in seems to be bring in zinc which appearances to need Scala 2.9 2. When I clear my locally When gradle / folder, I didn't see any Scala 2.9 2 was downloaded I wonder if this is a mess?

Finally, it seems that there is the last run of classmethod for httpcompressiontest. I compare the javap output locally with the one in cloudbees, and they look exactly the same

I have no idea. Do you have any suggestions?

Update: as a last resort, I decided to upgrade to vert x 2.1. Rc3-snapshot, which is all back to normal I have no idea why, but I will accept it:)

Solution

I've seen this behavior (unexpectedly) with two different versions of the same library on the classpath In addition, when a particular project is packaged into multiple different jars, one jar is at a lower level than the other jars

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>