use of com.mongodb.DBEncoder in project jackrabbit-oak by apache.
the class MongoDBExceptionTest method before.
@Before
public void before() throws Exception {
OakFongo fongo = new OakFongo("fongo") {
@Override
protected void beforeExecuteBulkWriteOperation(boolean ordered, Boolean bypassDocumentValidation, List<?> writeRequests, WriteConcern aWriteConcern) {
maybeThrow();
}
@Override
protected void beforeFindAndModify(DBObject query, DBObject fields, DBObject sort, boolean remove, DBObject update, boolean returnNew, boolean upsert) {
maybeThrow();
}
@Override
protected void beforeUpdate(DBObject q, DBObject o, boolean upsert, boolean multi, WriteConcern concern, DBEncoder encoder) {
maybeThrow();
}
@Override
protected void beforeFind(DBObject query, DBObject projection) {
maybeThrow();
}
private void maybeThrow() {
if (exceptionMsg != null) {
throw new MongoException(exceptionMsg);
}
}
};
store = new MongoDocumentStore(fongo.getMongo(), "oak", new DocumentMK.Builder());
}
Aggregations