You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/08/29 14:20:05 UTC

[1/5] git commit: SLIDER-375 skip bits of TestPublisherURIs on windows

Repository: incubator-slider
Updated Branches:
  refs/heads/develop 8bfd66e81 -> c91d5ecd3


SLIDER-375 skip bits of TestPublisherURIs on 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/c40e480e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/c40e480e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/c40e480e

Branch: refs/heads/develop
Commit: c40e480e32d647451a87a80dcba01533b99c0d4f
Parents: 6797222
Author: Steve Loughran <st...@apache.org>
Authored: Fri Aug 29 12:16:28 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Fri Aug 29 13:18:59 2014 +0100

----------------------------------------------------------------------
 .../publisher/TestPublisherRestResources.groovy     | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/c40e480e/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 21881be..0f2014d 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
@@ -23,6 +23,7 @@ import com.sun.jersey.api.client.ClientResponse
 import com.sun.jersey.api.client.WebResource
 import groovy.transform.CompileStatic
 import groovy.util.logging.Slf4j
+import org.apache.hadoop.util.Shell
 import org.apache.slider.api.StatusKeys
 import org.apache.slider.client.SliderClient
 import org.apache.slider.core.main.ServiceLauncher
@@ -134,13 +135,14 @@ class TestPublisherRestResources extends AgentTestBase {
     Set uris = webResource.type(MediaType.APPLICATION_JSON)
             .get(Set.class)
     assert uris.size() > 0
-    log.info("Classpath URIs: {}", uris)
-    // check for some expected classpath elements
-    assert uris.any {it =~ /curator-x-discovery/}
-    assert uris.any {it =~ /hadoop-yarn-api/}
-    assert uris.any {it =~ /hadoop-hdfs/}
-    // and a negative test...
-    assert !uris.any {it =~ /foo-bar/}
+    if (!Shell.WINDOWS) {
+      log.info("Classpath URIs: {}", uris)
+      // check for some expected classpath elements
+      assert uris.any {it =~ /hadoop-yarn-api/}
+      assert uris.any {it =~ /hadoop-hdfs/}
+      // and a negative test...
+      assert !uris.any {it =~ /foo-bar/}
+    }
   }
 
   public String toFileURI(File filename) {


[4/5] git commit: SLIDER-375 path fixup for windows

Posted by st...@apache.org.
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/develop
Commit: aceab6ba942fb5e6c338570e030b4e09dce609eb
Parents: 26ec0d0
Author: Steve Loughran <st...@apache.org>
Authored: Fri Aug 29 12:42:28 2014 +0100
Committer: Steve Loughran <st...@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()
+  }
 }


[2/5] git commit: SLIDER-375 TestLongLivedProcess needed windows command translation

Posted by st...@apache.org.
SLIDER-375 TestLongLivedProcess needed windows command translation


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

Branch: refs/heads/develop
Commit: 6797222c92b887ffadb066251b5886787bb4cf44
Parents: 8bfd66e
Author: Steve Loughran <st...@apache.org>
Authored: Thu Aug 28 19:15:14 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Fri Aug 29 13:18:59 2014 +0100

----------------------------------------------------------------------
 .../workflow/ProcessCommandFactory.java         | 21 ++++++++++++++------
 .../services/workflow/TestLongLivedProcess.java |  6 ++----
 .../workflow/WorkflowServiceTestBase.java       |  3 ++-
 3 files changed, 19 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6797222c/slider-core/src/test/java/org/apache/slider/server/services/workflow/ProcessCommandFactory.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/ProcessCommandFactory.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/ProcessCommandFactory.java
index 45fdc86..4a19417 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/ProcessCommandFactory.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/ProcessCommandFactory.java
@@ -18,8 +18,11 @@
 
 package org.apache.slider.server.services.workflow;
 
+import org.apache.hadoop.util.Shell;
+
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -37,10 +40,12 @@ public class ProcessCommandFactory {
    * @return commands
    */
   public List<String> ls(File dir) {
-    List<String> commands = new ArrayList<String>(5);
-    commands.add("ls");
-    commands.add("-1");
-    commands.add(dir.getAbsolutePath());
+    List<String> commands;
+    if (!Shell.WINDOWS) {
+      commands = Arrays.asList("ls","-1", dir.getAbsolutePath());
+    } else {
+      commands = Arrays.asList("cmd", "/c", "dir", dir.getAbsolutePath());
+    }
     return commands;
   }
 
@@ -61,8 +66,12 @@ public class ProcessCommandFactory {
    * @return commands
    */
   public List<String> env() {
-    List<String> commands = new ArrayList<String>(1);
-    commands.add("env");
+    List<String> commands;
+    if (!Shell.WINDOWS) {
+      commands = Arrays.asList("env");
+    } else {
+      commands = Arrays.asList("cmd", "/c", "set");
+    }
     return commands;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6797222c/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
index 668bcca..9019124 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
@@ -33,11 +33,9 @@ import java.util.List;
  */
 public class TestLongLivedProcess extends WorkflowServiceTestBase implements
     LongLivedProcessLifecycleEvent {
-  private static final Logger
-      log = LoggerFactory.getLogger(TestLongLivedProcess.class);
+  private static final Logger log = LoggerFactory.getLogger(TestLongLivedProcess.class);
 
-  private static final Logger
-      processLog =
+  private static final Logger processLog =
       LoggerFactory.getLogger("org.apache.hadoop.services.workflow.Process");
 
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6797222c/slider-core/src/test/java/org/apache/slider/server/services/workflow/WorkflowServiceTestBase.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/WorkflowServiceTestBase.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/WorkflowServiceTestBase.java
index 3049d8f..f38bd9d 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/WorkflowServiceTestBase.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/WorkflowServiceTestBase.java
@@ -29,6 +29,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.List;
+import java.util.Locale;
 import java.util.concurrent.Callable;
 
 /**
@@ -122,7 +123,7 @@ public abstract class WorkflowServiceTestBase extends Assert {
     boolean found = false;
     StringBuilder builder = new StringBuilder();
     for (String s : output) {
-      builder.append(s).append('\n');
+      builder.append(s.toLowerCase(Locale.ENGLISH)).append('\n');
       if (s.contains(text)) {
         found = true;
         break;


[3/5] git commit: SLIDER-375 test getting its args wrong on windows

Posted by st...@apache.org.
SLIDER-375 test getting its args wrong on 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/26ec0d08
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/26ec0d08
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/26ec0d08

Branch: refs/heads/develop
Commit: 26ec0d084a16a7a6c5d27f946fa48451047263aa
Parents: c40e480
Author: Steve Loughran <st...@apache.org>
Authored: Fri Aug 29 12:25:19 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Fri Aug 29 13:19:00 2014 +0100

----------------------------------------------------------------------
 .../slider/providers/agent/TestAgentAMManagementWS.groovy      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/26ec0d08/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 1cd8de6..4e7b5b9 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, "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, 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(),
         ],
         true, true,
         true)


[5/5] git commit: Merge branch 'feature/SLIDER-375_slider-core_tests_failing_on_windows' into develop

Posted by st...@apache.org.
Merge branch 'feature/SLIDER-375_slider-core_tests_failing_on_windows' into develop


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

Branch: refs/heads/develop
Commit: c91d5ecd3a8b78d218bd02a5e2e7c9e7fefbc8cf
Parents: 8bfd66e aceab6b
Author: Steve Loughran <st...@apache.org>
Authored: Fri Aug 29 13:19:52 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Fri Aug 29 13:19:52 2014 +0100

----------------------------------------------------------------------
 .../agent/TestAgentAMManagementWS.groovy        |  8 +++---
 .../slider/providers/agent/TestAgentEcho.groovy |  6 ++---
 .../curator/TestRegistryRestResources.groovy    |  6 ++---
 .../publisher/TestPublisherRestResources.groovy | 26 +++++++++-----------
 .../apache/slider/test/SliderTestUtils.groovy   |  9 +++++++
 .../workflow/ProcessCommandFactory.java         | 21 +++++++++++-----
 .../services/workflow/TestLongLivedProcess.java |  6 ++---
 .../workflow/WorkflowServiceTestBase.java       |  3 ++-
 8 files changed, 51 insertions(+), 34 deletions(-)
----------------------------------------------------------------------