Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void uniqueIndexWithoutOwningConstraintIsIgnoredDuringCheck() throws ConsistencyCheckTool.ToolFailureException, java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UniqueIndexWithoutOwningConstraintIsIgnoredDuringCheck()
        {
            File   databaseDir = TestDirectory.databaseDir();
            Label  marker      = Label.label("MARKER");
            string property    = "property";

            GraphDatabaseService database = (new EnterpriseGraphDatabaseFactory()).newEmbeddedDatabase(databaseDir);

            try
            {
                CreateNodes(marker, property, database);
                AddIndex(database);
                WaitForIndexPopulationFailure(database);
            }
            catch (SchemaKernelException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
            }
            finally
            {
                database.Shutdown();
            }

            ConsistencyCheckService.Result checkResult = ConsistencyCheckTool.RunConsistencyCheckTool(new string[] { databaseDir.AbsolutePath }, EmptyPrintStream(), EmptyPrintStream());
            assertTrue(string.join(Environment.NewLine, Files.readAllLines(checkResult.ReportFile().toPath())), checkResult.Successful);
        }
Exemple #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static ConsistencyCheckService.Result runConsistencyCheckTool(String[] args, java.io.PrintStream outStream, java.io.PrintStream errStream) throws ToolFailureException
        public static ConsistencyCheckService.Result RunConsistencyCheckTool(string[] args, PrintStream outStream, PrintStream errStream)
        {
            FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction();

            try
            {
                ConsistencyCheckTool tool = new ConsistencyCheckTool(new ConsistencyCheckService(), fileSystem, outStream, errStream);
                return(tool.Run(args));
            }
            finally
            {
                try
                {
                    fileSystem.Dispose();
                }
                catch (IOException)
                {
                    Console.Error.Write("Failure during file system shutdown.");
                }
            }
        }