Exemplo n.º 1
0
        private CrashGenerationCleaner NewCrashingCrashGenerationCleaner(string message)
        {
            int       pageSize  = 8192;
            PagedFile pagedFile = new StubPagedFileAnonymousInnerClass(this, pageSize, message);

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: return new CrashGenerationCleaner(pagedFile, new TreeNodeFixedSize<>(pageSize, SimpleLongLayout.longLayout().build()), 0, MAX_BATCH_SIZE * 1_000_000_000, 5, 7, NO_MONITOR);
            return(new CrashGenerationCleaner(pagedFile, new TreeNodeFixedSize <object, ?>(pageSize, SimpleLongLayout.LongLayout().build()), 0, MAX_BATCH_SIZE * 1_000_000_000, 5, 7, NO_MONITOR));
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustCheckForOutOfBoundsWhenReadingDoubleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustCheckForOutOfBoundsWhenReadingDoubleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 4);

            cursor.PutByte(0, ( sbyte )(HEADER_BIT_RECORD_UNIT + HEADER_BIT_FIRST_RECORD_UNIT));
            StubPagedFile pagedFile = new StubPagedFileAnonymousInnerClass(this, cursor);

            format.ShortsPerRecordConflict.AddLast(2);
            format.Read(new MyRecord(this, 0), cursor, RecordLoad.NORMAL, 4);
            assertTrue(cursor.CheckAndClearBoundsFlag());
        }