Search in sources :

Example 6 with TestPlatform

use of org.locationtech.geogig.api.TestPlatform 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)

Example 7 with TestPlatform

use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.

the class AbstractNodeIndexTest method before.

@Before
public void before() {
    tempFolder.newFolder(".geogig");
    File workingDirectory = tempFolder.getRoot();
    Platform platform = new TestPlatform(workingDirectory);
    executorService = Executors.newFixedThreadPool(4);
    index = createIndex(platform, executorService);
}
Also used : TestPlatform(org.locationtech.geogig.api.TestPlatform) Platform(org.locationtech.geogig.api.Platform) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) Before(org.junit.Before)

Example 8 with TestPlatform

use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.

the class GraphDatabaseTest method setUp.

@Before
public void setUp() throws Exception {
    File root = tmpFolder.getRoot();
    tmpFolder.newFolder(".geogig");
    platform = new TestPlatform(root);
    platform.setUserHome(tmpFolder.newFolder("fake_home"));
    database = createDatabase(platform);
    database.open();
}
Also used : TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) Before(org.junit.Before)

Example 9 with TestPlatform

use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.

the class DepthSearchTest method setUp.

@Before
public void setUp() throws IOException {
    File envHome = tempFolder.getRoot();
    Platform testPlatform = new TestPlatform(envHome);
    Context injector = Guice.createInjector(Modules.override(new GeogigModule()).with(new MemoryModule(testPlatform))).getInstance(Context.class);
    fakeGeogig = new GeoGIG(injector);
    Repository fakeRepo = fakeGeogig.getOrCreateRepository();
    odb = fakeRepo.objectDatabase();
    search = new DepthSearch(odb);
    RevTreeBuilder root = new RevTreeBuilder(odb);
    root = addTree(root, "path/to/tree1", "node11", "node12", "node13");
    root = addTree(root, "path/to/tree2", "node21", "node22", "node23");
    root = addTree(root, "tree3", "node31", "node32", "node33");
    RevTree rootTree = root.build();
    odb.put(rootTree);
    rootTreeId = rootTree.getId();
}
Also used : Context(org.locationtech.geogig.api.Context) TestPlatform(org.locationtech.geogig.api.TestPlatform) Platform(org.locationtech.geogig.api.Platform) TestPlatform(org.locationtech.geogig.api.TestPlatform) RevTreeBuilder(org.locationtech.geogig.api.RevTreeBuilder) File(java.io.File) GeogigModule(org.locationtech.geogig.di.GeogigModule) MemoryModule(org.locationtech.geogig.api.MemoryModule) GeoGIG(org.locationtech.geogig.api.GeoGIG) RevTree(org.locationtech.geogig.api.RevTree) Before(org.junit.Before)

Example 10 with TestPlatform

use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.

the class GraphDatabaseStressTest method setUp.

@Before
public void setUp() throws Exception {
    File root = tmpFolder.getRoot();
    tmpFolder.newFolder(".geogig");
    platform = new TestPlatform(root);
    platform.setUserHome(tmpFolder.newFolder("fake_home"));
    database = createDatabase(platform);
    database.open();
}
Also used : TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) Before(org.junit.Before)

Aggregations

TestPlatform (org.locationtech.geogig.api.TestPlatform)23 File (java.io.File)21 Before (org.junit.Before)18 Platform (org.locationtech.geogig.api.Platform)9 CLITestContextBuilder (org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder)9 UnsupportedTerminal (jline.UnsupportedTerminal)7 ConsoleReader (jline.console.ConsoleReader)7 GeogigCLI (org.locationtech.geogig.cli.GeogigCLI)7 GeogigModule (org.locationtech.geogig.di.GeogigModule)6 Context (org.locationtech.geogig.api.Context)5 GeoGIG (org.locationtech.geogig.api.GeoGIG)5 MemoryModule (org.locationtech.geogig.api.MemoryModule)3 RevTree (org.locationtech.geogig.api.RevTree)2 Cache (com.google.common.cache.Cache)1 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 AbstractModule (com.google.inject.AbstractModule)1 Module (com.google.inject.Module)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1