From e45c32fced9b3b2c0af5c4ad807f2ea1d78da5f3 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Thu, 26 Sep 2013 17:11:40 +0000 Subject: [PATCH] HADOOP-9948. Merging change r1526606 from trunk to branch-2. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1526607 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/cli/CLITestHelper.java | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index ec522dc4d5e..82182173d43 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -107,6 +107,9 @@ Release 2.1.2 - UNRELEASED IMPROVEMENTS + HADOOP-9948. Add a config value to CLITestHelper to skip tests on Windows. + (Chuan Liu via cnauroth) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/cli/CLITestHelper.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/cli/CLITestHelper.java index 3fba5d98a57..d39727bc602 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/cli/CLITestHelper.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/cli/CLITestHelper.java @@ -21,11 +21,10 @@ package org.apache.hadoop.cli; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.cli.util.*; -import org.apache.hadoop.cli.util.CLITestCmd; -import org.apache.hadoop.cli.util.CLICommand; import org.apache.hadoop.cli.util.CommandExecutor.Result; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; +import org.apache.hadoop.util.Shell; import org.apache.hadoop.util.StringUtils; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -369,6 +368,7 @@ public class CLITestHelper { CLITestData td = null; ArrayList testCommands = null; ArrayList cleanupCommands = null; + boolean runOnWindows = true; @Override public void startDocument() throws SAXException { @@ -399,6 +399,8 @@ public class CLITestHelper { throws SAXException { if (qName.equals("description")) { td.setTestDesc(charString); + } else if (qName.equals("windows")) { + runOnWindows = Boolean.parseBoolean(charString); } else if (qName.equals("test-commands")) { td.setTestCommands(testCommands); testCommands = null; @@ -420,8 +422,11 @@ public class CLITestHelper { } else if (qName.equals("expected-output")) { comparatorData.setExpectedOutput(charString); } else if (qName.equals("test")) { - testsFromConfigFile.add(td); + if (!Shell.WINDOWS || runOnWindows) { + testsFromConfigFile.add(td); + } td = null; + runOnWindows = true; } else if (qName.equals("mode")) { testMode = charString; if (!testMode.equals(TESTMODE_NOCOMPARE) &&