use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyPhysicalToLogicalConverterTest method shouldConvertDynamicInlinedRemovedProperty.
@Test
void shouldConvertDynamicInlinedRemovedProperty() {
// GIVEN
int key = 10;
PropertyRecord before = propertyRecord(property(key, longString));
PropertyRecord after = propertyRecord();
// WHEN
EntityUpdates update = convert(none, none, change(before, after));
// THEN
EntityUpdates expected = EntityUpdates.forEntity(0, false).removed(key, longString).build();
assertEquals(expected, update);
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyPhysicalToLogicalConverterTest method shouldIgnoreInlinedUnchangedProperty.
@Test
void shouldIgnoreInlinedUnchangedProperty() {
// GIVEN
int key = 10;
Value value = Values.of(12341);
PropertyRecord before = propertyRecord(property(key, value));
PropertyRecord after = propertyRecord(property(key, value));
// WHEN
assertThat(convert(none, none, change(before, after))).isEqualTo(EntityUpdates.forEntity(0, false).build());
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyPhysicalToLogicalConverterTest method propertyRecord.
private static PropertyRecord propertyRecord(PropertyBlock... propertyBlocks) {
PropertyRecord record = new PropertyRecord(0);
if (propertyBlocks != null) {
record.setInUse(true);
for (PropertyBlock propertyBlock : propertyBlocks) {
record.addPropertyBlock(propertyBlock);
}
}
record.setNodeId(0);
return record;
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyPhysicalToLogicalConverterTest method shouldConvertDynamicAddedProperty.
@Test
void shouldConvertDynamicAddedProperty() {
// GIVEN
int key = 10;
PropertyRecord before = propertyRecord();
PropertyRecord after = propertyRecord(property(key, longString));
// THEN
assertThat(convert(none, none, change(before, after))).isEqualTo(EntityUpdates.forEntity(0, false).added(key, longString).build());
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class LogCommandSerializationV4_0Test method readPropertyCommandWithSecondaryUnit.
@Test
void readPropertyCommandWithSecondaryUnit() throws IOException {
InMemoryClosableChannel channel = new InMemoryClosableChannel();
PropertyRecord before = new PropertyRecord(1);
PropertyRecord after = new PropertyRecord(1);
after.setSecondaryUnitIdOnCreate(78);
new Command.PropertyCommand(writer(), before, after).serialize(channel);
CommandReader reader = createReader();
StorageCommand command = reader.read(channel);
assertTrue(command instanceof Command.PropertyCommand);
Command.PropertyCommand propertyCommand = (Command.PropertyCommand) command;
// Then
assertBeforeAndAfterEquals(propertyCommand, before, after);
}
Aggregations