XtextRunner cannot be resolved to a variable [message #1062773] |
Mon, 10 June 2013 16:55 |
Mr Manner Messages: 26 Registered: January 2013 |
Junior Member |
|
|
I have the following problem in a test where I inject the "JsonInjectorProvider" and run it with "XtextRunner"
It complains about this two errors:
* JsonInjectorProvider cannot be resolved to a variable
* XtextRunner cannot be resolved to a variable
package com.test.hint.tests;
import com.test.hint.JsonInjectorProvider;
import com.test.hint.json.JsonObject;
import com.test.hint.json.Value;
import com.test.hint.schema.JsonObjectUtils;
import static org.junit.Assert.*;
import org.junit.Test;
import com.google.inject.Inject;
import org.eclipse.xtext.junit4.util.ParseHelper;
import org.eclipse.xtext.junit4.InjectWith;
import org.junit.runner.RunWith;
import org.eclipse.xtext.junit4.XtextRunner;
@InjectWith(typeof(JsonInjectorProvider))
@RunWith(typeof(XtextRunner))
class JsonObjectUtilsTest {
@Inject
private ParseHelper<JsonObject> parser;
@Test
public void getValue() {
JsonObject model = null; // parser.parse(jsonText1);
Value object1 = JsonObjectUtils.getValue(model, "version");
assertNotNull("Value not found", object1);
JsonObject object2 = (JsonObject) JsonObjectUtils.getValue(model, "usecase");
assertNotNull("Value not found", object2);
Value object3 = JsonObjectUtils.getValue(object2, "context");
assertNotNull("Value not found", object3);
Value object4 = JsonObjectUtils.getValue(model, "blablabla");
assertNull("Value should be null", object4);
}
}
Any help is welcome, thank in advance.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04121 seconds