From 7c07e1d9de388048936dc0446b185eaa35b6d1a5 Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Sun, 11 Oct 2015 14:40:19 +0200 Subject: [PATCH] Invoking tests$ mvn teavm:compile teavm:testCompile teavm:test should fail with reasonable error and not NPE --- .../src/main/java/org/teavm/maven/BuildJavascriptTestMojo.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/maven/plugin/src/main/java/org/teavm/maven/BuildJavascriptTestMojo.java b/tools/maven/plugin/src/main/java/org/teavm/maven/BuildJavascriptTestMojo.java index 7b8618570..7d41f0ba8 100644 --- a/tools/maven/plugin/src/main/java/org/teavm/maven/BuildJavascriptTestMojo.java +++ b/tools/maven/plugin/src/main/java/org/teavm/maven/BuildJavascriptTestMojo.java @@ -93,6 +93,9 @@ public class BuildJavascriptTestMojo extends AbstractJavascriptMojo { setupTool(tool); try { + if (!testFiles.isDirectory()) { + throw new MojoFailureException("Directory with tests doesn't exist: " + testFiles); + } getLog().info("Searching for tests in the directory `" + testFiles.getAbsolutePath() + "'"); tool.setAdapter(createAdapter(classLoader)); findTestClasses(classLoader, testFiles, "");