From 5f36d6599e6db9f03051bb92ecfac76c2d2cdcaa Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Tue, 17 Jul 2012 15:13:55 +0000 Subject: QPID-4103: now getting test file paths as URIs instead of URLs so that they still work when the path contains spaces. Applied patch from Philip Harvey . git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1362536 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/disttest/controller/config/ConfigReaderTest.java | 2 +- .../disttest/controller/config/JavaScriptConfigEvaluatorTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'java') diff --git a/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/ConfigReaderTest.java b/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/ConfigReaderTest.java index e7b6cdd3c6..257f139849 100644 --- a/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/ConfigReaderTest.java +++ b/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/ConfigReaderTest.java @@ -111,7 +111,7 @@ public class ConfigReaderTest extends TestCase public void testReadsJS() throws Exception { ConfigReader configReader = new ConfigReader(); - String path = getClass().getResource("ConfigReaderTest-test-config.js").getPath(); + String path = getClass().getResource("ConfigReaderTest-test-config.js").toURI().getPath(); _config = configReader.getConfigFromFile(path); List testConfigs = _config.getTestConfigs(); assertEquals("Unexpected number of tests", 2, testConfigs.size()); diff --git a/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/JavaScriptConfigEvaluatorTest.java b/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/JavaScriptConfigEvaluatorTest.java index 6d4b3f6290..7edb62f060 100644 --- a/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/JavaScriptConfigEvaluatorTest.java +++ b/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/JavaScriptConfigEvaluatorTest.java @@ -33,14 +33,14 @@ public class JavaScriptConfigEvaluatorTest extends TestCase { public void testEvaluateJavaScript() throws Exception { - String jsFilePath = getClass().getResource("JavaScriptConfigEvaluatorTest-test-config.js").getPath(); + String jsFilePath = getClass().getResource("JavaScriptConfigEvaluatorTest-test-config.js").toURI().getPath(); String rawConfig = new JavaScriptConfigEvaluator().evaluateJavaScript(jsFilePath); String config = formatForComparison(rawConfig); assertTrue(config.contains("\"_iterationNumber\":1")); - File expectedJsonFile = new File(getClass().getResource("JavaScriptConfigEvaluatorTest-expected-json.json").getPath()); + File expectedJsonFile = new File(getClass().getResource("JavaScriptConfigEvaluatorTest-expected-json.json").toURI().getPath()); String rawExpected = FileUtils.readFileAsString(expectedJsonFile); String expected = formatForComparison(rawExpected); -- cgit v1.2.1