Bug 548474

Summary: [JUnit]Error running spock example testcase
Product: [Eclipse Project] JDT Reporter: Gautam K Singh <gksinghiet>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: florin.jurcovici
Version: 4.12   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard: stalebug
Attachments:
Description Flags
Error screenshot1
none
Error screenshot2 none

Description Gautam K Singh CLA 2019-06-20 12:04:51 EDT
Created attachment 279029 [details]
Error screenshot1

When running a Spock Testcase for example project I am getting following error:

"The input type of the launch configuration does not exist"

The same testcase is working fine with Intel IdeaJ.

TestCase: https://github.com/spockframework/spock-example/blob/master/src/test/groovy/PublisherSubscriberSpec.groovy

Steps: 
1. Right click on PublisherSubscriberSpec.groovy
2. Click Run As > JUnit Test
3. Getting error "The input type of the launch configuration does not exist" (See attached screenshot)
4. Click OK
5. Manage Configuration dialog opens
complaining "Can not find test class 'PublisherSpec' in project 'spock-example'"  (See attached screenshot)
Comment 1 Gautam K Singh CLA 2019-06-20 12:06:05 EDT
Created attachment 279030 [details]
Error screenshot2
Comment 2 Gautam K Singh CLA 2019-06-20 12:10:04 EDT
Eclipse Version: 2019-06 (4.12.0)
JDK: openjdk 12.0.1 
Eclipse Groovy Development Tools Version: 3.4.0.v201906191840-e1906
Comment 3 Florin Jurcovici CLA 2020-05-18 18:56:53 EDT
I think I found something similar happening with Java tests - and I found the reason too.

Test classes don't have to be public, with the new Java jupiter junit unit testing framework.

If your test class is package private, and named XYZ, it is perfectly legal to have no other class in the file ABC.java, for the compiler. But when you try to run the test, Eclipse looks for test methods on the class ABC - which has no implementation anywhere. So the test fails with that message.

I don't know if it's something similar with groovy. But might also be related to how Eclipse identifies the test methods to run.
Comment 4 Eclipse Genie CLA 2022-05-10 13:45:43 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2024-04-30 13:01:36 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.