Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRebuildMissingCountsStoreAfterRecovery() throws java.io.IOException, org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRebuildMissingCountsStoreAfterRecovery()
        {
            // given
            CreateAliensAndHumans();

            // when
            RotateLog();
            DeleteHumans();
            FileSystemAbstraction fs = Crash();

            DeleteCounts(fs);
            Restart(fs);

            // then
            using ([email protected] tx = (( GraphDatabaseAPI )_db).DependencyResolver.resolveDependency(typeof(Kernel)).beginTransaction(@explicit, AUTH_DISABLED))
            {
                assertEquals(ALIENS, tx.DataRead().countsForNode(-1));
                assertEquals(ALIENS, tx.DataRead().countsForNode(LabelId(_alien)));
                assertEquals(0, tx.DataRead().countsForNode(LabelId(_human)));
            }

            // and also
            LogMatcherBuilder matcherBuilder = inLog(typeof(MetaDataStore));

            _internalLogProvider.assertAtLeastOnce(matcherBuilder.warn("Missing counts store, rebuilding it."));
            _internalLogProvider.assertAtLeastOnce(matcherBuilder.warn("Counts store rebuild completed."));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRecoverTheCountsStoreEvenWhenIfNeoStoreDoesNotNeedRecovery() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRecoverTheCountsStoreEvenWhenIfNeoStoreDoesNotNeedRecovery()
        {
            // given
            CreateNode("A");
            CheckPoint();
            CreateNode("B");
            FlushNeoStoreOnly();

            // when
            CrashAndRestart();

            // then
            using ([email protected] tx = (( GraphDatabaseAPI )_db).DependencyResolver.resolveDependency(typeof(Kernel)).beginTransaction(@explicit, AUTH_DISABLED))
            {
                assertEquals(1, tx.DataRead().countsForNode(tx.TokenRead().nodeLabel("A")));
                assertEquals(1, tx.DataRead().countsForNode(tx.TokenRead().nodeLabel("B")));
                assertEquals(2, tx.DataRead().countsForNode(NO_TOKEN));
            }
        }