I'm using IntelliJ 2018.1 and I am trying to run a TeaVM JUnit test but when running the test from CTRL + SHIFT + F10 tests are getting skipped:
@RunWith(TeaVMTestRunner.class)
@SkipJVM
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ShapeTest {
static final Logger logger = Logger.getLogger(ShapeTest.class.getName());
@Rule
public final ExpectedException exception = ExpectedException.none();
@Test
public void testGet() {
System.out.println("ShapeTest - testGet");
String response = Shape.get("https://httpbin.org/get")
.header("accept", "application/json")
.header("Content-Type", "application/json")
.asJson();
JSONObject json = new JSONObject(response);
String url = json.getString("url");
JSONObject headers = json.getJSONObject("headers");
assertNotNull(json);
assertNotNull(url);
assertNotNull(headers);
System.out.println(json.toString());
}
}
But when running from terminal using this command below, it works:
mvn test -Dteavm.junit.target=target/js-tests -Dteavm.junit.js.runner=h
tmlunit -Dteavm.junit.js.threads=2
Any IntelliJ/JUnit expert here that may have some idea why is this happening?
You can specify the same
-Dparameters in Run configuration settings. Press "Run" (Alt+Shift+F10 on Windows, Ctrl+Alt+R on Mac), select your run configuration, Right arrow, Edit:Then specify all
-Dparameters under VM options:After that, the options will be passed to TeaVM Runner just like it works with
mvn testcommand.