@Test public void testDescribeHelp() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); 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 geopkg"); commander.addCommand("import", new GeopkgImport()); commander.addCommand("list", new GeopkgList()); commander.addCommand("describe", new GeopkgDescribe()); commander.addCommand("export", new GeopkgExport()); commander.addCommand("pull", new GeopkgPull()); return commander; } }
/** * @return the JCommander parser for this extension * @see JCommander */ @Override public JCommander getCommandParser() { JCommander commander = new JCommander(); commander.setProgramName("geogig geopkg"); commander.addCommand("import", new GeopkgImport()); commander.addCommand("list", new GeopkgList()); commander.addCommand("describe", new GeopkgDescribe()); commander.addCommand("export", new GeopkgExport()); commander.addCommand("pull", new GeopkgPull()); return commander; } }
@Test public void testInvalidDatabaseParams() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = "nonexistent.gpkg"; describeCommand.table = "table1"; exception.expect(IllegalArgumentException.class); describeCommand.run(cli); }
/** * @return the JCommander parser for this extension * @see JCommander */ @Override public JCommander getCommandParser() { JCommander commander = new JCommander(); commander.setProgramName("geogig geopkg"); commander.addCommand("import", new GeopkgImport()); commander.addCommand("list", new GeopkgList()); commander.addCommand("describe", new GeopkgDescribe()); commander.addCommand("export", new GeopkgExport()); commander.addCommand("pull", new GeopkgPull()); return commander; } }
@Test public void testDescribeHelp() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.help = true; describeCommand.run(cli); }
@Test public void testInvalidDatabaseParams() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = "nonexistent.gpkg"; describeCommand.table = "table1"; exception.expect(IllegalArgumentException.class); describeCommand.run(cli); }
@Test public void testDescribe() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.createDefaultTestData().getAbsolutePath(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); describeCommand.run(cli); }
@Test public void testDescribe() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.createDefaultTestData().getAbsolutePath(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); describeCommand.run(cli); }
@Test public void testDescribeNonexistentTable() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.createDefaultTestData().getAbsolutePath(); describeCommand.table = "nonexistent"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testNullDataStore() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); 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(); GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(Exception.class); describeCommand.run(cli); }
@Test public void testNoTable() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.table = ""; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testDescribeNonexistentTable() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.createDefaultTestData().getAbsolutePath(); 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(); GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(Exception.class); describeCommand.run(cli); }
@Test public void testNullDataStore() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createNullTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testNoTable() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.table = ""; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(CommandFailedException.class); describeCommand.run(cli); }
@Test public void testDescribeException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); 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")); GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); describeCommand.run(cli); }