Search in sources :

Example 1 with GeoGigDataStore

use of org.locationtech.geogig.geotools.data.GeoGigDataStore in project GeoGig by boundlessgeo.

the class DataStoreConcurrencyTest method beforeTest.

@Before
public void beforeTest() throws Exception {
    File workingDirectory = tmp.newFolder("repo");
    File userHomeDirectory = tmp.newFolder("home");
    TestPlatform platform = new TestPlatform(workingDirectory);
    platform.setUserHome(userHomeDirectory);
    Context injector = new CLITestContextBuilder(platform).build();
    GeoGIG geogig = new GeoGIG(injector);
    geogig.command(InitOp.class).call();
    geogig.command(ConfigOp.class).setAction(ConfigAction.CONFIG_SET).setName("user.name").setValue("gabriel").call();
    geogig.command(ConfigOp.class).setAction(ConfigAction.CONFIG_SET).setName("user.email").setValue("gabriel@roldan.example.com").call();
    store = new GeoGigDataStore(geogig);
    store.createSchema(pointType);
    editThreads = Executors.newFixedThreadPool(writeThreadCount, new ThreadFactoryBuilder().setNameFormat("edit-thread-%d").build());
    readThreads = Executors.newFixedThreadPool(readThreadCount, new ThreadFactoryBuilder().setNameFormat("read-thread-%d").build());
    initialCommitCount = copyOf(store.getGeogig().command(LogOp.class).call()).size();
}
Also used : Context(org.locationtech.geogig.api.Context) InitOp(org.locationtech.geogig.api.porcelain.InitOp) TestPlatform(org.locationtech.geogig.api.TestPlatform) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) GeoGigDataStore(org.locationtech.geogig.geotools.data.GeoGigDataStore) File(java.io.File) CLITestContextBuilder(org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder) GeoGIG(org.locationtech.geogig.api.GeoGIG) Before(org.junit.Before)

Aggregations

ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 File (java.io.File)1 Before (org.junit.Before)1 Context (org.locationtech.geogig.api.Context)1 GeoGIG (org.locationtech.geogig.api.GeoGIG)1 TestPlatform (org.locationtech.geogig.api.TestPlatform)1 InitOp (org.locationtech.geogig.api.porcelain.InitOp)1 CLITestContextBuilder (org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder)1 GeoGigDataStore (org.locationtech.geogig.geotools.data.GeoGigDataStore)1