protected @Override void runInternal(GeogigCLI cli) throws IOException { checkParameter(!baseuri.isEmpty(), "Usage: geogig ls-repos <base URI> (e.g. geogig ls-repos postgresql://localhost:5432/geogig_db?user=...&password=...)"); URI baseURI = baseuri.get(0); List<String> statements = new CreateDDL().setBaseURI(baseURI).call(); for (String st : statements) { cli.getConsole().println(st); } } }
private void listTags(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); ImmutableList<RevTag> tags = geogig.command(TagListOp.class).call(); for (RevTag tag : tags) { try { cli.getConsole().println(tag.getName()); } catch (IOException e) { throw new RuntimeException(e); } } } }
private void listTags(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); ImmutableList<RevTag> tags = geogig.command(TagListOp.class).call(); for (RevTag tag : tags) { try { cli.getConsole().println(tag.getName()); } catch (IOException e) { throw Throwables.propagate(e); } } } }
private void listTags(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); ImmutableList<RevTag> tags = geogig.command(TagListOp.class).call(); for (RevTag tag : tags) { try { cli.getConsole().println(tag.getName()); } catch (IOException e) { throw new RuntimeException(e); } } } }
@Test public void testImportException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); GeoJsonImport importCommand = new GeoJsonImport(); importCommand.geoJSONList = new ArrayList<String>(); importCommand.geoJSONList.add(GeoJsonImport.class.getResource("sample.geojson").getFile()); exception.expect(MockitoException.class); importCommand.run(cli); } }
@Test public void testImportException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); GeoJsonImport importCommand = new GeoJsonImport(); importCommand.geoJSONList = new ArrayList<String>(); importCommand.geoJSONList.add(GeoJsonImport.class.getResource("sample.geojson").getFile()); exception.expect(MockitoException.class); importCommand.run(cli); } }
@Test public void testImportException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); ShpImport importCommand = new ShpImport(); importCommand.shapeFile = new ArrayList<String>(); importCommand.shapeFile.add(ShpImport.class.getResource("shape.shp").getFile()); exception.expect(MockitoException.class); importCommand.run(cli); }
@Test public void testFlushException() throws Exception { Console consoleReader = cli.getConsole(); doThrow(new IOException("Exception")).when(consoleReader).flush(); OracleDescribe describeCommand = new OracleDescribe(); 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")); 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 testListException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); PGList listCommand = new PGList(); listCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); listCommand.run(cli); } }
@Test public void testDescribeException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); OracleDescribe describeCommand = new OracleDescribe(); describeCommand.table = "table1"; describeCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); describeCommand.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); } }
@Test public void testListException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); PGList listCommand = new PGList(); listCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); listCommand.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); }
@Test public void testImportException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); PGImport importCommand = new PGImport(); importCommand.all = true; importCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); importCommand.run(cli); }
@Test public void testImportException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); PGImport importCommand = new PGImport(); importCommand.all = true; importCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); importCommand.run(cli); }
@Test public void testListException() throws Exception { when(cli.getConsole()).thenThrow(new MockitoException("Exception")); OracleList listCommand = new OracleList(); listCommand.support.dataStoreFactory = TestHelper.createTestFactory(); exception.expect(MockitoException.class); listCommand.run(cli); } }
@Override protected void runInternal(GeogigCLI cli) throws InvalidParameterException, CommandFailedException, IOException { Repository repo = cli.getGeogig().getRepository(); repo.command(DropIndexOp.class)// .setTreeRefSpec(treeRefSpec)// .setAttributeName(attribute)// .setProgressListener(cli.getProgressListener())// .call(); cli.getConsole().println("Index successfully dropped."); } }