diff --git a/src/main/java/eu/stamp_project/testrunner/EntryPoint.java b/src/main/java/eu/stamp_project/testrunner/EntryPoint.java index a56eeb8b..0e1575f1 100644 --- a/src/main/java/eu/stamp_project/testrunner/EntryPoint.java +++ b/src/main/java/eu/stamp_project/testrunner/EntryPoint.java @@ -183,11 +183,13 @@ public static TestResult runTests(String classpath, String[] fullQualifiedNameOf ParserOptions.FLAG_fullQualifiedNameOfTestClassToRun, String.join(ConstantsHelper.PATH_SEPARATOR, fullQualifiedNameOfTestClasses), methodNames.length == 0 ? "" - : ParserOptions.FLAG_testMethodNamesToRun + ConstantsHelper.WHITE_SPACE - + String.join(ConstantsHelper.PATH_SEPARATOR, methodNames), + : (ParserOptions.FLAG_testMethodNamesToRun + ConstantsHelper.WHITE_SPACE + + String.join(ConstantsHelper.PATH_SEPARATOR, methodNames)), EntryPoint.blackList.isEmpty() ? "" : (ParserOptions.FLAG_blackList + ConstantsHelper.WHITE_SPACE - + String.join(ConstantsHelper.PATH_SEPARATOR, EntryPoint.blackList)) }); + + String.join(ConstantsHelper.PATH_SEPARATOR, EntryPoint.blackList)) + } + ); return EntryPoint.runTests(javaCommand); } @@ -264,10 +266,11 @@ public static Coverage runCoverage(String classpath, String targetProjectClasses EntryPoint.JACOCO_RUNNER_QUALIFIED_NAME, ParserOptions.FLAG_pathToCompiledClassesOfTheProject, targetProjectClasses, ParserOptions.FLAG_fullQualifiedNameOfTestClassToRun, String.join(ConstantsHelper.PATH_SEPARATOR, fullQualifiedNameOfTestClasses), - methodNames.length == 0 ? "" : ParserOptions.FLAG_testMethodNamesToRun, - String.join(ConstantsHelper.PATH_SEPARATOR, methodNames), - EntryPoint.blackList.isEmpty() ? "" - : (ParserOptions.FLAG_blackList + ConstantsHelper.WHITE_SPACE + methodNames.length == 0 ? "" : + (ParserOptions.FLAG_testMethodNamesToRun + ConstantsHelper.WHITE_SPACE + + String.join(ConstantsHelper.PATH_SEPARATOR, methodNames)), + EntryPoint.blackList.isEmpty() ? "" : + (ParserOptions.FLAG_blackList + ConstantsHelper.WHITE_SPACE + String.join(ConstantsHelper.PATH_SEPARATOR, EntryPoint.blackList)), EntryPoint.jUnit5Mode ? ParserOptions.FLAG_isJUnit5 : "" }); return EntryPoint.runCoverage(javaCommand); @@ -351,8 +354,8 @@ public static CoveragePerTestMethod runCoveragePerTestMethods(String classpath, EntryPoint.JACOCO_RUNNER_PER_TEST_QUALIFIED_NAME, ParserOptions.FLAG_pathToCompiledClassesOfTheProject, targetProjectClasses, ParserOptions.FLAG_fullQualifiedNameOfTestClassToRun, String.join(ConstantsHelper.PATH_SEPARATOR, fullQualifiedNameOfTestClasses), - methodNames.length == 0 ? "" : ParserOptions.FLAG_testMethodNamesToRun, - String.join(ConstantsHelper.PATH_SEPARATOR, methodNames), + methodNames.length == 0 ? "" : ParserOptions.FLAG_testMethodNamesToRun + ConstantsHelper.WHITE_SPACE + + String.join(ConstantsHelper.PATH_SEPARATOR, methodNames), EntryPoint.blackList.isEmpty() ? "" : (ParserOptions.FLAG_blackList + ConstantsHelper.WHITE_SPACE + String.join(ConstantsHelper.PATH_SEPARATOR, EntryPoint.blackList)), @@ -429,7 +432,7 @@ private static void runGivenCommandLine(String commandLine) throws TimeoutExcept /** * This method redirect Process IO to given destination using pipes - * + * * @param src * process input stream * @param dest diff --git a/src/main/java/eu/stamp_project/testrunner/runner/ParserOptions.java b/src/main/java/eu/stamp_project/testrunner/runner/ParserOptions.java index 20b832ab..0fe77fc4 100644 --- a/src/main/java/eu/stamp_project/testrunner/runner/ParserOptions.java +++ b/src/main/java/eu/stamp_project/testrunner/runner/ParserOptions.java @@ -40,6 +40,9 @@ public static ParserOptions parse(String[] args) { case FLAG_isJUnit5: parserOptions.isJUnit5 = true; break; + case " ": + case "": + break; default: System.err.println(String.format("[ERROR]: %s is not a supported command line options", args[i])); usage(); diff --git a/src/main/resources/runner-classes/eu/stamp_project/testrunner/runner/ParserOptions.class b/src/main/resources/runner-classes/eu/stamp_project/testrunner/runner/ParserOptions.class index ecd3bce9..428da275 100644 Binary files a/src/main/resources/runner-classes/eu/stamp_project/testrunner/runner/ParserOptions.class and b/src/main/resources/runner-classes/eu/stamp_project/testrunner/runner/ParserOptions.class differ