[GRADLE-1242] Gradle doesn't like calls to TestCase.setName() Created: 02/Dec/10  Updated: 04/Jan/13  Resolved: 02/Dec/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.9-rc-3
Fix Version/s: 0.9

Type: Bug
Reporter: Andres Almiray Assignee: Hans Dockter
Resolution: Fixed Votes: 1

Attachments: Zip Archive gradle-boom.zip    

 Description   

Gradle fails with an AssertionError when a TestCase changes a test's name with a direct call to setName()

Attached minimal sample project.

Execution for Test process 'Gradle Worker 1' FAILED
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not execute test class 'BoomTestCase'.
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	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.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	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.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$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)
	... 26 more


Generated at Wed Jun 30 11:50:34 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.