Search in sources :

Example 26 with NodeUpdates

use of org.neo4j.kernel.api.index.NodeUpdates in project neo4j by neo4j.

the class PropertyPhysicalToLogicalConverterTest method shouldConvertInlinedRemovedProperty.

@Test
public void shouldConvertInlinedRemovedProperty() throws Exception {
    // GIVEN
    int key = 10;
    int value = 12341;
    PropertyRecord before = propertyRecord(property(key, value));
    PropertyRecord after = propertyRecord();
    // WHEN
    NodeUpdates update = convert(none, none, change(before, after));
    // THEN
    NodeUpdates expected = NodeUpdates.forNode(0).removed(key, value).build();
    assertEquals(expected, update);
}
Also used : NodeUpdates(org.neo4j.kernel.api.index.NodeUpdates) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) Test(org.junit.Test)

Example 27 with NodeUpdates

use of org.neo4j.kernel.api.index.NodeUpdates in project neo4j by neo4j.

the class PropertyPhysicalToLogicalConverterTest method shouldConvertDynamicInlinedRemovedProperty.

@Test
public void shouldConvertDynamicInlinedRemovedProperty() throws Exception {
    // GIVEN
    int key = 10;
    PropertyRecord before = propertyRecord(property(key, longString));
    PropertyRecord after = propertyRecord();
    // WHEN
    NodeUpdates update = convert(none, none, change(before, after));
    // THEN
    NodeUpdates expected = NodeUpdates.forNode(0).removed(key, longString).build();
    assertEquals(expected, update);
}
Also used : NodeUpdates(org.neo4j.kernel.api.index.NodeUpdates) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) Test(org.junit.Test)

Example 28 with NodeUpdates

use of org.neo4j.kernel.api.index.NodeUpdates in project neo4j by neo4j.

the class PropertyPhysicalToLogicalConverterTest method shouldNotConvertInlinedAddedProperty.

@Test
public void shouldNotConvertInlinedAddedProperty() throws Exception {
    // GIVEN
    long key = 10;
    int value = 12345;
    PropertyRecord before = propertyRecord();
    PropertyRecord after = propertyRecord(property(key, value));
    // WHEN
    NodeUpdates updates = convert(none, none, change(before, after));
    // THEN
    assertFalse(updates.hasIndexingAppropriateUpdates());
}
Also used : NodeUpdates(org.neo4j.kernel.api.index.NodeUpdates) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) Test(org.junit.Test)

Aggregations

NodeUpdates (org.neo4j.kernel.api.index.NodeUpdates)28 Test (org.junit.Test)25 NeoStores (org.neo4j.kernel.impl.store.NeoStores)9 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)8 DefinedProperty (org.neo4j.kernel.api.properties.DefinedProperty)5 NeoStoreIndexStoreView (org.neo4j.kernel.impl.transaction.state.storeview.NeoStoreIndexStoreView)5 ArrayList (java.util.ArrayList)4 IndexPopulator (org.neo4j.kernel.api.index.IndexPopulator)4 Transaction (org.neo4j.graphdb.Transaction)3 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)3 Collection (java.util.Collection)2 Visitor (org.neo4j.helpers.collection.Visitor)2 KernelException (org.neo4j.kernel.api.exceptions.KernelException)2 NodeLabelUpdate (org.neo4j.kernel.api.labelscan.NodeLabelUpdate)2 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)2 IndexReader (org.neo4j.storageengine.api.schema.IndexReader)2 File (java.io.File)1 IOException (java.io.IOException)1 PrintStream (java.io.PrintStream)1 Boolean.parseBoolean (java.lang.Boolean.parseBoolean)1