コード例 #1
0
 private void VerifySectionReportedCorrectly(AssertableLogProvider logProvider)
 {
     logProvider.FormattedMessageMatcher().assertContains(VisibleMigrationProgressMonitor.MESSAGE_STARTED);
     for (int i = 10; i <= 100; i += 10)
     {
         logProvider.FormattedMessageMatcher().assertContains(i + "%");
     }
     logProvider.AssertNone(AssertableLogProvider.inLog(typeof(VisibleMigrationProgressMonitor)).info(containsString("110%")));
     logProvider.FormattedMessageMatcher().assertContains(VisibleMigrationProgressMonitor.MESSAGE_COMPLETED);
 }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void tracePageCacheFlushProgress()
        public virtual void TracePageCacheFlushProgress()
        {
            AssertableLogProvider logProvider = new AssertableLogProvider(true);
            GraphDatabaseService  database    = (new TestGraphDatabaseFactory()).setInternalLogProvider(logProvider).newEmbeddedDatabaseBuilder(TestDirectory.directory()).setConfig(GraphDatabaseSettings.tracer, "verbose").newGraphDatabase();

            using (Transaction transaction = database.BeginTx())
            {
                database.CreateNode();
                transaction.Success();
            }
            database.Shutdown();
            logProvider.FormattedMessageMatcher().assertContains("Flushing file");
            logProvider.FormattedMessageMatcher().assertContains("Page cache flush completed. Flushed ");
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void startStopDatabaseWithIndex()
        public virtual void StartStopDatabaseWithIndex()
        {
            Label  label    = Label.label("string");
            string property = "property";
            AssertableLogProvider logProvider = new AssertableLogProvider(true);
            GraphDatabaseService  db          = PrepareDb(label, property, logProvider);

            Db.shutdown();
            db = GetDatabase(logProvider);
            Db.shutdown();

            logProvider.FormattedMessageMatcher().assertNotContains("Failed to open index");
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIncludeDurationInCompletionMessage()
        public virtual void ShouldIncludeDurationInCompletionMessage()
        {
            // given
            AssertableLogProvider logProvider = new AssertableLogProvider();
            Log       log   = logProvider.getLog(this.GetType());
            FakeClock clock = new FakeClock();
            VisibleMigrationProgressMonitor monitor = new VisibleMigrationProgressMonitor(log, clock);

            // when
            monitor.Started(1);
            clock.Forward(1500, TimeUnit.MILLISECONDS);
            monitor.Completed();

            // then
            logProvider.FormattedMessageMatcher().assertContains("took 1s 500ms");
        }