use of org.neo4j.kernel.impl.store.record.NeoStoreRecord in project neo4j by neo4j.
the class NeoStoreTransactionApplierTest method shouldApplyNeoStoreCommandToTheStoreInRecovery.
@Test
public void shouldApplyNeoStoreCommandToTheStoreInRecovery() throws Exception {
// given
final BatchTransactionApplier applier = newApplier(true);
final NeoStoreRecord before = new NeoStoreRecord();
final NeoStoreRecord after = new NeoStoreRecord();
after.setNextProp(42);
final Command command = new Command.NeoStoreCommand(before, after);
// when
boolean result = apply(applier, command::handle, transactionToApply);
// then
assertFalse(result);
verify(metaDataStore, times(1)).setGraphNextProp(after.getNextProp());
}
use of org.neo4j.kernel.impl.store.record.NeoStoreRecord in project neo4j by neo4j.
the class LogCommandSerializationV3_0_10 method readNeoStoreCommand.
@Override
protected Command readNeoStoreCommand(ReadableChannel channel) throws IOException {
NeoStoreRecord before = readNeoStoreRecord(channel);
NeoStoreRecord after = readNeoStoreRecord(channel);
return new Command.NeoStoreCommand(this, before, after);
}
use of org.neo4j.kernel.impl.store.record.NeoStoreRecord in project neo4j by neo4j.
the class LogCommandSerializationV3_0_10Test method shouldReadNeoStoreCommand.
@Test
void shouldReadNeoStoreCommand() throws Throwable {
// Given
InMemoryClosableChannel channel = new InMemoryClosableChannel();
NeoStoreRecord before = new NeoStoreRecord();
NeoStoreRecord after = new NeoStoreRecord();
after.setNextProp(42);
new Command.NeoStoreCommand(new LogCommandSerializationV3_0_10(), before, after).serialize(channel);
// When
Command command = INSTANCE.read(channel);
assertTrue(command instanceof Command.NeoStoreCommand);
Command.NeoStoreCommand neoStoreCommand = (Command.NeoStoreCommand) command;
// Then
assertEquals(before.getNextProp(), neoStoreCommand.getBefore().getNextProp());
assertEquals(after.getNextProp(), neoStoreCommand.getAfter().getNextProp());
}
use of org.neo4j.kernel.impl.store.record.NeoStoreRecord in project neo4j by neo4j.
the class MessageConsistencyLoggerTest method shouldFormatErrorForRecord.
@Test
void shouldFormatErrorForRecord() {
// when
logger.error(RecordType.NEO_STORE, new NeoStoreRecord(), "sample message", 1, 2);
// then
logMatcher.forLevel(ERROR).containsMessages(join("sample message", neoStoreRecord(true, -1), "Inconsistent with: 1 2"));
}
use of org.neo4j.kernel.impl.store.record.NeoStoreRecord in project neo4j by neo4j.
the class MessageConsistencyLoggerTest method shouldFormatLogForChangedRecord.
@Test
void shouldFormatLogForChangedRecord() {
// when
logger.error(RecordType.NEO_STORE, new NeoStoreRecord(), new NeoStoreRecord(), "sample message", 1, 2);
// then
logMatcher.forLevel(ERROR).containsMessages(join("sample message", "- " + neoStoreRecord(true, -1), "+ " + neoStoreRecord(true, -1), "Inconsistent with: 1 2"));
}
Aggregations