@@ -144,17 +144,20 @@ public void testGetExecutablePath() throws IOException {
144144
145145 final String comSpec = System .getenv ("ComSpec" );
146146
147+ // for windows scripts cmd should be used
147148 realMojo .setExecutable ("javax.bat" );
148149 cmd = realMojo .getExecutablePath (enviro , workdir );
149- assertTrue (
150- "is bat file on windows, execute using ComSpec." ,
151- cmd .getExecutable ().equals (comSpec ));
150+ assertEquals ("is bat file on windows, execute using ComSpec." , comSpec , cmd .getExecutable ());
151+ assertEquals ("is /c argument pass using ComSpec." , "/c" , cmd .getArguments ()[0 ]);
152152
153- enviro .put ("PATH" , workdir .getAbsolutePath () + File .separator + "target" );
153+ String path = workdir .getAbsolutePath () + File .separator + "target" ;
154+ enviro .put ("Path" , path );
155+ realMojo .setExecutable ("javax" ); // FIXME javax.bat should be also allowed
154156 cmd = realMojo .getExecutablePath (enviro , workdir );
155- assertTrue (
156- "is bat file on windows' PATH, execute using ComSpec." ,
157- cmd .getExecutable ().equals (comSpec ));
157+ assertEquals ("is bat file on windows, execute using ComSpec." , comSpec , cmd .getExecutable ());
158+ assertEquals ("is /c argument pass using ComSpec." , "/c" , cmd .getArguments ()[0 ]);
159+ assertEquals ("full path is discovered." , path + File .separator + "javax.bat" , cmd .getArguments ()[1 ]);
160+
158161 f .delete ();
159162 assertFalse ("file deleted..." , f .exists ());
160163 }
0 commit comments