@Before public void setUp() throws Exception { consoleReader = spy(new Console().disableAnsi()); cli = spy(new GeogigCLI(consoleReader)); support = new GeoPackageTestSupport(); setUpGeogig(cli); }
public File createDefaultTestData() throws Exception { File file = createEmptyDatabase(); MemoryDataStore memStore = new MemoryDataStoreWithProvidedFIDSupport(); TestFeatures.setupFeatures(); memStore.addFeatures(ImmutableList.of(points1, points2, points3)); memStore.addFeatures(ImmutableList.of(lines1, lines2, lines3)); DataStore gpkgStore = createDataStore(file); try { export(memStore.getFeatureSource(pointsType.getName().getLocalPart()), gpkgStore); export(memStore.getFeatureSource(linesType.getName().getLocalPart()), gpkgStore); } finally { gpkgStore.dispose(); } return file; }
@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); }
@When("^I run the command \"([^\"]*)\" on a new GeoPackage file$") public void I_run_the_command_on_a_new_GeoPackage_file(String commandSpec) throws Throwable { GeoPackageTestSupport support = new GeoPackageTestSupport(); commandSpec += " --database "; commandSpec += support.newFile().getPath(); String[] args = commandSpec.split(" "); localRepo.runCommand(args); }
@When("^I run the command \"([^\"]*)\" on an existing GeoPackage file$") public void I_run_the_command_on_an_existing_GeoPackage_file(String commandSpec) throws Throwable { GeoPackageTestSupport support = new GeoPackageTestSupport(); commandSpec += " --database "; commandSpec += support.createDefaultTestData().getPath(); String[] args = commandSpec.split(" "); localRepo.runCommand(args); }
public void exportToFile(File file, String tableName, ImmutableList<Feature> features) throws Exception { MemoryDataStore memStore = new MemoryDataStoreWithProvidedFIDSupport(); memStore.addFeatures(features); DataStore gpkgStore = createDataStore(file); try { export(memStore.getFeatureSource(tableName), gpkgStore); } finally { gpkgStore.dispose(); } }
@Test public void testDescribeHelp() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.help = true; describeCommand.run(cli); }
localRepo.runCommand(true, "commit -m initial"); GeoPackageTestSupport support = new GeoPackageTestSupport(); File geoPkgFile = support.newFile(); String geoPkgFileName = geoPkgFile.getAbsolutePath(); exportCommand.args = Arrays.asList("Points", "Points"); exportCommand.run(localRepo.geogigCLI); DataStore gpkgStore = support.createDataStore(geoPkgFile);
private DataStore store(File result) throws InterruptedException, ExecutionException { assertNotNull(result); return support.createDataStore(result); }
original = iter.next(); featureType = original.getFeatureType(); updated = transformFeatureId(original); updatedFeatures.add(updated); mappings.put(updated.getID(), original.getID());
@Test public void testDescribeHelp() throws Exception { GeopkgDescribe describeCommand = new GeopkgDescribe(); describeCommand.commonArgs.database = support.newFile().getAbsolutePath(); describeCommand.help = true; describeCommand.run(cli); }
localRepo.runCommand(true, "commit -m initial"); GeoPackageTestSupport support = new GeoPackageTestSupport(); File geoPkgFile = support.newFile(); String geoPkgFileName = geoPkgFile.getAbsolutePath(); exportCommand.args = Arrays.asList("Points", "Points"); exportCommand.run(localRepo.geogigCLI); DataStore gpkgStore = support.createDataStore(geoPkgFile);
@When("^I run the command \"([^\"]*)\" on a new GeoPackage file$") public void I_run_the_command_on_a_new_GeoPackage_file(String commandSpec) throws Throwable { GeoPackageTestSupport support = new GeoPackageTestSupport(); commandSpec += " --database "; commandSpec += support.newFile().getPath(); String[] args = commandSpec.split(" "); localRepo.runCommand(args); }
public void exportToFile(File file, String tableName, ImmutableList<Feature> features) throws Exception { MemoryDataStore memStore = new MemoryDataStoreWithProvidedFIDSupport(); memStore.addFeatures(features); DataStore gpkgStore = createDataStore(file); try { export(memStore.getFeatureSource(tableName), gpkgStore); } finally { gpkgStore.dispose(); } }
@When("^I run the command \"([^\"]*)\" on an existing GeoPackage file$") public void I_run_the_command_on_an_existing_GeoPackage_file(String commandSpec) throws Throwable { GeoPackageTestSupport support = new GeoPackageTestSupport(); commandSpec += " --database "; commandSpec += support.createDefaultTestData().getPath(); String[] args = commandSpec.split(" "); localRepo.runCommand(args); }
private DataStore store(File result) throws InterruptedException, ExecutionException { assertNotNull(result); return support.createDataStore(result); }
original = iter.next(); featureType = original.getFeatureType(); updated = transformFeatureId(original); updatedFeatures.add(updated); mappings.put(updated.getID(), original.getID());
@Test public void testExportWithInvalidFeatureType() throws Exception { GeopkgExport exportCommand = new GeopkgExport(); String geoPkgFileName = support.newFile().getAbsolutePath(); exportCommand.args = Arrays.asList("invalidType", "Points"); exportCommand.commonArgs.database = geoPkgFileName; exception.expect(InvalidParameterException.class); exportCommand.run(cli); }
localRepo.runCommand(true, "commit -m initial"); GeoPackageTestSupport support = new GeoPackageTestSupport(); File geoPkgFile = support.newFile(); String geoPkgFileName = geoPkgFile.getAbsolutePath(); exportCommand.args = Arrays.asList("Points", "Points"); exportCommand.run(localRepo.geogigCLI); DataStore gpkgStore = support.createDataStore(geoPkgFile);
public File createDefaultTestData() throws Exception { File file = createEmptyDatabase(); MemoryDataStore memStore = new MemoryDataStoreWithProvidedFIDSupport(); TestFeatures.setupFeatures(); memStore.addFeatures(ImmutableList.of(points1, points2, points3)); memStore.addFeatures(ImmutableList.of(lines1, lines2, lines3)); DataStore gpkgStore = createDataStore(file); try { export(memStore.getFeatureSource(pointsType.getName().getLocalPart()), gpkgStore); export(memStore.getFeatureSource(linesType.getName().getLocalPart()), gpkgStore); } finally { gpkgStore.dispose(); } return file; }