Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotOverwriteAuthStoreLocationIfProvided()
        public virtual void ShouldNotOverwriteAuthStoreLocationIfProvided()
        {
            File   configFile = ConfigFileBuilder.Builder(Folder.Root).withSetting(GraphDatabaseSettings.data_directory, "the-data-dir").withSetting(GraphDatabaseSettings.auth_store, "foo/bar/auth").build();
            Config config     = Config.fromFile(configFile).withHome(Folder.Root).build();

            assertThat(config.Get(GraphDatabaseSettings.auth_store), @is((new File(Folder.Root, "foo/bar/auth")).AbsoluteFile));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSetAValueForAuthStoreLocation()
        public virtual void ShouldSetAValueForAuthStoreLocation()
        {
            File   configFile = ConfigFileBuilder.Builder(Folder.Root).withSetting(GraphDatabaseSettings.data_directory, "the-data-dir").build();
            Config config     = Config.fromFile(configFile).withHome(Folder.Root).build();

            assertThat(config.Get(DatabaseManagementSystemSettings.auth_store_directory), @is((new File(Folder.Root, "the-data-dir/dbms")).AbsoluteFile));
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldUseSpecifiedHomeDir()
        public virtual void ShouldUseSpecifiedHomeDir()
        {
            // given
            File configFile = ConfigFileBuilder.Builder(Folder.Root).build();

            // when
            Config testConf = Config.fromFile(configFile).withHome(Folder.Root).build();

            // then
            assertEquals(Folder.Root, testConf.Get(GraphDatabaseSettings.neo4j_home));
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldProvideAConfiguration()
        public virtual void ShouldProvideAConfiguration()
        {
            // given
            File configFile = ConfigFileBuilder.Builder(Folder.Root).build();

            // when
            Config config = Config.fromFile(configFile).withHome(Folder.Root).build();

            // then
            assertNotNull(config);
        }
Пример #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldUseWorkingDirForHomeDirIfUnspecified()
        public virtual void ShouldUseWorkingDirForHomeDirIfUnspecified()
        {
            // given
            File configFile = ConfigFileBuilder.Builder(Folder.Root).build();

            // when
            Config testConf = Config.fromFile(configFile).build();

            // then
            assertEquals(new File(System.getProperty("user.dir")), testConf.Get(GraphDatabaseSettings.neo4j_home));
        }
Пример #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void loadOfflineConfigAddDisabledBoltConnector()
        public virtual void LoadOfflineConfigAddDisabledBoltConnector()
        {
            // given
            File configFile = ConfigFileBuilder.Builder(Folder.Root).build();

            // when
            Config testConf = Config.fromFile(configFile).withHome(Folder.Root).withConnectorsDisabled().build();

            // then
            assertNotNull(testConf);
            assertEquals(false, testConf.Get((new BoltConnector()).enabled));
        }
Пример #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldUseSpecifiedConfigFile()
        public virtual void ShouldUseSpecifiedConfigFile()
        {
            // given
            File configFile = ConfigFileBuilder.Builder(Folder.Root).withNameValue(GraphDatabaseSettings.default_advertised_address.name(), "bar").build();

            // when
            Config testConf = Config.fromFile(configFile).withHome(Folder.Root).build();

            // then
            const string expectedValue = "bar";

            assertEquals(expectedValue, testConf.Get(GraphDatabaseSettings.default_advertised_address));
        }
Пример #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void loadOfflineConfigShouldDisableBolt()
        public virtual void LoadOfflineConfigShouldDisableBolt()
        {
            // given
            BoltConnector defaultBoltConf = new BoltConnector("bolt");
            File          configFile      = ConfigFileBuilder.Builder(Folder.Root).withNameValue(defaultBoltConf.Enabled.name(), Settings.TRUE).build();

            // when
            Config testConf = Config.fromFile(configFile).withHome(Folder.Root).withConnectorsDisabled().build();

            // then
            assertNotNull(testConf);
            assertEquals(false, testConf.Get(defaultBoltConf.Enabled));
            assertEquals(false, testConf.Get((new BoltConnector()).enabled));
        }
Пример #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRetainRegistrationOrderOfThirdPartyJaxRsPackages()
        public virtual void ShouldRetainRegistrationOrderOfThirdPartyJaxRsPackages()
        {
            // given
            File configFile = ConfigFileBuilder.Builder(Folder.Root).withNameValue(ServerSettings.third_party_packages.name(), "org.neo4j.extension.extension1=/extension1,org.neo4j.extension.extension2=/extension2," + "org.neo4j.extension.extension3=/extension3").build();

            // when
            Config config = Config.fromFile(configFile).withHome(Folder.Root).build();

            // then
            IList <ThirdPartyJaxRsPackage> thirdpartyJaxRsPackages = config.Get(ServerSettings.third_party_packages);

            assertEquals(3, thirdpartyJaxRsPackages.Count);
            assertEquals("/extension1", thirdpartyJaxRsPackages[0].MountPoint);
            assertEquals("/extension2", thirdpartyJaxRsPackages[1].MountPoint);
            assertEquals("/extension3", thirdpartyJaxRsPackages[2].MountPoint);
        }