示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRuleWorkWithExistingDirectory() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRuleWorkWithExistingDirectory()
        {
            // given a root folder, create /databases/graph.db folders.
            File oldDir             = TestDirectory.directory("old");
            File storeDir           = Config.defaults(GraphDatabaseSettings.data_directory, oldDir.toPath().ToString()).get(GraphDatabaseSettings.database_path);
            GraphDatabaseService db = (new TestGraphDatabaseFactory()).newEmbeddedDatabase(storeDir);

            try
            {
                Db.execute("CREATE ()");
            }
            finally
            {
                Db.shutdown();
            }

            // When a rule with an pre-populated graph db directory is used
            File newDir = TestDirectory.directory("new");
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.harness.junit.Neo4jRule ruleWithDirectory = new org.neo4j.harness.junit.Neo4jRule(newDir).copyFrom(oldDir);
            Neo4jRule ruleWithDirectory = (new Neo4jRule(newDir)).copyFrom(oldDir);
            Statement statement         = ruleWithDirectory.apply(new StatementAnonymousInnerClass(this, ruleWithDirectory)
                                                                  , null);

            // Then
            statement.evaluate();
        }
示例#2
0
 public StatementAnonymousInnerClass(JUnitRuleTestIT outerInstance, Neo4jRule ruleWithDirectory)
 {
     this.outerInstance      = outerInstance;
     this._ruleWithDirectory = ruleWithDirectory;
 }
示例#3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public BoltQueryLoggingIT() throws java.io.IOException
        public BoltQueryLoggingIT()
        {
            string tmpDir = createTempDir().AbsolutePath;

            this.Neo4j = (new Neo4jRule()).withConfig(ServerSettings.http_logging_enabled, "true").withConfig(LegacySslPolicyConfig.certificates_directory.name(), tmpDir).withConfig(GraphDatabaseSettings.auth_enabled, "false").withConfig(GraphDatabaseSettings.logs_directory, tmpDir).withConfig(GraphDatabaseSettings.log_queries, "true").withConfig((new BoltConnector("bolt")).type, "BOLT").withConfig((new BoltConnector("bolt")).enabled, "true").withConfig((new BoltConnector("bolt")).address, "localhost:0").withConfig((new BoltConnector("bolt")).encryption_level, "DISABLED").withConfig(OnlineBackupSettings.online_backup_enabled, Settings.FALSE);
        }