use of com.torodb.mongodb.core.MongodServer in project torodb by torodb.
the class BDDOplogTest method execute.
@Override
public void execute(OplogTestContext context) throws Exception {
MongodServer server = context.getMongodServer();
try (MongodConnection conn = server.openConnection()) {
try (WriteMongodTransaction trans = conn.openWriteTransaction(true)) {
given(trans);
trans.commit();
}
}
context.apply(streamOplog(), getApplierContext());
try (MongodConnection conn = server.openConnection()) {
try (ReadOnlyMongodTransaction trans = conn.openReadOnlyTransaction()) {
then(trans);
}
}
}
use of com.torodb.mongodb.core.MongodServer in project torodb by torodb.
the class OplogTestContextResourceRule method before.
@Override
protected void before() throws Throwable {
testInjector = Guice.createInjector(new ReplTestModule(), new TorodServerTestModule(), new CoreModule(), new BackendModule(), new DerbyBackendModule(), new MetainfModule(), new D2RModule(), new MemoryTorodModule(), new MetricsModule(new MetricsConfig() {
@Override
public Boolean getMetricsEnabled() {
return true;
}
}), new ConcurrentModule(), new MongoLayerModule(), new MongodServerTestModule(), specificModuleSupplier.get());
torodServer = testInjector.getInstance(TorodBundle.class).getTorodServer();
torodServer.startAsync();
mongodServer = testInjector.getInstance(MongodServer.class);
mongodServer.startAsync();
mongodServer.awaitRunning();
assert mongodServer.getTorodServer().equals(torodServer);
torodServer.awaitRunning();
oplogManager = testInjector.getInstance(OplogManager.class);
oplogManager.startAsync();
oplogManager.awaitRunning();
aobe = testInjector.getInstance(AnalyzedOplogBatchExecutor.class);
aobe.startAsync();
aobe.awaitRunning();
oplogApplier = testInjector.getInstance(OplogApplier.class);
testContext = new DefaultOplogTestContext(mongodServer, oplogApplier);
}
Aggregations