Exemple #1
0
 MONGO_INITIALIZER(ToolMocks)(InitializerContext*) {
     setGlobalAuthorizationManager(new AuthorizationManager(
             new AuthzManagerExternalStateMock()));
     repl::setGlobalReplicationCoordinator(new repl::ReplicationCoordinatorMock());
     setGlobalEnvironment(new GlobalEnvironmentNoop());
     return Status::OK();
 }
    RangeDeleterMockEnv::RangeDeleterMockEnv():
        _deleteListMutex("delList"),
        _cursorMapMutex("cursorMap"),
        _pauseDeleteMutex("pauseDelete"),
        _pauseDelete(false),
        _pausedCount(0),
        _envStatMutex("envStat"),
        _getCursorsCallCount(0) {

        setGlobalEnvironment(new GlobalEnvironmentNoop());
    }
Exemple #3
0
int dbtestsMain( int argc, char** argv, char** envp ) {
    static StaticObserver StaticObserver;
    setWindowsUnhandledExceptionFilter();
    setGlobalEnvironment(new GlobalEnvironmentMongoD());
    repl::ReplSettings replSettings;
    replSettings.oplogSize = 10 * 1024 * 1024;
    repl::setGlobalReplicationCoordinator(new repl::ReplicationCoordinatorMock(replSettings));
    Command::testCommandsEnabled = 1;
    mongo::runGlobalInitializersOrDie(argc, argv, envp);
    setGlobalAuthorizationManager(new AuthorizationManager(new AuthzManagerExternalStateMock()));
    StartupTest::runTests();
    return mongo::dbtests::runDbTests(argc, argv);
}
 MONGO_INITIALIZER(SetGlobalEnvironment)(InitializerContext* context) {
     setGlobalEnvironment(new GlobalEnvironmentMongoD());
     return Status::OK();
 }