ACCUMULO-3930 Prevent MockShell from trying to load from system-installed accumulo-site.xml
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/62e3b0f8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/62e3b0f8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/62e3b0f8 Branch: refs/heads/1.7 Commit: 62e3b0f8579ebfc9a4c6b0122d8bca8d6305b9b9 Parents: 2fa41d0 Author: Josh Elser <els...@apache.org> Authored: Thu Jul 2 17:54:32 2015 -0400 Committer: Josh Elser <els...@apache.org> Committed: Thu Jul 2 17:55:20 2015 -0400 ---------------------------------------------------------------------- .../org/apache/accumulo/core/client/mock/MockShell.java | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/62e3b0f8/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java index b6c532a..e4680bd 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java +++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java @@ -26,10 +26,14 @@ import java.io.Writer; import jline.console.ConsoleReader; +import org.apache.accumulo.core.client.AccumuloException; +import org.apache.accumulo.core.client.AccumuloSecurityException; +import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.ShellOptionsJC; import org.apache.commons.cli.CommandLine; import org.apache.commons.io.output.WriterOutputStream; +import org.apache.commons.vfs2.FileSystemException; /** * An Accumulo Shell implementation that allows a developer to attach an InputStream and Writer to the Shell for testing purposes. @@ -164,6 +168,11 @@ public class MockShell extends Shell { this.writer = out; } + @Override + public ClassLoader getClassLoader(final CommandLine cl, final Shell shellState) throws AccumuloException, TableNotFoundException, AccumuloSecurityException, IOException, FileSystemException { + return MockShell.class.getClassLoader(); + } + /** * Convenience method to create the byte-array to hand to the console *