From 7e06a11844615055a91809f7c619f595377798e2 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Tue, 4 Jun 2013 16:39:59 -0700 Subject: [PATCH] HBASE-8534 hadoop2 addendum - remove TestDriver, which exposes an API compatibility bug on hadoop-2.0.2-alpha. Said bug is fixed by MAPREDUCE-5156 and this test can be restored once we have a viable hadoop version. - removed TestTableMapReduceUtil serializer assertion due to presence of AvroSpecificSerialization,AvroReflectSerialization. --- .../apache/hadoop/hbase/mapreduce/TestDriver.java | 71 ---------------------- .../hbase/mapreduce/TestTableMapReduceUtil.java | 26 +------- 2 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestDriver.java diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestDriver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestDriver.java deleted file mode 100644 index ceecba3..0000000 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestDriver.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license - * agreements. See the NOTICE file distributed with this work for additional information regarding - * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with the License. You may - * obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hbase.mapreduce; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertEquals; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.lang.reflect.InvocationTargetException; - -import org.apache.hadoop.hbase.SmallTests; -import org.apache.hadoop.hbase.util.LauncherSecurityManager; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -@Category(SmallTests.class) -public class TestDriver { - /** - * Test main method of Driver class - */ - @Test - public void testDriver() throws Throwable { - - PrintStream oldPrintStream = System.out; - SecurityManager SECURITY_MANAGER = System.getSecurityManager(); - LauncherSecurityManager newSecurityManager= new LauncherSecurityManager(); - System.setSecurityManager(newSecurityManager); - ByteArrayOutputStream data = new ByteArrayOutputStream(); - String[] args = {}; - System.setOut(new PrintStream(data)); - try { - System.setOut(new PrintStream(data)); - - try { - Driver.main(args); - fail("should be SecurityException"); - } catch (InvocationTargetException e) { - assertEquals(-1, newSecurityManager.getExitCode()); - assertTrue(data.toString().contains( - "An example program must be given as the first argument.")); - assertTrue(data.toString().contains("CellCounter: Count cells in HBase table")); - assertTrue(data.toString().contains("completebulkload: Complete a bulk data load.")); - assertTrue(data.toString().contains( - "copytable: Export a table from local cluster to peer cluster")); - assertTrue(data.toString().contains("export: Write table data to HDFS.")); - assertTrue(data.toString().contains("import: Import data written by Export.")); - assertTrue(data.toString().contains("importtsv: Import data in TSV format.")); - assertTrue(data.toString().contains("rowcounter: Count rows in HBase table")); - } - } finally { - System.setOut(oldPrintStream); - System.setSecurityManager(SECURITY_MANAGER); - } - - } -} \ No newline at end of file diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceUtil.java index dad71f8..bc4f8a3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceUtil.java @@ -49,12 +49,6 @@ public class TestTableMapReduceUtil { assertEquals(Text.class, job.getOutputValueClass()); assertNull(job.getCombinerClass()); assertEquals("Table", job.getConfiguration().get(TableInputFormat.INPUT_TABLE)); - assertEquals( - "org.apache.hadoop.io.serializer.WritableSerialization," + - "org.apache.hadoop.hbase.mapreduce.MutationSerialization," + - "org.apache.hadoop.hbase.mapreduce.ResultSerialization," + - "org.apache.hadoop.hbase.mapreduce.KeyValueSerialization", - job.getConfiguration().get("io.serializations")); configuration = new Configuration(); job = new Job(configuration, "tableName"); @@ -66,12 +60,6 @@ public class TestTableMapReduceUtil { assertEquals(Text.class, job.getOutputValueClass()); assertNull(job.getCombinerClass()); assertEquals("Table", job.getConfiguration().get(TableInputFormat.INPUT_TABLE)); - assertEquals( - "org.apache.hadoop.io.serializer.WritableSerialization," + - "org.apache.hadoop.hbase.mapreduce.MutationSerialization," + - "org.apache.hadoop.hbase.mapreduce.ResultSerialization," + - "org.apache.hadoop.hbase.mapreduce.KeyValueSerialization", - job.getConfiguration().get("io.serializations")); configuration = new Configuration(); job = new Job(configuration, "tableName"); @@ -83,12 +71,6 @@ public class TestTableMapReduceUtil { assertEquals(Text.class, job.getOutputValueClass()); assertNull(job.getCombinerClass()); assertEquals("Table", job.getConfiguration().get(TableInputFormat.INPUT_TABLE)); - assertEquals( - "org.apache.hadoop.io.serializer.WritableSerialization," + - "org.apache.hadoop.hbase.mapreduce.MutationSerialization," + - "org.apache.hadoop.hbase.mapreduce.ResultSerialization," + - "org.apache.hadoop.hbase.mapreduce.KeyValueSerialization", - job.getConfiguration().get("io.serializations")); configuration = new Configuration(); job = new Job(configuration, "tableName"); @@ -100,11 +82,5 @@ public class TestTableMapReduceUtil { assertEquals(Text.class, job.getOutputValueClass()); assertNull(job.getCombinerClass()); assertEquals("Table", job.getConfiguration().get(TableInputFormat.INPUT_TABLE)); - assertEquals( - "org.apache.hadoop.io.serializer.WritableSerialization," + - "org.apache.hadoop.hbase.mapreduce.MutationSerialization," + - "org.apache.hadoop.hbase.mapreduce.ResultSerialization," + - "org.apache.hadoop.hbase.mapreduce.KeyValueSerialization", - job.getConfiguration().get("io.serializations")); } -} \ No newline at end of file +} -- 1.8.1