ACCUMULO-3871 fixed NPE and added more output to m/r runner; fixed some tests
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f6bd3eec Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f6bd3eec Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f6bd3eec Branch: refs/heads/master Commit: f6bd3eecd8e7f5704ae9804e9cf07b205de78a12 Parents: c5e6804 Author: Eric C. Newton <eric.new...@gmail.com> Authored: Mon Jun 1 13:37:37 2015 -0400 Committer: Eric C. Newton <eric.new...@gmail.com> Committed: Mon Jun 1 13:37:37 2015 -0400 ---------------------------------------------------------------------- test/pom.xml | 7 +++++++ .../accumulo/test/IntegrationTestMapReduce.java | 22 ++++++++++++++++++++ .../MissingWalHeaderCompletesRecoveryIT.java | 4 ++-- .../accumulo/test/functional/CloneTestIT.java | 3 +-- ...bageCollectorCommunicatesWithTServersIT.java | 6 +++--- 5 files changed, 35 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bd3eec/test/pom.xml ---------------------------------------------------------------------- diff --git a/test/pom.xml b/test/pom.xml index 516461b..c68e158 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -246,6 +246,13 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifestEntries> + <Sealed>false</Sealed> + </manifestEntries> + </archive> + </configuration> <executions> <execution> <id>make-test-jar</id> http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bd3eec/test/src/test/java/org/apache/accumulo/test/IntegrationTestMapReduce.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/IntegrationTestMapReduce.java b/test/src/test/java/org/apache/accumulo/test/IntegrationTestMapReduce.java index 6b9e82e..42c1095 100644 --- a/test/src/test/java/org/apache/accumulo/test/IntegrationTestMapReduce.java +++ b/test/src/test/java/org/apache/accumulo/test/IntegrationTestMapReduce.java @@ -32,8 +32,11 @@ import org.apache.hadoop.mapreduce.lib.input.NLineInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.junit.runner.Description; import org.junit.runner.JUnitCore; import org.junit.runner.Result; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,8 +55,27 @@ public class IntegrationTestMapReduce extends Configured implements Tool { } catch (ClassNotFoundException e) { log.debug("Error finding class {}", className, e); context.write(new IntWritable(-1), new Text(e.toString())); + return; } JUnitCore core = new JUnitCore(); + core.addListener(new RunListener() { + + @Override + public void testStarted(Description description) throws Exception { + log.info("Starting {}", description); + } + + @Override + public void testFinished(Description description) throws Exception { + log.info("Finished {}", description); + } + + @Override + public void testFailure(Failure failure) throws Exception { + log.info("Test failed: {}", failure.getDescription(), failure.getException()); + } + + }); log.info("Running test {}", className); Result result = core.run(test); if (result.wasSuccessful()) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bd3eec/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java b/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java index e315841..81c5d84 100644 --- a/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java +++ b/test/src/test/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java @@ -105,7 +105,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacIT { public void testEmptyWalRecoveryCompletes() throws Exception { Connector conn = getConnector(); MiniAccumuloClusterImpl cluster = getCluster(); - FileSystem fs = FileSystem.get(new Configuration()); + FileSystem fs = cluster.getFileSystem(); // Fake out something that looks like host:port, it's irrelevant String fakeServer = "127.0.0.1:12345"; @@ -157,7 +157,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacIT { public void testPartialHeaderWalRecoveryCompletes() throws Exception { Connector conn = getConnector(); MiniAccumuloClusterImpl cluster = getCluster(); - FileSystem fs = FileSystem.get(new Configuration()); + FileSystem fs = getCluster().getFileSystem(); // Fake out something that looks like host:port, it's irrelevant String fakeServer = "127.0.0.1:12345"; http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bd3eec/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java b/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java index 4fad30b..f7a9165 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/CloneTestIT.java @@ -49,7 +49,6 @@ import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.harness.AccumuloClusterIT; import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl; import org.apache.accumulo.server.ServerConstants; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -209,7 +208,7 @@ public class CloneTestIT extends AccumuloClusterIT { writeData(table3, c).close(); c.tableOperations().flush(table3, null, null, true); // check for files - FileSystem fs = FileSystem.get(new Configuration()); + FileSystem fs = getCluster().getFileSystem(); String id = c.tableOperations().tableIdMap().get(table3); FileStatus[] status = fs.listStatus(new Path(rootPath + "/accumulo/tables/" + id)); assertTrue(status.length > 0); http://git-wip-us.apache.org/repos/asf/accumulo/blob/f6bd3eec/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java b/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java index 6196cca..38d2276 100644 --- a/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java +++ b/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java @@ -16,6 +16,7 @@ */ package org.apache.accumulo.test.replication; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -57,7 +58,6 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RawLocalFileSystem; import org.apache.hadoop.io.Text; -import org.bouncycastle.util.Arrays; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; @@ -242,7 +242,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacI // Use the rfile which was just replaced by the MajC to determine when the GC has ran Path fileToBeDeleted = new Path(filesForTable.iterator().next()); - FileSystem fs = fileToBeDeleted.getFileSystem(new Configuration()); + FileSystem fs = getCluster().getFileSystem(); boolean fileExists = fs.exists(fileToBeDeleted); while (fileExists) { @@ -327,7 +327,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacI // Use the rfile which was just replaced by the MajC to determine when the GC has ran Path fileToBeDeleted = new Path(filesForTable.iterator().next()); - FileSystem fs = fileToBeDeleted.getFileSystem(new Configuration()); + FileSystem fs = getCluster().getFileSystem(); boolean fileExists = fs.exists(fileToBeDeleted); while (fileExists) {