use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.
the class CachingModuleTest method setUp.
@Before
public void setUp() throws Exception {
odbCache = mock(Cache.class);
indexCache = mock(Cache.class);
final ObjectDatabaseCacheFactory odbCacheFac = mock(ObjectDatabaseCacheFactory.class);
when(odbCacheFac.get()).thenReturn(odbCache);
final StagingDatabaseCacheFactory indexCacheFac = mock(StagingDatabaseCacheFactory.class);
when(indexCacheFac.get()).thenReturn(indexCache);
File workingDirectory = tmpFolder.getRoot();
final Platform platform = new TestPlatform(workingDirectory);
Module module = new AbstractModule() {
@Override
protected void configure() {
bind(Context.class).to(GuiceInjector.class).in(Scopes.SINGLETON);
Multibinder.newSetBinder(binder(), Decorator.class);
bind(DecoratorProvider.class).in(Scopes.SINGLETON);
DataStreamSerializationFactoryV1 sfac = DataStreamSerializationFactoryV1.INSTANCE;
bind(ObjectSerializingFactory.class).toInstance(sfac);
bind(ObjectDatabase.class).to(HeapObjectDatabse.class).in(Scopes.SINGLETON);
bind(StagingDatabase.class).to(HeapStagingDatabase.class).in(Scopes.SINGLETON);
ConfigDatabase config = new IniFileConfigDatabase(platform);
bind(ConfigDatabase.class).toInstance(config);
bind(ObjectDatabaseCacheFactory.class).toInstance(odbCacheFac);
bind(StagingDatabaseCacheFactory.class).toInstance(indexCacheFac);
}
};
Context injector = Guice.createInjector(Modules.override(new CachingModule()).with(module)).getInstance(org.locationtech.geogig.api.Context.class);
odb = injector.objectDatabase();
index = injector.stagingDatabase();
odb.open();
index.open();
odb.put(o1);
odb.put(o2);
odb.put(o3);
index.put(s1);
index.put(s2);
index.put(s3);
}
use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.
the class RepositoryTestCase method createInjector.
protected Context createInjector() {
Platform testPlatform = createPlatform();
GlobalContextBuilder.builder = new TestContextBuilder(testPlatform);
return GlobalContextBuilder.builder.build();
}
use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.
the class JEObjectDatabaseTest method setUp.
@Before
public void setUp() {
File root = folder.getRoot();
folder.newFolder(".geogig");
File home = folder.newFolder("home");
platform = new TestPlatform(root);
platform.setUserHome(home);
hints = new Hints();
envProvider = new EnvironmentBuilder(platform);
}
use of org.locationtech.geogig.api.TestPlatform in project GeoGig by boundlessgeo.
the class PointCacheTest method before.
@Before
public void before() {
tmpFolder.newFolder(".geogig");
TestPlatform platform = new TestPlatform(tmpFolder.getRoot());
platform.setUserHome(tmpFolder.newFolder("fakeHome"));
cache = createCache(platform);
}
use of org.locationtech.geogig.api.TestPlatform 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);
}
Aggregations