예제 #1
0
 protected internal override void Configure(GraphDatabaseBuilder builder)
 {
     // Reduce the default page cache memory size to 8 mega-bytes for test databases.
     builder.SetConfig(GraphDatabaseSettings.pagecache_memory, "8m");
     builder.setConfig((new BoltConnector("bolt")).type, BOLT.name());
     builder.SetConfig((new BoltConnector("bolt")).enabled, "false");
 }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void requiresTypeWhenNameIsNotBolt()
        public virtual void RequiresTypeWhenNameIsNotBolt()
        {
            string randomEnabled = "dbms.connector.bla.enabled";
            string randomType    = "dbms.connector.bla.type";

            assertEquals(stringMap(randomEnabled, "true", randomType, BOLT.name()), Cv.validate(stringMap(randomEnabled, "true", randomType, BOLT.name()), _warningConsumer));

            Expected.expect(typeof(InvalidSettingException));
            Expected.expectMessage("Missing mandatory value for 'dbms.connector.bla.type'");

            Cv.validate(stringMap(randomEnabled, "true"), _warningConsumer);
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void validatesAdvertisedAddress()
        public virtual void ValidatesAdvertisedAddress()
        {
            string key = "dbms.connector.bolt.advertised_address";

            assertEquals(stringMap(key, "localhost:123"), Cv.validate(stringMap(key, "localhost:123"), _warningConsumer));

            key = "dbms.connector.bla.advertised_address";
            string type = "dbms.connector.bla.type";

            assertEquals(stringMap(key, "localhost:123", type, BOLT.name()), Cv.validate(stringMap(key, "localhost:123", type, BOLT.name()), _warningConsumer));

            assertEquals(stringMap(key, "localhost:123", type, BOLT.name()), Cv.validate(stringMap(key, "localhost:123", type, BOLT.name()), _warningConsumer));

            Expected.expect(typeof(InvalidSettingException));
            Expected.expectMessage("Setting \"dbms.connector.bla.advertised_address\" must be in the format " + "\"hostname:port\" or \":port\". \"BOBO\" does not conform to these formats");

            Cv.validate(stringMap(key, "BOBO", type, BOLT.name()), _warningConsumer);
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void validatesTlsLevel()
        public virtual void ValidatesTlsLevel()
        {
            string key = "dbms.connector.bolt.tls_level";

            assertEquals(stringMap(key, EncryptionLevel.DISABLED.name()), Cv.validate(stringMap(key, EncryptionLevel.DISABLED.name()), _warningConsumer));

            assertEquals(stringMap(key, EncryptionLevel.OPTIONAL.name()), Cv.validate(stringMap(key, EncryptionLevel.OPTIONAL.name()), _warningConsumer));

            assertEquals(stringMap(key, EncryptionLevel.REQUIRED.name()), Cv.validate(stringMap(key, EncryptionLevel.REQUIRED.name()), _warningConsumer));

            key = "dbms.connector.bla.tls_level";
            string type = "dbms.connector.bla.type";

            assertEquals(stringMap(key, EncryptionLevel.DISABLED.name(), type, BOLT.name()), Cv.validate(stringMap(key, EncryptionLevel.DISABLED.name(), type, BOLT.name()), _warningConsumer));

            assertEquals(stringMap(key, EncryptionLevel.OPTIONAL.name(), type, BOLT.name()), Cv.validate(stringMap(key, EncryptionLevel.OPTIONAL.name(), type, BOLT.name()), _warningConsumer));

            assertEquals(stringMap(key, EncryptionLevel.REQUIRED.name(), type, BOLT.name()), Cv.validate(stringMap(key, EncryptionLevel.REQUIRED.name(), type, BOLT.name()), _warningConsumer));

            Expected.expect(typeof(InvalidSettingException));
            Expected.expectMessage("Bad value 'BOBO' for setting 'dbms.connector.bla.tls_level': must be one of [REQUIRED, OPTIONAL, " + "DISABLED] case sensitive");

            Cv.validate(stringMap(key, "BOBO", type, BOLT.name()), _warningConsumer);
        }
예제 #5
0
 private GraphDatabaseService StartDbWithBolt(GraphDatabaseFactory dbFactory)
 {
     return(dbFactory.NewEmbeddedDatabaseBuilder(_dir.storeDir()).setConfig((new BoltConnector("bolt")).type, BOLT.name()).setConfig((new BoltConnector("bolt")).enabled, TRUE).setConfig((new BoltConnector("bolt")).listen_address, "localhost:0").setConfig(GraphDatabaseSettings.auth_enabled, FALSE).setConfig(OnlineBackupSettings.online_backup_enabled, FALSE).newGraphDatabase());
 }