Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLogHelpfulStartupMessages()
        public virtual void ShouldLogHelpfulStartupMessages()
        {
            CommunityBootstrapper        boot          = new CommunityBootstrapper();
            IDictionary <string, string> propertyPairs = PropertyPairs;

            CommunityBootstrapper.start(TestDir.directory(), (new File("nonexistent-file.conf")), propertyPairs);
            URI uri = boot.Server.baseUri();

            boot.Stop();

            IList <string> captured = SuppressOutput.OutputVoice.lines();

            assertThat(captured, ContainsAtLeastTheseLines(Warn("Config file \\[nonexistent-file.conf\\] does not exist."), Info(NEO4J_IS_STARTING_MESSAGE), Info("Starting..."), Info("Started."), Info("Remote interface available at " + uri.ToString()), Info("Stopping..."), Info("Stopped.")));
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void serverDatabaseShouldStartOnOlderStoreWhenUpgradeIsEnabled() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ServerDatabaseShouldStartOnOlderStoreWhenUpgradeIsEnabled()
            {
                File rootDir           = TestDir.directory();
                File databaseDirectory = Config.defaults(GraphDatabaseSettings.data_directory, rootDir.ToString()).get(GraphDatabaseSettings.database_path);

                Store.prepareDirectory(databaseDirectory);

                File       configFile = new File(rootDir, Config.DEFAULT_CONFIG_FILE_NAME);
                Properties props      = new Properties();

                props.putAll(ServerTestUtils.DefaultRelativeProperties);
                props.setProperty(GraphDatabaseSettings.data_directory.name(), rootDir.AbsolutePath);
                props.setProperty(GraphDatabaseSettings.logs_directory.name(), rootDir.AbsolutePath);
                props.setProperty(GraphDatabaseSettings.allow_upgrade.name(), "true");
                props.setProperty(GraphDatabaseSettings.pagecache_memory.name(), "8m");
                props.setProperty((new HttpConnector("http")).type.name(), "HTTP");
                props.setProperty((new HttpConnector("http")).enabled.name(), "true");
                props.setProperty((new HttpConnector("http")).listen_address.name(), "localhost:0");
                props.setProperty((new HttpConnector("https")).enabled.name(), Settings.FALSE);
                props.setProperty(OnlineBackupSettings.online_backup_enabled.name(), Settings.FALSE);
                props.setProperty((new BoltConnector("bolt")).enabled.name(), Settings.FALSE);
                using (StreamWriter writer = new StreamWriter(configFile))
                {
                    props.store(writer, "");
                }

                ServerBootstrapper bootstrapper = new CommunityBootstrapper();

                try
                {
                    ServerBootstrapper.start(rootDir.AbsoluteFile, configFile, Collections.emptyMap());
                    assertTrue(bootstrapper.Running);
                    CheckInstance(Store, bootstrapper.Server.Database.Graph);
                }
                finally
                {
                    bootstrapper.Stop();
                }

                assertConsistentStore(DatabaseLayout.of(databaseDirectory));
            }