private static void AssertDoesNotKnowAboutRelGroups(CommandReader reader) { try { reader.Read(ChannelWithRelGroupRecord()); fail("Exception expected"); } catch (IOException e) { assertEquals("Unknown command type[" + NeoCommandType_Fields.RelGroupCommand + "]", e.Message); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldWriteIndexDefineCommandIfMapWithinShortRange() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldWriteIndexDefineCommandIfMapWithinShortRange() { // GIVEN InMemoryClosableChannel channel = new InMemoryClosableChannel(10_000); IndexDefineCommand command = InitIndexDefineCommand(300); // WHEN command.Serialize(channel); // THEN CommandReader commandReader = (new RecordStorageCommandReaderFactory()).byVersion(LogEntryVersion.CURRENT.byteCode()); IndexDefineCommand read = ( IndexDefineCommand )commandReader.Read(channel); assertEquals(command.IndexNameIdRange, read.IndexNameIdRange); assertEquals(command.KeyIdRange, read.KeyIdRange); }
public RecordStorageCommandReaderFactory() { _readers = new CommandReader[11]; // pessimistic size _readers[-LogEntryVersion.V2_3.byteCode()] = new PhysicalLogCommandReaderV2_2_4(); _readers[-LogEntryVersion.V3_0.byteCode()] = new PhysicalLogCommandReaderV3_0(); _readers[-LogEntryVersion.V2_3_5.byteCode()] = new PhysicalLogCommandReaderV2_2_10(); _readers[-LogEntryVersion.V3_0_2.byteCode()] = new PhysicalLogCommandReaderV3_0_2(); // The 3_0_10 version bump is only to prevent mixed-version clusters; format is otherwise backwards compatible. _readers[-LogEntryVersion.V3_0_10.byteCode()] = new PhysicalLogCommandReaderV3_0_2(); // A little extra safety check so that we got 'em all LogEntryVersion[] versions = LogEntryVersion.values(); foreach (LogEntryVersion version in versions) { CommandReader versionReader = _readers[abs(version.byteCode())]; if (versionReader == null) { throw new System.InvalidOperationException("Version " + version + " not handled"); } } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void assertCanReadRelGroup(org.neo4j.storageengine.api.CommandReader reader) throws java.io.IOException private void AssertCanReadRelGroup(CommandReader reader) { StorageCommand command = reader.Read(ChannelWithRelGroupRecord()); AssertValidRelGroupCommand(command); }