use of org.apache.jackrabbit.oak.plugins.document.DocumentStoreFixture in project jackrabbit-oak by apache.
the class MongoCacheConsistencyTest method getFixture.
@Override
public DocumentStoreFixture getFixture() throws Exception {
Fongo fongo = new OakFongo("fongo") {
private String suppressedEx = null;
@Override
protected void afterInsert(WriteResult result) {
maybeThrow();
}
@Override
protected void afterFindAndModify(DBObject result) {
maybeThrow();
}
@Override
protected void afterUpdate(WriteResult result) {
maybeThrow();
}
@Override
protected void afterRemove(WriteResult result) {
maybeThrow();
}
@Override
protected void beforeExecuteBulkWriteOperation(boolean ordered, Boolean bypassDocumentValidation, List<?> writeRequests, WriteConcern aWriteConcern) {
// suppress potentially set exception message because
// fongo bulk writes call other update methods
suppressedEx = exceptionMsg;
exceptionMsg = null;
}
@Override
protected void afterExecuteBulkWriteOperation(BulkWriteResult result) {
exceptionMsg = suppressedEx;
suppressedEx = null;
maybeThrow();
}
private void maybeThrow() {
if (exceptionMsg != null) {
throw new MongoException(exceptionMsg);
}
}
};
DocumentMK.Builder builder = provider.newBuilder().setAsyncDelay(0);
final DocumentStore store = new MongoDocumentStore(fongo.getMongo(), "oak", builder);
return new DocumentStoreFixture() {
@Override
public String getName() {
return "MongoDB";
}
@Override
public DocumentStore createDocumentStore(DocumentMK.Builder builder) {
return store;
}
};
}
use of org.apache.jackrabbit.oak.plugins.document.DocumentStoreFixture in project jackrabbit-oak by apache.
the class RDBCacheConsistencyTest method fixtures.
protected static Collection<Object[]> fixtures(boolean multi) {
Collection<Object[]> result = new ArrayList<Object[]>();
DocumentStoreFixture[] candidates = new DocumentStoreFixture[] { DocumentStoreFixture.RDB_H2, DocumentStoreFixture.RDB_DERBY, DocumentStoreFixture.RDB_PG, DocumentStoreFixture.RDB_DB2, DocumentStoreFixture.RDB_MYSQL, DocumentStoreFixture.RDB_ORACLE, DocumentStoreFixture.RDB_MSSQL };
for (DocumentStoreFixture dsf : candidates) {
if (dsf.isAvailable()) {
if (!multi || dsf.hasSinglePersistence()) {
result.add(new Object[] { dsf });
}
}
}
return result;
}
use of org.apache.jackrabbit.oak.plugins.document.DocumentStoreFixture in project jackrabbit-oak by apache.
the class RDBDocumentStoreSchemaUpgradeTest method fixtures.
@Parameterized.Parameters(name = "{0}")
public static java.util.Collection<Object[]> fixtures() {
java.util.Collection<Object[]> result = new ArrayList<Object[]>();
DocumentStoreFixture[] candidates = new DocumentStoreFixture[] { DocumentStoreFixture.RDB_H2, DocumentStoreFixture.RDB_DERBY, DocumentStoreFixture.RDB_PG, DocumentStoreFixture.RDB_DB2, DocumentStoreFixture.RDB_MYSQL, DocumentStoreFixture.RDB_ORACLE, DocumentStoreFixture.RDB_MSSQL };
for (DocumentStoreFixture dsf : candidates) {
if (dsf.isAvailable()) {
result.add(new Object[] { dsf });
}
}
return result;
}
Aggregations