From d0b65c6673a81da489e0e7b75113a1de69c05ac7 Mon Sep 17 00:00:00 2001 From: Joe Osborn Date: Fri, 6 Sep 2019 15:27:25 -0400 Subject: [PATCH] Added os test in CommandConfiguration All other OS set functions in other tests are "useless" for local tests Signed-off-by: Joe Osborn --- .../tests/commands/CommandConfigurationTest.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/org.eclipse.ice.commands/src/test/java/org/eclipse/ice/tests/commands/CommandConfigurationTest.java b/org.eclipse.ice.commands/src/test/java/org/eclipse/ice/tests/commands/CommandConfigurationTest.java index f2a430280..4a4e7c8b6 100644 --- a/org.eclipse.ice.commands/src/test/java/org/eclipse/ice/tests/commands/CommandConfigurationTest.java +++ b/org.eclipse.ice.commands/src/test/java/org/eclipse/ice/tests/commands/CommandConfigurationTest.java @@ -40,7 +40,7 @@ public void testCommandConfiguration() { config.setExecutable("./some_executable.sh"); config.setErrFileName("errorFile.txt"); config.setOutFileName("outFile.txt"); - + // Assert whether or not things are/aren't set assert (config.getOutFileName() != null); assert (config.getOS() != null); @@ -48,6 +48,14 @@ public void testCommandConfiguration() { // Didn't set working directory assert (config.getWorkingDirectory() == null); + // Assert that the default local OS is set + assert (config.getOS().equals(System.getProperty("os.name"))); + + config.setOS("JoeOsbornOS"); + + assert (config.getOS().equals("JoeOsbornOS")); + + } /** @@ -63,7 +71,7 @@ public void testGetExecutableName() { config.setInputFile("someInputFile.txt"); config.setNumProcs("1"); config.setAppendInput(true); - + config.setOS("osx"); String executable = config.getExecutableName(); assert (executable.equals("./test_code_execution.sh someInputFile.txt")); @@ -93,7 +101,7 @@ public void testGetExecutableNameSplitCommand() { splitConfig.setNumProcs("1"); splitConfig.setInputFile("inputfile.txt"); splitConfig.setInstallDirectory("~/install_dir"); - + splitConfig.setOS("osx"); String executable = splitConfig.getExecutableName(); assert (executable .equals("./dummy.sh inputfile.txt; ./next_file.sh inputfile.txt; ./other_file.sh ~/install_dir/"));