X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fbin%2FCommandLineOperationsNG.java;h=30a1b9f8188ba96ea5acf38fb1d75ea05df38f7b;hb=4b031bc957ad1c5512798c6206adac7ed0364331;hp=4d05c4eaa8e969a3920538d69248a50416521238;hpb=adff51745d97ff4fd30a188a68efa29cc83202e3;p=jalview.git diff --git a/test/jalview/bin/CommandLineOperationsNG.java b/test/jalview/bin/CommandLineOperationsNG.java index 4d05c4e..30a1b9f 100644 --- a/test/jalview/bin/CommandLineOperationsNG.java +++ b/test/jalview/bin/CommandLineOperationsNG.java @@ -39,6 +39,8 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import io.github.classgraph.ClassGraph; +import io.github.classgraph.ModuleRef; +import io.github.classgraph.ScanResult; import jalview.gui.JvOptionPane; public class CommandLineOperationsNG @@ -128,41 +130,38 @@ public class CommandLineOperationsNG public synchronized static String getClassPath() { - // if (scanner == null) - // { - // scanner = new ClassGraph(); - // ScanResult scan = scanner.scan(); - // classpath = scan.getClasspath(); - modules = ""; - // for (ModuleRef mr : scan.getModules()) - // { - // modules.concat(mr.getName()); - // } - java_exe = System.getProperty("java.home") + File.separator + "bin" - + File.separator + "java"; - - // } - - // while (classpath == null) - // { - // try - // { - // Thread.sleep(10); - // } catch (InterruptedException x) - // { - // - // } - // } + if (scanner == null) + { + scanner = new ClassGraph(); + ScanResult scan = scanner.scan(); + classpath = scan.getClasspath(); + modules = ""; + for (ModuleRef mr : scan.getModules()) + { + modules.concat(mr.getName()); + } + java_exe = System.getProperty("java.home") + File.separator + "bin" + + File.separator + "java"; + + } + + while (classpath == null) + { + try + { + Thread.sleep(10); + } catch (InterruptedException x) + { + + } + } return classpath; } private Worker getJalviewDesktopRunner(boolean withAwt, String cmd, int timeout) { - // Note: JAL-3065 - don't include quotes for lib/* because the arguments are - // not expanded by the shell - // String classpath = getClassPath(); - getClassPath(); + /* boolean win = System.getProperty("os.name").indexOf("Win") >= 0; String pwd = ""; try @@ -178,6 +177,11 @@ public class CommandLineOperationsNG String[] classpaths = new String[] { pwd + "/bin/main", pwd + "/j11lib/*", pwd + "/resources", pwd + "/help" }; String classpath = String.join(win ? ";" : ":", classpaths); + getClassPath(); + */ + // Note: JAL-3065 - don't include quotes for lib/* because the arguments are + // not expanded by the shell + String classpath = getClassPath(); String _cmd = java_exe + " " + (withAwt ? "-Djava.awt.headless=true" : "") + " -classpath " + classpath @@ -217,7 +221,7 @@ public class CommandLineOperationsNG return worker; } - @Test(groups = { "Functional" }) + @Test(groups = { "Functional", "testTask1" }) public void reportCurrentWorkingDirectory() { try @@ -322,18 +326,20 @@ public class CommandLineOperationsNG } } - @Test(groups = { "Functional" }, dataProvider = "allInputOperationsData") + @Test( + groups = + { "Functional", "testTask1" }, + dataProvider = "allInputOperationsData") public void testAllInputOperations(String expectedString, String failureMsg) { - if ("[TESTOUTPUT] arg --nousagestats was set".equals(expectedString)) - Assert.assertTrue(successfulCMDs.contains(expectedString), - failureMsg); + Assert.assertTrue(successfulCMDs.contains(expectedString), + failureMsg + "; was expecting '" + expectedString + "'"); } @Test( groups = - { "Functional" }, + { "Functional", "testTask1" }, dataProvider = "headlessModeOutputOperationsData") public void testHeadlessModeOutputOperations(String harg, String type, String fileName, boolean withAWT, int expectedMinFileSize, @@ -345,7 +351,8 @@ public class CommandLineOperationsNG file.deleteOnExit(); Worker worker = getJalviewDesktopRunner(withAWT, cmd, timeout); assertNotNull(worker, "worker is null"); - String msg = "Didn't create an output" + type + " file.[" + cmd + "]"; + String msg = "Didn't create an output" + type + " file '" + fileName + + "'. [" + cmd + "]"; assertTrue(file.exists(), msg); FileAssert.assertFile(file, msg); FileAssert.assertMinLength(file, expectedMinFileSize);