Search in sources :

Example 21 with TestPlatform

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

the class MongoCommitOpTest method createInjector.

@Override
protected Context createInjector() {
    File workingDirectory;
    try {
        workingDirectory = mockWorkingDirTempFolder.getRoot();
    } catch (Exception e) {
        throw Throwables.propagate(e);
    }
    Platform testPlatform = new TestPlatform(workingDirectory);
    return Guice.createInjector(Modules.override(new GeogigModule()).with(new MongoTestStorageModule(), new TestModule(testPlatform))).getInstance(Context.class);
}
Also used : TestPlatform(org.locationtech.geogig.api.TestPlatform) Platform(org.locationtech.geogig.api.Platform) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) GeogigModule(org.locationtech.geogig.di.GeogigModule)

Example 22 with TestPlatform

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

the class MongoConflictsTest method createInjector.

@Override
protected Context createInjector() {
    File workingDirectory;
    try {
        workingDirectory = mockWorkingDirTempFolder.getRoot();
    } catch (Exception e) {
        throw Throwables.propagate(e);
    }
    Platform testPlatform = new TestPlatform(workingDirectory);
    return Guice.createInjector(Modules.override(new GeogigModule()).with(new MongoTestStorageModule(), new TestModule(testPlatform))).getInstance(Context.class);
}
Also used : TestPlatform(org.locationtech.geogig.api.TestPlatform) Platform(org.locationtech.geogig.api.Platform) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) GeogigModule(org.locationtech.geogig.di.GeogigModule)

Example 23 with TestPlatform

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

the class GeogigPy4JEntryPointTest method setUpDirectories.

@Before
public void setUpDirectories() throws IOException {
    tempFolder = new TemporaryFolder();
    tempFolder.create();
    File homeDirectory = tempFolder.newFolder("fakeHomeDir").getCanonicalFile();
    File currentDirectory = tempFolder.newFolder("testrepo").getCanonicalFile();
    GlobalState.platform = new TestPlatform(currentDirectory, homeDirectory);
    GlobalContextBuilder.builder = new CLITestContextBuilder(platform);
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) CLITestContextBuilder(org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder) 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