hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sj...@apache.org
Subject [01/50] [abbrv] hadoop git commit: HADOOP-12280. Skip unit tests based on maven profile rather than NativeCodeLoader.isNativeCodeLoaded (Masatake Iwasaki via Colin P. McCabe)
Date Sat, 26 Sep 2015 16:05:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.6 934886486 -> 1828ba00b (forced update)


HADOOP-12280. Skip unit tests based on maven profile rather than NativeCodeLoader.isNativeCodeLoaded
(Masatake Iwasaki via Colin P. McCabe)

(cherry picked from commit 6f83274afc1eba1159427684d72d8f13778c5a88)
(cherry picked from commit e92107b18f82b3501deaa6170d322a0fb512ec71)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3bd9b745
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3bd9b745
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3bd9b745

Branch: refs/heads/branch-2.6
Commit: 3bd9b7459bfe2e4d81d60498832dc297cd01e003
Parents: d8ddfea
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Tue Aug 4 13:51:04 2015 -0700
Committer: Vinod Kumar Vavilapalli <vinodkv@apache.org>
Committed: Thu Sep 3 15:02:33 2015 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt          |  3 +++
 .../java/org/apache/hadoop/crypto/TestCryptoCodec.java   | 11 +++--------
 .../TestCryptoStreamsWithOpensslAesCtrCryptoCodec.java   |  2 ++
 .../org/apache/hadoop/io/TestSequenceFileAppend.java     |  5 +++++
 .../java/org/apache/hadoop/test/GenericTestUtils.java    | 11 +++++++++++
 5 files changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bd9b745/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 57c7eae..c4735a0 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -11,6 +11,9 @@ Release 2.6.1 - UNRELEASED
     HADOOP-7139. Allow appending to existing SequenceFiles
     (kanaka kumar avvaru via vinayakumarb)
 
+    HADOOP-12280. Skip unit tests based on maven profile rather than
+    NativeCodeLoader.isNativeCodeLoaded (Masatake Iwasaki via Colin P. McCabe)
+
   OPTIMIZATIONS
 
     HADOOP-11238. Update the NameNode's Group Cache in the background when

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bd9b745/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java
index 08231f9..e13df57 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoCodec.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.DataInputBuffer;
 import org.apache.hadoop.io.DataOutputBuffer;
 import org.apache.hadoop.io.RandomDatum;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.apache.hadoop.util.NativeCodeLoader;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.junit.Assert;
@@ -63,10 +64,7 @@ public class TestCryptoCodec {
   
   @Test(timeout=120000)
   public void testJceAesCtrCryptoCodec() throws Exception {
-    if (!"true".equalsIgnoreCase(System.getProperty("runningWithNative"))) {
-      LOG.warn("Skipping since test was not run with -Pnative flag");
-      Assume.assumeTrue(false);
-    }
+    GenericTestUtils.assumeInNativeProfile();
     if (!NativeCodeLoader.buildSupportsOpenssl()) {
       LOG.warn("Skipping test since openSSL library not loaded");
       Assume.assumeTrue(false);
@@ -79,10 +77,7 @@ public class TestCryptoCodec {
   
   @Test(timeout=120000)
   public void testOpensslAesCtrCryptoCodec() throws Exception {
-    if (!"true".equalsIgnoreCase(System.getProperty("runningWithNative"))) {
-      LOG.warn("Skipping since test was not run with -Pnative flag");
-      Assume.assumeTrue(false);
-    }
+    GenericTestUtils.assumeInNativeProfile();
     if (!NativeCodeLoader.buildSupportsOpenssl()) {
       LOG.warn("Skipping test since openSSL library not loaded");
       Assume.assumeTrue(false);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bd9b745/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoStreamsWithOpensslAesCtrCryptoCodec.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoStreamsWithOpensslAesCtrCryptoCodec.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoStreamsWithOpensslAesCtrCryptoCodec.java
index f64e8dc..257ad5d 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoStreamsWithOpensslAesCtrCryptoCodec.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/TestCryptoStreamsWithOpensslAesCtrCryptoCodec.java
@@ -18,6 +18,7 @@
 package org.apache.hadoop.crypto;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.BeforeClass;
 
 public class TestCryptoStreamsWithOpensslAesCtrCryptoCodec 
@@ -25,6 +26,7 @@ public class TestCryptoStreamsWithOpensslAesCtrCryptoCodec
   
   @BeforeClass
   public static void init() throws Exception {
+    GenericTestUtils.assumeInNativeProfile();
     Configuration conf = new Configuration();
     codec = CryptoCodec.getInstance(conf);
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bd9b745/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFileAppend.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFileAppend.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFileAppend.java
index 4576642..be4ab92 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFileAppend.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFileAppend.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.io.SequenceFile.Writer.Option;
 import org.apache.hadoop.io.compress.DefaultCodec;
 import org.apache.hadoop.io.compress.GzipCodec;
 import org.apache.hadoop.io.serializer.JavaSerializationComparator;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -140,6 +141,7 @@ public class TestSequenceFileAppend {
 
   @Test(timeout = 30000)
   public void testAppendRecordCompression() throws Exception {
+    GenericTestUtils.assumeInNativeProfile();
 
     Path file = new Path(ROOT_PATH, "testseqappendblockcompr.seq");
     fs.delete(file, true);
@@ -173,6 +175,7 @@ public class TestSequenceFileAppend {
 
   @Test(timeout = 30000)
   public void testAppendBlockCompression() throws Exception {
+    GenericTestUtils.assumeInNativeProfile();
 
     Path file = new Path(ROOT_PATH, "testseqappendblockcompr.seq");
     fs.delete(file, true);
@@ -247,6 +250,8 @@ public class TestSequenceFileAppend {
 
   @Test(timeout = 30000)
   public void testAppendSort() throws Exception {
+    GenericTestUtils.assumeInNativeProfile();
+
     Path file = new Path(ROOT_PATH, "testseqappendSort.seq");
     fs.delete(file, true);
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3bd9b745/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
index 7be71e9..0616887 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
@@ -41,6 +41,7 @@ import org.apache.log4j.Layout;
 import org.apache.log4j.Logger;
 import org.apache.log4j.WriterAppender;
 import org.junit.Assert;
+import org.junit.Assume;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
@@ -368,4 +369,14 @@ public abstract class GenericTestUtils {
       }
     }
   }
+
+  /**
+   * Skip test if native build profile of Maven is not activated.
+   * Sub-project using this must set 'runningWithNative' property to true
+   * in the definition of native profile in pom.xml.
+   */
+  public static void assumeInNativeProfile() {
+    Assume.assumeTrue(
+        Boolean.valueOf(System.getProperty("runningWithNative", "false")));
+  }
 }


Mime
View raw message