SLIDER-1112 allow failure of creation of applications in test case

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

Branch: refs/heads/branches/branch-0.91
Commit: 1b833e55abe4d6524171db636a5b570fe9148213
Parents: 7b560b9
Author: Yu Liu <yu...@apache.org>
Authored: Wed Apr 20 19:04:35 2016 -0700
Committer: Yu Liu <yu...@apache.org>
Committed: Wed Apr 20 19:04:35 2016 -0700

----------------------------------------------------------------------
 .../org/apache/slider/funtest/framework/CommandTestBase.groovy | 6 ++++--
 .../funtest/coprocessors/ApplicationWithAddonPackagesIT.groovy | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1b833e55/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
----------------------------------------------------------------------
diff --git 
a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
 
b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
index b3bba74..f6bdd19 100644
--- 
a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
+++ 
b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
@@ -730,7 +730,8 @@ abstract class CommandTestBase extends SliderTestUtils {
       String appTemplate,
       String resourceTemplate,
       List<String> extraArgs = [],
-      File launchReportFile = null) {
+      File launchReportFile = null,
+      boolean failOnError = true) {
 
     if (!launchReportFile) {
       launchReportFile = createTempJsonFile()
@@ -766,7 +767,8 @@ abstract class CommandTestBase extends SliderTestUtils {
         "env." + Constants.HADOOP_JAAS_DEBUG << "true";
     commands.addAll(extraArgs)
     SliderShell shell = new SliderShell(commands)
-    if (0 != shell.execute()) {
+    int returnCode = shell.execute()
+    if (failOnError && 0 != returnCode) {
       // app has failed.
 
       // grab the app report of the last known instance of this app

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1b833e55/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 ebce6df..20ff75c 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
@@ -119,7 +119,7 @@ public class ApplicationWithAddonPackagesIT extends 
AgentCommandTestBase{
         APP_TEMPLATE,
         APP_RESOURCE2,
         [Arguments.ARG_ADDON, ADD_ON_PACKAGE_NO_COMPONENT_PKG_NAME, 
addOnPackageNoComponentPkgNameFilePath.toString()],
-        launchReportFile)
+        launchReportFile, false)
     } finally {
       CommandTestBase.THAW_WAIT_TIME = temp_holder;
     }

Reply via email to