msbarry/Xtest — Issue #6: Xtest files don't recognize types from other packages
Author: msbarry
Created: 2012-03-02 12:17:38+00:00
State: open

Setup:

In project "Other Project":
package test;
public class OtherClass {
public static int get() {
return 1;
}
}

In project "Xtest Demo":
import test.*
testSuite suite {
testCase testPasses {
assert OtherClass::get == 2
}
}

The xtest file passes initial validation, but then "OtherClass::get" is marked with the following error when the test actually runs:
suite.testPasses: java.lang.NoSuchMethodException: Could not find method test.OtherClass.get()
org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:670)
org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._featureCallOperation(XbaseInterpreter.java:663)
sun.reflect....

It appears that the code in UiXTestRunner.java, getInterpreter is getting null for the other java project and can't recognize it properly.