Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1.0Release
-
Fix Version/s: 2.1.1Release
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Create a groovy class:
package Y
class X {
def foo() {
}
def foo1(a) {
}
def foo2(a,b) {
}
def foo3(a,b,c) {
}
}
Now invoke the New Groovy Test Case wizard and select the above class as the one to test. Click next and select the creation of the test methods.
The resulting file will look like this. Notice that the last test method is outside the definition of XTest:
package Y; import static org.junit.Assert.*; import java.lang.*; import org.junit.Test; class XTest4 { @Test public void testFoo() { fail("Not yet implemented"); } @Test public void testFoo1() { fail("Not yet implemented"); } @Test public void testFoo2() { fail("Not yet implemented"); } } @Test public void testFoo3(){ fail("Not yet implemented"); }
The problem here looks like the end location of the testFoo2 method in the JDT model is incorrect. It is 246, but should be 244. More precisely, it is the length of the method that is off by 2. This must be coming from AntlrPluginParser somewhere.