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; }
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; }
/** * Initializes this context provider to set up the initial context (temporary folder with * "userhome" and "data" directories to be used as the repositories home and workingdir folders * respectively; initialization of the {@link GlobalContextBuilder} to use * {@link CLITestContextBuilder}, and {@link TestRepoURIBuilder#before()} initialization in case * it needs to set up temporary resources. * <p> * This mehtod is idempotent, only the first call makes effect, hence it's safe to call it from * any step definition class where it's used. */ public synchronized void before() throws Throwable { if (tempFolder != null) { return; } URIBuilder.before(); tempFolder = new TemporaryFolder(); tempFolder.create(); TestFeatures.setupFeatures(); this.homeDir = tempFolder.newFolder("userhome"); this.workingDir = tempFolder.newFolder("data"); CLITestContextBuilder testContextBuilder = new CLITestContextBuilder( new TestPlatform(workingDir, homeDir)); GlobalContextBuilder.builder(testContextBuilder); }
/** * Initializes this context provider to set up the initial context (temporary folder with * "userhome" and "data" directories to be used as the repositories home and workingdir folders * respectively; initialization of the {@link GlobalContextBuilder} to use * {@link CLITestContextBuilder}, and {@link TestRepoURIBuilder#before()} initialization in case * it needs to set up temporary resources. * <p> * This mehtod is idempotent, only the first call makes effect, hence it's safe to call it from * any step definition class where it's used. */ public synchronized void before() throws Throwable { if (tempFolder != null) { return; } URIBuilder.before(); tempFolder = new TemporaryFolder(); tempFolder.create(); TestFeatures.setupFeatures(); this.homeDir = tempFolder.newFolder("userhome"); this.workingDir = tempFolder.newFolder("data"); CLITestContextBuilder testContextBuilder = new CLITestContextBuilder( new TestPlatform(workingDir, homeDir)); GlobalContextBuilder.builder(testContextBuilder); }
/** * Initializes this context provider to set up the initial context (temporary folder with * "userhome" and "data" directories to be used as the repositories home and workingdir folders * respectively; initialization of the {@link GlobalContextBuilder} to use * {@link CLITestContextBuilder}, and {@link TestRepoURIBuilder#before()} initialization in case * it needs to set up temporary resources. * <p> * This mehtod is idempotent, only the first call makes effect, hence it's safe to call it from * any step definition class where it's used. */ public synchronized void before() throws Throwable { if (tempFolder != null) { return; } URIBuilder.before(); tempFolder = new TemporaryFolder(); tempFolder.create(); TestFeatures.setupFeatures(); this.homeDir = tempFolder.newFolder("userhome"); this.workingDir = tempFolder.newFolder("data"); CLITestContextBuilder testContextBuilder = new CLITestContextBuilder( new TestPlatform(workingDir, homeDir)); GlobalContextBuilder.builder(testContextBuilder); }