Groovy Eclipse can't launch junit tests

This happens normally when the folder in which test case is present is not a source folder, please check this post as well. Hope that helps!


This can also happen if there is a problem with the groovy class. A few things to check:

1) Ensure that the class name exactly matches the filename (filename = MyTest.groovy)

package com.mypackage;
import groovy.util.GroovyTestCase;

class MyTest extends GroovyTestCase {}

2) Ensure that the package defined in the file matches the package the file is actually in.


In Eclipse you can do

Right click ->  properties -> Java build path

Notice test folder is not available in sources. Add it.

Add folder -> Select test -> OK

Now rerun you unit test cases.

enter image description here