SLIDER-375 path fixup for windows
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/aceab6ba Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/aceab6ba Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/aceab6ba Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry Commit: aceab6ba942fb5e6c338570e030b4e09dce609eb Parents: 26ec0d0 Author: Steve Loughran <ste...@apache.org> Authored: Fri Aug 29 12:42:28 2014 +0100 Committer: Steve Loughran <ste...@apache.org> Committed: Fri Aug 29 13:19:00 2014 +0100 ---------------------------------------------------------------------- .../slider/providers/agent/TestAgentAMManagementWS.groovy | 8 +++++--- .../apache/slider/providers/agent/TestAgentEcho.groovy | 6 +++--- .../registry/curator/TestRegistryRestResources.groovy | 6 +++--- .../web/rest/publisher/TestPublisherRestResources.groovy | 10 +++------- .../groovy/org/apache/slider/test/SliderTestUtils.groovy | 9 +++++++++ 5 files changed, 23 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/aceab6ba/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy index 4e7b5b9..6720bda 100644 --- a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy @@ -117,9 +117,9 @@ class TestAgentAMManagementWS extends AgentTestBase { roles, [ ARG_OPTION, PACKAGE_PATH, slider_core.absolutePath, - ARG_OPTION, APP_DEF, app_def_path.absoluteFile.toURI().toString(), - ARG_OPTION, AGENT_CONF, agt_conf_path.absoluteFile.toURI().toString(), - ARG_OPTION, AGENT_VERSION, agt_ver_path.absoluteFile.toURI().toString(), + ARG_OPTION, APP_DEF, toURIArg(app_def_path), + ARG_OPTION, AGENT_CONF, toURIArg(agt_conf_path), + ARG_OPTION, AGENT_VERSION, toURIArg(agt_ver_path), ], true, true, true) @@ -163,4 +163,6 @@ class TestAgentAMManagementWS extends AgentTestBase { assert RegistrationStatus.FAILED == response.getResponseStatus(); } + + } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/aceab6ba/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentEcho.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentEcho.groovy b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentEcho.groovy index a29c8cb..a7b5fe3 100644 --- a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentEcho.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentEcho.groovy @@ -72,9 +72,9 @@ class TestAgentEcho extends AgentTestBase { roles, [ ARG_OPTION, PACKAGE_PATH, slider_core.absolutePath, - ARG_OPTION, APP_DEF, "file://" + app_def_path.absolutePath, - ARG_OPTION, AGENT_CONF, "file://" + agt_conf_path.absolutePath, - ARG_OPTION, AGENT_VERSION, "file://" + agt_ver_path.absolutePath, + ARG_OPTION, APP_DEF, toURIArg(app_def_path), + ARG_OPTION, AGENT_CONF, toURIArg(agt_conf_path), + ARG_OPTION, AGENT_VERSION, toURIArg(agt_ver_path), ARG_RES_COMP_OPT, role, ResourceKeys.COMPONENT_PRIORITY, "1", ARG_COMP_OPT, role, SCRIPT_PATH, echo_py, ARG_COMP_OPT, role, SERVICE_NAME, "Agent", http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/aceab6ba/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy b/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy index 1a1e5aa..0b77adc 100644 --- a/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/registry/curator/TestRegistryRestResources.groovy @@ -88,9 +88,9 @@ class TestRegistryRestResources extends AgentTestBase { roles, [ ARG_OPTION, PACKAGE_PATH, slider_core.absolutePath, - ARG_OPTION, APP_DEF, "file://" + app_def_path.absolutePath, - ARG_OPTION, AGENT_CONF, "file://" + agt_conf_path.absolutePath, - ARG_OPTION, AGENT_VERSION, "file://" + agt_ver_path.absolutePath, + ARG_OPTION, APP_DEF, toURIArg(app_def_path), + ARG_OPTION, AGENT_CONF, toURIArg(agt_conf_path), + ARG_OPTION, AGENT_VERSION, toURIArg(agt_ver_path), ], true, true, true) http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/aceab6ba/slider-core/src/test/groovy/org/apache/slider/server/appmaster/web/rest/publisher/TestPublisherRestResources.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/web/rest/publisher/TestPublisherRestResources.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/web/rest/publisher/TestPublisherRestResources.groovy index 0f2014d..44f1214 100644 --- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/web/rest/publisher/TestPublisherRestResources.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/web/rest/publisher/TestPublisherRestResources.groovy @@ -72,9 +72,9 @@ class TestPublisherRestResources extends AgentTestBase { [ ARG_PROVIDER, "org.apache.slider.server.appmaster.web.rest.publisher.TestSliderProviderFactory", ARG_OPTION, PACKAGE_PATH, slider_core.absolutePath, - ARG_OPTION, APP_DEF, toFileURI(app_def_path), - ARG_OPTION, AGENT_CONF, toFileURI(agt_conf_path), - ARG_OPTION, AGENT_VERSION, toFileURI(agt_ver_path) + ARG_OPTION, APP_DEF, toURIArg(app_def_path), + ARG_OPTION, AGENT_CONF, toURIArg(agt_conf_path), + ARG_OPTION, AGENT_VERSION, toURIArg(agt_ver_path) ], true, true, true) @@ -145,8 +145,4 @@ class TestPublisherRestResources extends AgentTestBase { } } - public String toFileURI(File filename) { - filename.toURI().toString() - } - } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/aceab6ba/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy index 0036db7..58a76af 100644 --- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy @@ -776,4 +776,13 @@ class SliderTestUtils extends Assert { killJavaProcesses(grep,signal) } } + + /** + * Convert a file to a URI suitable for use in an argument + * @param file file + * @return a URI string valid on all platforms + */ + public String toURIArg(File file) { + file.absoluteFile.toURI().toString() + } }