From 231a53ae8530dc25df8887150ac9960efa0aa927 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 16 Apr 2019 14:09:12 +0100 Subject: [PATCH] JAL-3130 JAL-1889 report absolute paths for CommandLineTests --- test/jalview/bin/CommandLineOperations.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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); -- 1.7.10.2