From: Jim Procter Date: Tue, 16 Apr 2019 13:09:12 +0000 (+0100) Subject: JAL-3130 JAL-1889 report absolute paths for CommandLineTests X-Git-Tag: Release_2_11_0~17^2~7^2~30 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=231a53ae8530dc25df8887150ac9960efa0aa927;p=jalview.git JAL-3130 JAL-1889 report absolute paths for CommandLineTests --- diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index 716b504..b5b7fe4 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -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);