use of org.apache.jackrabbit.core.data.Backend in project jackrabbit by apache.
the class S3TestDataStore method createBackend.
protected Backend createBackend() {
Backend backend = new S3Backend();
((S3Backend) backend).setProperties(props);
return backend;
}
use of org.apache.jackrabbit.core.data.Backend in project jackrabbit by apache.
the class TestS3Ds method deleteBucket.
/**
* Cleaning of bucket after test run.
*/
/**
* Cleaning of bucket after test run.
*/
public void deleteBucket() throws Exception {
Backend backend = ((S3DataStore) ds).getBackend();
String bucket = ((S3Backend) backend).getBucket();
deleteBucket(bucket);
}
use of org.apache.jackrabbit.core.data.Backend in project jackrabbit-oak by apache.
the class DataStoreServiceTest method configCachingFDS.
/**
*
* Test @CachingFDS is returned when cacheSize > 0
*/
@Test
public void configCachingFDS() throws Exception {
System.setProperty(JR2_CACHING_PROP, "true");
try {
String nasPath = folder.getRoot().getAbsolutePath() + "/NASPath";
String cachePath = folder.getRoot().getAbsolutePath() + "/cachePath";
long cacheSize = 100L;
Map<String, Object> config = new HashMap<String, Object>();
config.put("repository.home", folder.getRoot().getAbsolutePath());
config.put(FileDataStoreService.CACHE_SIZE, cacheSize);
config.put(FileDataStoreService.PATH, nasPath);
config.put(FileDataStoreService.CACHE_PATH, cachePath);
FileDataStoreService fdsSvc = new FileDataStoreService();
DataStore ds = fdsSvc.createDataStore(context.componentContext(), config);
PropertiesUtil.populate(ds, config, false);
ds.init(folder.getRoot().getAbsolutePath());
assertTrue("not instance of CachingFDS", ds instanceof CachingFDS);
CachingFDS cds = (CachingFDS) ds;
assertEquals("cachesize not equal", cacheSize, cds.getCacheSize());
assertEquals("cachepath not equal", cachePath, cds.getPath());
Backend backend = cds.getBackend();
Properties props = (Properties) getField(backend);
assertEquals("path not equal", nasPath, props.getProperty(FSBackend.FS_BACKEND_PATH));
} finally {
System.clearProperty(JR2_CACHING_PROP);
}
}
Aggregations