You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by yu...@apache.org on 2016/03/18 19:00:20 UTC

incubator-slider git commit: SLIDER-1101 fixing 5 test cases failures on windows by using Path

Repository: incubator-slider
Updated Branches:
  refs/heads/develop 0df54025e -> 14ccea135


SLIDER-1101 fixing 5 test cases failures on windows by using Path


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

Branch: refs/heads/develop
Commit: 14ccea13518598b103f1a5492096c3bb4c8d36f6
Parents: 0df5402
Author: Yu Liu <yu...@apache.org>
Authored: Fri Mar 18 11:00:08 2016 -0700
Committer: Yu Liu <yu...@apache.org>
Committed: Fri Mar 18 11:00:08 2016 -0700

----------------------------------------------------------------------
 ...nentConfigsInAppConfigShowUpOnAgentIT.groovy |  7 +++-
 .../ApplicationWithAddonPackagesIT.groovy       | 41 +++++++++++++-------
 2 files changed, 31 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/14ccea13/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ComponentConfigsInAppConfigShowUpOnAgentIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ComponentConfigsInAppConfigShowUpOnAgentIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ComponentConfigsInAppConfigShowUpOnAgentIT.groovy
index 87e62fe..9d54b13 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ComponentConfigsInAppConfigShowUpOnAgentIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/ComponentConfigsInAppConfigShowUpOnAgentIT.groovy
@@ -26,6 +26,7 @@ import org.apache.slider.funtest.framework.SliderShell
 import org.junit.After
 import org.junit.Before
 import org.junit.Test
+import org.apache.hadoop.fs.Path
 
 @Slf4j
 public class ComponentConfigsInAppConfigShowUpOnAgentIT extends AgentCommandTestBase{
@@ -80,9 +81,11 @@ public class ComponentConfigsInAppConfigShowUpOnAgentIT extends AgentCommandTest
   }
   
   public void setupApplicationPackage() {
-    SliderUtils.zipFolder(new File(PACKAGE_DEF_DIR), new File(ZIP_DIR + ZIP_FILE))
+    Path zipDirFile = new Path(ZIP_DIR + ZIP_FILE);
+    Path packageDefDir = new Path(PACKAGE_DEF_DIR);
+    SliderUtils.zipFolder(new File(packageDefDir.toString()), new File(zipDirFile.toString()))
     try {
-      File zipFileName = new File(ZIP_DIR, ZIP_FILE).canonicalFile
+      File zipFileName = new File(zipDirFile.toString()).canonicalFile
       SliderShell shell = slider(EXIT_SUCCESS,
           [
               ACTION_INSTALL_PACKAGE,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/14ccea13/slider-funtest/src/test/groovy/org/apache/slider/funtest/coprocessors/ApplicationWithAddonPackagesIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/coprocessors/ApplicationWithAddonPackagesIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/coprocessors/ApplicationWithAddonPackagesIT.groovy
index 66572ba..ebce6df 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/coprocessors/ApplicationWithAddonPackagesIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/coprocessors/ApplicationWithAddonPackagesIT.groovy
@@ -68,16 +68,18 @@ public class ApplicationWithAddonPackagesIT extends AgentCommandTestBase{
   @Test
   public void testCreateApplicationWithOneAddonPackagesForOneComponent() throws Throwable {
     describe("Create a cluster with an addon package that apply to one component")
-    SliderUtils.zipFolder(new File(ADD_ON_PACKAGE_ONE_COMPONENT), new File(ADD_ON_PACKAGE_ONE_COMPONENT_PKG_FILE))
+    Path addOnPackageOneComponentPkgNameFilePath = new Path(ADD_ON_PACKAGE_ONE_COMPONENT_PKG_FILE);
+    Path addOnPackageOneComponentPath = new Path(ADD_ON_PACKAGE_ONE_COMPONENT);
+    SliderUtils.zipFolder(new File(addOnPackageOneComponentPath.toString()), new File(addOnPackageOneComponentPkgNameFilePath.toString()))
     cleanupHdfsFile(TARGET_FILE)
     
     def clusterpath = buildClusterPath(CLUSTER)
     File launchReportFile = createTempJsonFile();
-
+    
     SliderShell shell = createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,
-        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_ONE_COMPONENT_PKG_NAME, ADD_ON_PACKAGE_ONE_COMPONENT_PKG_FILE],
+        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_ONE_COMPONENT_PKG_NAME, addOnPackageOneComponentPkgNameFilePath.toUri().toString()],
         launchReportFile)
 
     logShell(shell)
@@ -102,7 +104,9 @@ public class ApplicationWithAddonPackagesIT extends AgentCommandTestBase{
   @Test
   public void testCreateApplicationWithOneAddonPackagesForNoComponents() throws Throwable {
     describe("Create a cluster with an addon package that apply to no components")
-    SliderUtils.zipFolder(new File(ADD_ON_PACKAGE_NO_COMPONENT), new File(ADD_ON_PACKAGE_NO_COMPONENT_PKG_FILE))
+    Path addOnPackageNoComponentPkgNameFilePath = new Path(ADD_ON_PACKAGE_NO_COMPONENT_PKG_FILE);
+    Path addOnPackageNoComponentPath = new Path(ADD_ON_PACKAGE_NO_COMPONENT);
+    SliderUtils.zipFolder(new File(addOnPackageNoComponentPath.toString()), new File(addOnPackageNoComponentPkgNameFilePath.toString()))
     def clusterpath = buildClusterPath(CLUSTER)
     File launchReportFile = createTempJsonFile();
 
@@ -114,7 +118,7 @@ public class ApplicationWithAddonPackagesIT extends AgentCommandTestBase{
       shell = createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,
-        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_NO_COMPONENT_PKG_NAME, ADD_ON_PACKAGE_NO_COMPONENT_PKG_FILE],
+        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_NO_COMPONENT_PKG_NAME, addOnPackageNoComponentPkgNameFilePath.toString()],
         launchReportFile)
     } finally {
       CommandTestBase.THAW_WAIT_TIME = temp_holder;
@@ -132,14 +136,16 @@ public class ApplicationWithAddonPackagesIT extends AgentCommandTestBase{
   @Test
   public void testCreateApplicationWithOneAddonPackagesForMultipleComponents() throws Throwable {
     describe("Create a cluster with an addon package that apply to multiple components")
-    SliderUtils.zipFolder(new File(ADD_ON_PACKAGE_MULTI_COMPONENT), new File(ADD_ON_PACKAGE_MULTI_COMPONENT_PKG_FILE))
+    Path addOnPackageMultiComponentPkgNameFilePath = new Path(ADD_ON_PACKAGE_MULTI_COMPONENT_PKG_FILE);
+    Path addOnPackageMultiComponentPath = new Path(ADD_ON_PACKAGE_MULTI_COMPONENT);
+    SliderUtils.zipFolder(new File(addOnPackageMultiComponentPath.toString()), new File(addOnPackageMultiComponentPkgNameFilePath.toString()))
     def clusterpath = buildClusterPath(CLUSTER)
     File launchReportFile = createTempJsonFile();
 
     SliderShell shell = createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,
-        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_MULTI_COMPONENT_PKG_NAME, ADD_ON_PACKAGE_MULTI_COMPONENT_PKG_FILE],
+        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_MULTI_COMPONENT_PKG_NAME, addOnPackageMultiComponentPkgNameFilePath.toString()],
         launchReportFile)
 
     logShell(shell)
@@ -161,14 +167,16 @@ public class ApplicationWithAddonPackagesIT extends AgentCommandTestBase{
   @Test
   public void testCreateApplicationWithOneAddonPackagesForAllComponents() throws Throwable {
     describe("Create a cluster with an addon package that apply to all components")
-    SliderUtils.zipFolder(new File(ADD_ON_PACKAGE_ALL_COMPONENT), new File(ADD_ON_PACKAGE_ALL_COMPONENT_PKG_FILE))
+    Path addOnPackageAllComponentPkgNameFilePath = new Path(ADD_ON_PACKAGE_ALL_COMPONENT_PKG_FILE);
+    Path addOnPackageAllComponentPath = new Path(ADD_ON_PACKAGE_ALL_COMPONENT);
+    SliderUtils.zipFolder(new File(addOnPackageAllComponentPath.toString()), new File(addOnPackageAllComponentPkgNameFilePath.toString()))
     def clusterpath = buildClusterPath(CLUSTER)
     File launchReportFile = createTempJsonFile();
 
     SliderShell shell = createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,
-        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_ALL_COMPONENT_PKG_NAME, ADD_ON_PACKAGE_ALL_COMPONENT_PKG_FILE],
+        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_ALL_COMPONENT_PKG_NAME, addOnPackageAllComponentPkgNameFilePath.toString()],
         launchReportFile)
 
     logShell(shell)
@@ -188,16 +196,20 @@ public class ApplicationWithAddonPackagesIT extends AgentCommandTestBase{
   @Test
   public void testCreateApplicationWithMultipleAddonPackages() throws Throwable {
     describe("Create a cluster with multiple addon packages")
-    SliderUtils.zipFolder(new File(ADD_ON_PACKAGE_ALL_COMPONENT), new File(ADD_ON_PACKAGE_ALL_COMPONENT_PKG_FILE))
-    SliderUtils.zipFolder(new File(ADD_ON_PACKAGE_ONE_COMPONENT), new File(ADD_ON_PACKAGE_ONE_COMPONENT_PKG_FILE))
+    Path addOnPackageAllComponentPkgNameFilePath = new Path(ADD_ON_PACKAGE_ALL_COMPONENT_PKG_FILE);
+    Path addOnPackageAllComponentPath = new Path(ADD_ON_PACKAGE_ALL_COMPONENT);
+    Path addOnPackageOneComponentPkgNameFilePath = new Path(ADD_ON_PACKAGE_ONE_COMPONENT_PKG_FILE);
+    Path addOnPackageOneComponentPath = new Path(ADD_ON_PACKAGE_ONE_COMPONENT);
+    SliderUtils.zipFolder(new File(addOnPackageAllComponentPath.toString()), new File(addOnPackageAllComponentPkgNameFilePath.toString()))
+    SliderUtils.zipFolder(new File(addOnPackageOneComponentPath.toString()), new File(addOnPackageOneComponentPkgNameFilePath.toString()))
     def clusterpath = buildClusterPath(CLUSTER)
     File launchReportFile = createTempJsonFile();
 
     SliderShell shell = createTemplatedSliderApplication(CLUSTER,
         APP_TEMPLATE,
         APP_RESOURCE2,
-        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_ALL_COMPONENT_PKG_NAME, ADD_ON_PACKAGE_ALL_COMPONENT_PKG_FILE,
-          Arguments.ARG_ADDON, ADD_ON_PACKAGE_ONE_COMPONENT_PKG_NAME, ADD_ON_PACKAGE_ONE_COMPONENT_PKG_FILE],
+        [Arguments.ARG_ADDON, ADD_ON_PACKAGE_ALL_COMPONENT_PKG_NAME, addOnPackageAllComponentPkgNameFilePath.toString(),
+          Arguments.ARG_ADDON, ADD_ON_PACKAGE_ONE_COMPONENT_PKG_NAME, addOnPackageOneComponentPkgNameFilePath.toString()],
         launchReportFile)
 
     logShell(shell)
@@ -226,5 +238,4 @@ public class ApplicationWithAddonPackagesIT extends AgentCommandTestBase{
     awaitTargetFileExists()
   }
 
-}
-
+}
\ No newline at end of file