Hi all,
I recently started a conversion of Json-lib's build from a (rather gnarly)
combination of Ant and Maven to Gradle.
At the moment only the code compatible with jdk1.3 is compiled and tested and
that's when I hit a wall: there's a single test that fails with the following
error
Execution for Test process 'Gradle Worker 1' FAILED
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not
execute test class 'net.sf.json.TestJSONSerializer'.
at
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:32)
at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:23)
at
org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at
org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:75)
at $Proxy4.processTestClass(Unknown Source)
at
org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:86)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:32)
at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:23)
at
org.gradle.messaging.remote.internal.MethodInvocationUnmarshallingDispatch.dispatch(MethodInvocationUnmarshallingDispatch.java:48)
at
org.gradle.messaging.dispatch.DiscardOnFailureDispatch.dispatch(DiscardOnFailureDispatch.java:31)
at
org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:131)
at
org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:35)
at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:71)
at
org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.AssertionError
at
org.gradle.api.internal.tasks.testing.junit.JUnitTestResultProcessorAdapter.endTest(JUnitTestResultProcessorAdapter.java:94)
at junit.framework.TestResult.endTest(TestResult.java:72)
at
junit.framework.JUnit4TestAdapterCache$1.testFinished(JUnit4TestAdapterCache.java:57)
at
org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:145)
at
org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41)
at
org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:142)
at
org.junit.internal.runners.JUnit38ClassRunner$OldTestClassAdaptingListener.endTest(JUnit38ClassRunner.java:31)
at junit.framework.TestResult.endTest(TestResult.java:72)
at junit.framework.TestResult.run(TestResult.java:111)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at
org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:54)
at
org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:63)
at
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
... 23 more
This error will occur even if running the failing test in isolation using
-Dtest.single. I'm beginning to think there might be a hidden bug in my code
that only came to the surface giving Gradle's test parallelizing support, but I
could be wrong.
Any help will be appreciated. The code by the way is located at
https://github.com/aalmiray/Json-lib
Thanks!
Andres