Search in sources :

Example 1 with MemoryModule

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

the class ParseTimestampTest method setUp.

@Before
public void setUp() {
    File workingDirectory = tempFolder.newFolder("mockWorkingDir");
    Platform testPlatform = new TestPlatform(workingDirectory) {

        @Override
        public long currentTimeMillis() {
            return REFERENCE_DATE.getTime();
        }
    };
    Context injector = Guice.createInjector(Modules.override(new GeogigModule()).with(new MemoryModule(testPlatform))).getInstance(Context.class);
    fakeGeogig = new GeoGIG(injector, workingDirectory);
    assertNotNull(fakeGeogig.getOrCreateRepository());
    command = fakeGeogig.command(ParseTimestamp.class);
}
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) File(java.io.File) GeogigModule(org.locationtech.geogig.di.GeogigModule) MemoryModule(org.locationtech.geogig.api.MemoryModule) GeoGIG(org.locationtech.geogig.api.GeoGIG) Before(org.junit.Before)

Example 2 with MemoryModule

use of org.locationtech.geogig.api.MemoryModule 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 3 with MemoryModule

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

the class DiffTreeTest method setUp.

@Before
public void setUp() throws Exception {
    File workingDirectory = tempFolder.newFolder("mockWorkingDir");
    Platform testPlatform = new TestPlatform(workingDirectory);
    Context injector = Guice.createInjector(Modules.override(new GeogigModule()).with(new MemoryModule(testPlatform))).getInstance(Context.class);
    geogit = new GeoGIG(injector);
    assertNotNull(geogit.getOrCreateRepository());
    diffTree = geogit.command(DiffTree.class);
    SimpleFeatureType ft = DataUtilities.createType("points", "sp:String,ip:Integer,pp:Point:srid=3857");
    revtype = RevFeatureTypeImpl.build(ft);
    metadataId = revtype.getId();
    geogit.getContext().objectDatabase().put(revtype);
}
Also used : Context(org.locationtech.geogig.api.Context) TestPlatform(org.locationtech.geogig.api.TestPlatform) Platform(org.locationtech.geogig.api.Platform) SimpleFeatureType(org.opengis.feature.simple.SimpleFeatureType) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) GeogigModule(org.locationtech.geogig.di.GeogigModule) MemoryModule(org.locationtech.geogig.api.MemoryModule) GeoGIG(org.locationtech.geogig.api.GeoGIG) Before(org.junit.Before)

Example 4 with MemoryModule

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

the class WriteBackTest method setUp.

@Before
public void setUp() {
    Context injector = Guice.createInjector(Modules.override(new GeogigModule()).with(new MemoryModule(null))).getInstance(Context.class);
    odb = injector.objectDatabase();
    indexDb = injector.stagingDatabase();
    odb.open();
    indexDb.open();
    writeBack = injector.command(WriteBack.class);
}
Also used : Context(org.locationtech.geogig.api.Context) GeogigModule(org.locationtech.geogig.di.GeogigModule) MemoryModule(org.locationtech.geogig.api.MemoryModule) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)4 Context (org.locationtech.geogig.api.Context)4 MemoryModule (org.locationtech.geogig.api.MemoryModule)4 GeogigModule (org.locationtech.geogig.di.GeogigModule)4 File (java.io.File)3 GeoGIG (org.locationtech.geogig.api.GeoGIG)3 Platform (org.locationtech.geogig.api.Platform)3 TestPlatform (org.locationtech.geogig.api.TestPlatform)3 RevTree (org.locationtech.geogig.api.RevTree)1 RevTreeBuilder (org.locationtech.geogig.api.RevTreeBuilder)1 SimpleFeatureType (org.opengis.feature.simple.SimpleFeatureType)1