@Test public void testListHelp() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.help = true; listCommand.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 testListHelp() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.help = true; listCommand.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 testInvalidDatabaseParams() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = "nonexistent.gpkg"; exception.expect(IllegalArgumentException.class); listCommand.run(cli); }
@Test public void testInvalidDatabaseParams() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = "nonexistent.gpkg"; exception.expect(IllegalArgumentException.class); listCommand.run(cli); }
@Test public void testList() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.createDefaultTestData().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createTestFactory(); listCommand.run(cli); }
@Test public void testList() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.createDefaultTestData().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createTestFactory(); listCommand.run(cli); }
@Test public void testEmptyDataStore() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createEmptyTestFactory(); exception.expect(CommandFailedException.class); listCommand.run(cli); }
@Test public void testGetNamesException() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createFactoryWithGetNamesException(); exception.expect(CommandFailedException.class); listCommand.run(cli); }
@Test public void testNullDataStore() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createNullTestFactory(); exception.expect(CommandFailedException.class); listCommand.run(cli); }
@Test public void testEmptyDataStore() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createEmptyTestFactory(); exception.expect(CommandFailedException.class); listCommand.run(cli); }
@Test public void testGetNamesException() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createFactoryWithGetNamesException(); exception.expect(CommandFailedException.class); listCommand.run(cli); }
@Test public void testNullDataStore() throws Exception { GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createNullTestFactory(); exception.expect(CommandFailedException.class); listCommand.run(cli); }
@Test public void testListException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); listCommand.run(cli); } }
@Test public void testListException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); GeopkgList listCommand = new GeopkgList(); listCommand.commonArgs.database = support.newFile().getAbsolutePath(); listCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); listCommand.run(cli); } }