SLIDER-863 TestPackageCommandOptions

Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/98e3244a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/98e3244a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/98e3244a

Branch: refs/heads/develop
Commit: 98e3244a1db04e158becc907975c3334f49626e9
Parents: 6997d0c
Author: Steve Loughran <[email protected]>
Authored: Tue Apr 28 22:33:43 2015 +0100
Committer: Steve Loughran <[email protected]>
Committed: Tue Apr 28 22:33:43 2015 +0100

----------------------------------------------------------------------
 .../slider/providers/agent/AgentClientProvider.java   | 14 +++++++-------
 .../slider/agent/AgentMiniClusterTestBase.groovy      | 11 +++++++----
 .../slider/client/TestPackageCommandOptions.groovy    |  3 ++-
 3 files changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/98e3244a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
----------------------------------------------------------------------
diff --git 
a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
 
b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
index 0c1389f..f52d2eb 100644
--- 
a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
+++ 
b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
@@ -437,13 +437,13 @@ public class AgentClientProvider extends 
AbstractClientProvider
       String clientScriptPath = appPkgDir.getAbsolutePath() + File.separator + 
"package" +
                                 File.separator + clientScript;
       List<String> command = Arrays.asList(AgentKeys.PYTHON_EXE,
-                                           "-S",
-                                           clientScriptPath,
-                                           "INSTALL",
-                                           cmdDir.getAbsolutePath() + 
File.separator + "command.json",
-                                           appPkgDir.getAbsolutePath() + 
File.separator + "package",
-                                           cmdDir.getAbsolutePath() + 
File.separator + "command-out.json",
-                                           "DEBUG");
+               "-S",
+               clientScriptPath,
+               "INSTALL",
+               cmdDir.getAbsolutePath() + File.separator + "command.json",
+               appPkgDir.getAbsolutePath() + File.separator + "package",
+               cmdDir.getAbsolutePath() + File.separator + "command-out.json",
+               "DEBUG");
       ProcessBuilder pb = new ProcessBuilder(command);
       log.info("Command: " + StringUtils.join(pb.command(), " "));
       pb.environment().put(SliderKeys.PYTHONPATH,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/98e3244a/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
 
b/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
index b4abf6f..a7bc0a3 100644
--- 
a/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
+++ 
b/slider-core/src/test/groovy/org/apache/slider/agent/AgentMiniClusterTestBase.groovy
@@ -61,7 +61,8 @@ extends YarnZKMiniClusterTestBase {
   @BeforeClass
   public static void createSubConfFiles() {
 
-    File destDir = new File("target/agent_minicluster_testbase")
+    String s = File.separator
+    File destDir = new File("target${s}agent_minicluster_testbase")
     destDir.mkdirs()
     agentConf = new File(destDir, "agentconf.zip")
     agentConf.createNewFile()
@@ -72,7 +73,7 @@ extends YarnZKMiniClusterTestBase {
     tempFolder.create()
     def pkgPath = tempFolder.newFolder("testpkg")
     File imagePath = new File(pkgPath, "appdef_1.zip").canonicalFile
-    File metainfo = new File(new File(".").absoluteFile, 
"src/test/python/metainfo.xml");
+    File metainfo = new File(new File(".").absoluteFile, 
"src${s}test${s}python${s}metainfo.xml");
     ZipArchiveOutputStream zipFile = new ZipArchiveOutputStream(new 
FileOutputStream(imagePath));
     try {
       zipFile.putArchiveEntry(new ZipArchiveEntry(metainfo.name));
@@ -105,7 +106,9 @@ extends YarnZKMiniClusterTestBase {
   }
 
   public static String createAddOnPackageFiles() {
-    File destDir = new File("target/agent_minicluster_testbase_addon")
+    String s = File.separator
+
+    File destDir = new File("target${s}agent_minicluster_testbase_addon")
     destDir.mkdirs()
     File addonAgentConf = new File(destDir, "addon1.zip")
     addonAgentConf.createNewFile()
@@ -116,7 +119,7 @@ extends YarnZKMiniClusterTestBase {
     def pkgPath = addonTempFolder.newFolder("testpkg")
     File imagePath = new File(pkgPath, "appdef_1.zip").canonicalFile
     File metainfo = new File(new File(".").absoluteFile,
-      "src/test/python/metainfo.xml");
+      "src${s}test${s}python${s}metainfo.xml");
     ZipArchiveOutputStream zipFile = new ZipArchiveOutputStream(
       new FileOutputStream(imagePath));
     try {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/98e3244a/slider-core/src/test/groovy/org/apache/slider/client/TestPackageCommandOptions.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/client/TestPackageCommandOptions.groovy
 
b/slider-core/src/test/groovy/org/apache/slider/client/TestPackageCommandOptions.groovy
index efb5e5c..13d0190 100644
--- 
a/slider-core/src/test/groovy/org/apache/slider/client/TestPackageCommandOptions.groovy
+++ 
b/slider-core/src/test/groovy/org/apache/slider/client/TestPackageCommandOptions.groovy
@@ -99,7 +99,8 @@ class TestPackageCommandOptions extends 
AgentMiniClusterTestBase {
 
     // get the default application.def file and install it as a package
     String appDefPath = agentDefOptions.getAt(AgentKeys.APP_DEF)
-    File appDefFile = new File(new URI(appDefPath))
+    File appDefFile = new File(new URI(appDefPath).path)
+    assert appDefFile.exists()
     YarnConfiguration conf = SliderUtils.createConfiguration()
     ServiceLauncher<SliderClient> launcher = launch(TestSliderClient,
         conf,

Reply via email to