@Test public void testDescribeHelp() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.help = true; describeCommand.run(cli); }
/** * @return the JCommander parser for this extension * @see JCommander */ @Override public JCommander getCommandParser() { JCommander commander = new JCommander(); commander.setProgramName("geogig pg"); commander.addCommand("import", new PGImport()); commander.addCommand("list", new PGList()); commander.addCommand("describe", new PGDescribe()); commander.addCommand("export", new PGExport()); return commander; } }
/** * @return the JCommander parser for this extension * @see JCommander */ @Override public JCommander getCommandParser() { JCommander commander = new JCommander(); commander.setProgramName("geogig pg"); commander.addCommand("import", new PGImport()); commander.addCommand("list", new PGList()); commander.addCommand("describe", new PGDescribe()); commander.addCommand("export", new PGExport()); return commander; } }
@Test public void testDescribeHelp() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.help = true; describeCommand.run(cli); }
/** * @return the JCommander parser for this extension * @see JCommander */ @Override public JCommander getCommandParser() { JCommander commander = new JCommander(); commander.setProgramName("geogig pg"); commander.addCommand("import", new PGImport()); commander.addCommand("list", new PGList()); commander.addCommand("describe", new PGDescribe()); commander.addCommand("export", new PGExport()); return commander; } }
@Test public void testDescribe() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); describeCommand.run(cli); }
@Test public void testDescribe() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); describeCommand.run(cli); }
@Test public void testInvalidDatabaseParams() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.commonArgs.host = "nonexistent"; describeCommand.table = "table1"; exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testInvalidDatabaseParams() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.commonArgs.host = "nonexistent"; describeCommand.table = "table1"; exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testNullDataStore() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createNullTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testNoTable() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = ""; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testNullDataStore() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createNullTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testFlushException() throws Exception { doThrow(new IOException("Exception")).when(consoleReader).flush(); PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(Exception.class); describeCommand.run(cli); } }
@Test public void testDescribeNonexistentTable() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "nonexistent"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testNoTable() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = ""; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testDescribeNonexistentTable() throws Exception { PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "nonexistent"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testFlushException() throws Exception { doThrow(new IOException("Exception")).when(consoleReader).flush(); PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(Exception.class); describeCommand.run(cli); } }
@Test public void testDescribeException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); describeCommand.run(cli); }
@Test public void testDescribeException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); PGDescribe describeCommand = new PGDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); describeCommand.run(cli); }