Search in sources :

Example 6 with PropertyType

use of org.neo4j.kernel.impl.store.PropertyType in project neo4j by neo4j.

the class DynamicRecordCheckTest method shouldReportCorrectTypeBasedOnProperBitsOnly.

@Test
public void shouldReportCorrectTypeBasedOnProperBitsOnly() throws Exception {
    // given
    DynamicRecord property = inUse(record(42));
    // Type is 9, which is string, but has an extra bit set at a higher up position
    int type = PropertyType.STRING.intValue();
    type = type | 0b10000000;
    property.setType(type);
    // when
    PropertyType reportedType = property.getType();
    // then
    // The type must be string
    assertEquals(PropertyType.STRING, reportedType);
    // but the type data must be preserved
    assertEquals(type, property.getTypeAsInt());
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) PropertyType(org.neo4j.kernel.impl.store.PropertyType) Test(org.junit.Test)

Aggregations

PropertyType (org.neo4j.kernel.impl.store.PropertyType)6 Test (org.junit.Test)1 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)1 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)1