You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2017/09/22 07:05:43 UTC

systemml git commit: [HOTFIX][SYSTEMML-1925] Fix missing update hard-coded testsuite conf

Repository: systemml
Updated Branches:
  refs/heads/master c47338400 -> 9a286a213


[HOTFIX][SYSTEMML-1925] Fix missing update hard-coded testsuite conf

This patch fixes the hard-coded scratch_space and local_tmp_dir
replacement in our test suite, which I missed during the rework of
configuration parameters.


Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/9a286a21
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/9a286a21
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/9a286a21

Branch: refs/heads/master
Commit: 9a286a2130fe09ecf1f345ab902be26f7b7c0328
Parents: c473384
Author: Matthias Boehm <mb...@gmail.com>
Authored: Fri Sep 22 00:05:35 2017 -0700
Committer: Matthias Boehm <mb...@gmail.com>
Committed: Fri Sep 22 00:05:35 2017 -0700

----------------------------------------------------------------------
 .../sysml/test/integration/AutomatedTestBase.java   | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/9a286a21/src/test/java/org/apache/sysml/test/integration/AutomatedTestBase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/AutomatedTestBase.java b/src/test/java/org/apache/sysml/test/integration/AutomatedTestBase.java
index 07802dd..5ca800b 100644
--- a/src/test/java/org/apache/sysml/test/integration/AutomatedTestBase.java
+++ b/src/test/java/org/apache/sysml/test/integration/AutomatedTestBase.java
@@ -874,13 +874,13 @@ public abstract class AutomatedTestBase
 			// Create a SystemML config file for this test case based on default template
 			// from src/test/config or derive from custom configuration provided by test.
 			String configTemplate = FileUtils.readFileToString(getConfigTemplateFile(), "UTF-8");
-
 			String localTemp = curLocalTempDir.getPath();
-			String configContents = configTemplate.replace("<scratch>scratch_space</scratch>",
-					String.format("<scratch>%s/scratch_space</scratch>", localTemp));
-			configContents = configContents.replace("<localtmpdir>/tmp/systemml</localtmpdir>",
-					String.format("<localtmpdir>%s/localtmp</localtmpdir>", localTemp));
-
+			String configContents = configTemplate
+				.replace(createXMLElement(DMLConfig.SCRATCH_SPACE, "scratch_space"),
+					createXMLElement(DMLConfig.SCRATCH_SPACE, localTemp+"/scratch_space"))
+				.replace(createXMLElement(DMLConfig.LOCAL_TMP_DIR, "/tmp/systemml"),
+					createXMLElement(DMLConfig.LOCAL_TMP_DIR, localTemp+"/localtmp"));
+			
 			FileUtils.write(getCurConfigFile(), configContents, "UTF-8");
 
 			System.out.printf("This test case will use SystemML config file %s\n", getCurConfigFile());
@@ -892,7 +892,9 @@ public abstract class AutomatedTestBase
 			TestUtils.clearDirectory(DEBUG_TEMP_DIR + baseDirectory + INPUT_DIR);
 	}
 
-
+	public String createXMLElement(String tagName, String value) {
+		return String.format("<%s>%s</%s>",tagName, value, tagName);
+	}
 
 	/**
 	 * <p>