On 02/09/2010, at 11:40 PM, tinca wrote:
>
> Hello,
>
> In 0.9-rc1, with the following task definition testing fails:
>
> test {
> useTestNG()
> enableAssertions = true
> ignoreFailures = true
> // use reportng stuff for better display
> options.listeners << 'org.uncommons.reportng.HTMLReporter'
> options.listeners << 'org.uncommons.reportng.JUnitXMLReporter'
> systemProperties.put("org.uncommons.reportng.stylesheet",
> "${projectDir}/resources/conf/hudsonesque.css")
> workingDir = projectDir
> }
>
>
> Execution for Test process 'Gradle Worker 1' FAILED
> org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not
> complete execution for test process 'Gradle Worker 1'.
> at
> org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:616)
> 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 $Proxy3.stop(Unknown Source)
> at
> org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:91)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:616)
> 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.remote.internal.MethodInvocationUnmarshallingDispatch.dispatch(MethodInvocationUnmarshallingDispatch.java:25)
> 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.runWorker(ThreadPoolExecutor.java:1110)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:636)
> Caused by: java.lang.NullPointerException: null
> at
> org.gradle.api.internal.tasks.testing.junit.CaptureTestOutputTestResultProcessor.completed(CaptureTestOutputTestResultProcessor.java:53)
> at
> org.gradle.api.internal.tasks.testing.testng.TestNGTestResultProcessorAdapter.onTestFinished(TestNGTestResultProcessorAdapter.java:104)
> at
> org.gradle.api.internal.tasks.testing.testng.TestNGTestResultProcessorAdapter.onTestSkipped(TestNGTestResultProcessorAdapter.java:89)
Do you have the rest of this stack trace? It would be helpful for figuring out
what went wrong here.
I don't think the problem is anything that you've done wrong. The problem is
likely in Gradle's TestNG integration. TestNG is doing something which Gradle
is not expecting, and Gradle is getting confused and ending up with a NPE. The
stack trace might be helpful in figuring out what's wrong with the integration.
Also, if you have some details about how class that was failing, that would be
useful. For example, was it failing in a @Test method? Or a
@Before/@After/@BeforeClass/@AfterClass method? What sort of exception was it?
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz