@Test public void testMainMethod() throws Exception { PrintStream oldPrintStream = System.err; SecurityManager SECURITY_MANAGER = System.getSecurityManager(); LauncherSecurityManager newSecurityManager= new LauncherSecurityManager(); System.setSecurityManager(newSecurityManager); ByteArrayOutputStream data = new ByteArrayOutputStream(); String[] args = {}; System.setErr(new PrintStream(data)); try { System.setErr(new PrintStream(data)); try { WALPlayer.main(args); fail("should be SecurityException"); } catch (SecurityException e) { assertEquals(-1, newSecurityManager.getExitCode()); assertTrue(data.toString().contains("ERROR: Wrong number of arguments:")); assertTrue(data.toString().contains("Usage: WALPlayer [options] <wal inputdir>" + " <tables> [<tableMappings>]")); assertTrue(data.toString().contains("-Dhlog.bulk.output=/path/for/output")); } } finally { System.setErr(oldPrintStream); System.setSecurityManager(SECURITY_MANAGER); } }
public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args); System.exit(ret); }
WALPlayer extends Configured implements Tool { public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args); System.exit(ret); } }
WALPlayer extends Configured implements Tool { public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args); System.exit(ret); } WALPlayer(Configuration conf); }
WALPlayer extends Configured implements Tool { public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args); System.exit(ret); } WALPlayer(Configuration conf); Job createSubmittableJob(String[] args); static void main(String[] args); @Override int run(String[] args); }
WALPlayer extends Configured implements Tool { public static void main(String[] args) throws Exception { int ret = ToolRunner.run(new WALPlayer(HBaseConfiguration.create()), args); System.exit(ret); } WALPlayer(Configuration conf); Job createSubmittableJob(String[] args); static void main(String[] args); @Override int run(String[] args);  }