Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shutdownDatabaseOnStop() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShutdownDatabaseOnStop()
        {
            DatabaseManager databaseManager = DatabaseManager;

            databaseManager.Stop();
            assertFalse(_database.isAvailable(0));
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void lookupExistingDatabase()
        internal virtual void LookupExistingDatabase()
        {
            DatabaseManager databaseManager         = DatabaseManager;
            Optional <GraphDatabaseFacade> database = databaseManager.GetDatabaseFacade(GraphDatabaseSettings.DEFAULT_DATABASE_NAME);

            assertTrue(database.Present);
        }
 public BoltStateMachineFactoryImpl(DatabaseManager databaseManager, UsageData usageData, Authentication authentication, Clock clock, Config config, LogService logging)
 {
     this._databaseManager    = databaseManager;
     this._usageData          = usageData;
     this._logging            = logging;
     this._authentication     = authentication;
     this._config             = config;
     this._clock              = clock;
     this._activeDatabaseName = config.Get(GraphDatabaseSettings.active_database);
 }
        private static DatabaseManager NewDbMock()
        {
            GraphDatabaseFacade db = mock(typeof(GraphDatabaseFacade));
            DependencyResolver  dependencyResolver = mock(typeof(DependencyResolver));

            when(Db.DependencyResolver).thenReturn(dependencyResolver);
            GraphDatabaseQueryService queryService = mock(typeof(GraphDatabaseQueryService));

            when(queryService.DependencyResolver).thenReturn(dependencyResolver);
            when(dependencyResolver.ResolveDependency(typeof(GraphDatabaseQueryService))).thenReturn(queryService);
            DatabaseManager databaseManager = mock(typeof(DatabaseManager));

            when(databaseManager.GetDatabaseFacade(CUSTOM_DB_NAME)).thenReturn(db);
            return(databaseManager);
        }
Esempio n. 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void createDatabase()
        internal virtual void CreateDatabase()
        {
            DatabaseManager databaseManager = DatabaseManager;

            assertThrows(typeof(System.InvalidOperationException), () => databaseManager.CreateDatabase(GraphDatabaseSettings.DEFAULT_DATABASE_NAME));
        }
        private static BoltStateMachineFactoryImpl NewBoltFactory(DatabaseManager databaseManager)
        {
            Config config = Config.defaults(GraphDatabaseSettings.active_database, CUSTOM_DB_NAME);

            return(new BoltStateMachineFactoryImpl(databaseManager, new UsageData(new OnDemandJobScheduler()), mock(typeof(Authentication)), _clock, config, NullLogService.Instance));
        }