//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private <R extends org.neo4j.kernel.impl.store.record.AbstractBaseRecord> void verifyWriteAndRead(System.Func<RecordFormat<R>> formatSupplier, System.Func<org.neo4j.kernel.impl.store.format.RecordGenerators_Generator<R>> generatorSupplier, System.Func<RecordKey<R>> keySupplier, boolean assertPostReadOffset) throws java.io.IOException private void VerifyWriteAndRead <R>(System.Func <RecordFormat <R> > formatSupplier, System.Func <RecordGenerators_Generator <R> > generatorSupplier, System.Func <RecordKey <R> > keySupplier, bool assertPostReadOffset) where R : Org.Neo4j.Kernel.impl.store.record.AbstractBaseRecord { // GIVEN using (PagedFile storeFile = _pageCache.map(new File("store-" + Name.MethodName), _pageSize, CREATE)) { RecordFormat <R> format = formatSupplier(); RecordKey <R> key = keySupplier(); RecordGenerators_Generator <R> generator = generatorSupplier(); int recordSize = format.GetRecordSize(new IntStoreHeader(DATA_SIZE)); BatchingIdSequence idSequence = new BatchingIdSequence(_random.nextBoolean() ? IdSureToBeOnTheNextPage(_pageSize, recordSize) : 10); // WHEN long time = currentTimeMillis(); long endTime = time + TEST_TIME; long i = 0; for ( ; i < TEST_ITERATIONS && currentTimeMillis() < endTime; i++) { R written = generator.Get(recordSize, format, i % 5); R read = format.NewRecord(); try { WriteRecord(written, format, storeFile, recordSize, idSequence); ReadAndVerifyRecord(written, read, format, key, storeFile, recordSize, assertPostReadOffset); idSequence.Reset(); } catch (Exception t) { Exceptions.setMessage(t, t.Message + " : written:" + written + ", read:" + read + ", seed:" + _random.seed() + ", iteration:" + i); throw t; } } } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHandleRelationshipTypesBeyond2Bytes() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldHandleRelationshipTypesBeyond2Bytes() { // given RecordFormat <RelationshipTypeTokenRecord> format = HighLimit.RecordFormats.relationshipTypeToken(); int typeId = 1 << ((sizeof(short) * 8) + (sizeof(sbyte) * 8)) - 1; RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord(typeId); int recordSize = format.GetRecordSize(NO_STORE_HEADER); record.Initialize(true, 10); IdSequence doubleUnits = mock(typeof(IdSequence)); PageCursor cursor = new StubPageCursor(0, ( int )kibiBytes(8)); // when format.Prepare(record, recordSize, doubleUnits); format.Write(record, cursor, recordSize); verifyNoMoreInteractions(doubleUnits); // then RelationshipTypeTokenRecord read = new RelationshipTypeTokenRecord(typeId); format.Read(record, cursor, NORMAL, recordSize); assertEquals(record, read); }