public synchronized static void setupFeatures() throws Exception { if (created) { return; } pointsType = DataUtilities.createType(pointsNs, pointsName, pointsTypeSpec); modifiedPointsType = DataUtilities.createType(pointsNs, pointsName, modifiedPointsTypeSpec); points1 = feature(pointsType, idP1, "StringProp1_1", new Integer(1000), "POINT(1 1)"); points1_modified = feature(pointsType, idP1, "StringProp1_1a", new Integer(1001), "POINT(1 2)"); points1_FTmodified = feature(modifiedPointsType, idP1, "StringProp1_1", new Integer(1000), "POINT(1 1)", "ExtraString"); points2 = feature(pointsType, idP2, "StringProp1_2", new Integer(2000), "POINT(2 2)"); points3 = feature(pointsType, idP3, "StringProp1_3", new Integer(3000), "POINT(3 3)"); linesType = DataUtilities.createType(linesNs, linesName, linesTypeSpec); lines1 = feature(linesType, idL1, "StringProp2_1", new Integer(1000), "LINESTRING (1 1, 2 2)"); lines2 = feature(linesType, idL2, "StringProp2_2", new Integer(2000), "LINESTRING (3 3, 4 4)"); lines3 = feature(linesType, idL3, "StringProp2_3", new Integer(3000), "LINESTRING (5 5, 6 6)"); created = true; }
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); }
public synchronized static void setupFeatures() throws Exception { if (created) { return; } pointsType = DataUtilities.createType(pointsNs, pointsName, pointsTypeSpec); modifiedPointsType = DataUtilities.createType(pointsNs, pointsName, modifiedPointsTypeSpec); points1 = feature(pointsType, idP1, "StringProp1_1", new Integer(1000), "POINT(1 1)"); points1_modified = feature(pointsType, idP1, "StringProp1_1a", new Integer(1001), "POINT(1 2)"); points1_FTmodified = feature(modifiedPointsType, idP1, "StringProp1_1", new Integer(1000), "POINT(1 1)", "ExtraString"); points2 = feature(pointsType, idP2, "StringProp1_2", new Integer(2000), "POINT(2 2)"); points3 = feature(pointsType, idP3, "StringProp1_3", new Integer(3000), "POINT(3 3)"); linesType = DataUtilities.createType(linesNs, linesName, linesTypeSpec); lines1 = feature(linesType, idL1, "StringProp2_1", new Integer(1000), "LINESTRING (1 1, 2 2)"); lines2 = feature(linesType, idL2, "StringProp2_2", new Integer(2000), "LINESTRING (3 3, 4 4)"); lines3 = feature(linesType, idL3, "StringProp2_3", new Integer(3000), "LINESTRING (5 5, 6 6)"); created = true; }
/** * 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); }
public synchronized static void setupFeatures() throws Exception { if (created) { return; } pointsType = DataUtilities.createType(pointsNs, pointsName, pointsTypeSpec); modifiedPointsType = DataUtilities.createType(pointsNs, pointsName, modifiedPointsTypeSpec); points1 = feature(pointsType, idP1, "StringProp1_1", new Integer(1000), "POINT(1 1)"); points1_modified = feature(pointsType, idP1, "StringProp1_1a", new Integer(1001), "POINT(1 2)"); points1_FTmodified = feature(modifiedPointsType, idP1, "StringProp1_1", new Integer(1000), "POINT(1 1)", "ExtraString"); points2 = feature(pointsType, idP2, "StringProp1_2", new Integer(2000), "POINT(2 2)"); points3 = feature(pointsType, idP3, "StringProp1_3", new Integer(3000), "POINT(3 3)"); linesType = DataUtilities.createType(linesNs, linesName, linesTypeSpec); lines1 = feature(linesType, idL1, "StringProp2_1", new Integer(1000), "LINESTRING (1 1, 2 2)"); lines2 = feature(linesType, idL2, "StringProp2_2", new Integer(2000), "LINESTRING (3 3, 4 4)"); lines3 = feature(linesType, idL3, "StringProp2_3", new Integer(3000), "LINESTRING (5 5, 6 6)"); created = true; }
/** * 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); }