JAL-3130 JAL-1889 report absolute paths for CommandLineTests
authorJim Procter <jprocter@issues.jalview.org>
Tue, 16 Apr 2019 13:09:12 +0000 (14:09 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 16 Apr 2019 13:09:12 +0000 (14:09 +0100)
test/jalview/bin/CommandLineOperations.java

index 716b504..b5b7fe4 100644 (file)
@@ -29,6 +29,8 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 
 import org.testng.Assert;
@@ -193,7 +195,16 @@ public class CommandLineOperations
     }
     return worker;
   }
-
+  @BeforeTest(alwaysRun=true)
+  {
+      try {
+          Path currentRelativePath = Paths.get("");
+          String s = currentRelativePath.toAbsolutePath().toString();
+          System.out.println("Test CWD is "+s);
+      } catch (Exception q) {
+          q.printStackTrace();
+      }
+  }
   @BeforeTest(alwaysRun = true)
   public void initialize()
   {
@@ -265,8 +276,7 @@ public class CommandLineOperations
     file.deleteOnExit();
     Worker worker = getJalviewDesktopRunner(withAWT, cmd, timeout);
     assertNotNull(worker, "worker is null");
-    String msg = "Didn't create an output" + type + " file at '"
-            + file.getAbsolutePath() + "'.[" + harg + "]";
+    String msg = "Didn't create an output" + type + " file.[" + harg + "]";
     assertTrue(file.exists(), msg);
     FileAssert.assertFile(file, msg);
     FileAssert.assertMinLength(file, expectedMinFileSize);