use of org.neo4j.kernel.impl.store.DynamicArrayStore in project neo4j by neo4j.
the class MockedNeoStores method basicMockedNeoStores.
@SuppressWarnings({ "unchecked", "rawtypes" })
public static NeoStores basicMockedNeoStores() {
NeoStores neoStores = mock(NeoStores.class);
// Cursor, absolutely mocked and cannot be used at all as it is
RecordCursor cursor = mockedRecordCursor();
// NodeStore - DynamicLabelStore
NodeStore nodeStore = mock(NodeStore.class);
when(nodeStore.newRecordCursor(any())).thenReturn(cursor);
when(neoStores.getNodeStore()).thenReturn(nodeStore);
// NodeStore - DynamicLabelStore
DynamicArrayStore dynamicLabelStore = mock(DynamicArrayStore.class);
when(dynamicLabelStore.newRecordCursor(any())).thenReturn(cursor);
when(nodeStore.getDynamicLabelStore()).thenReturn(dynamicLabelStore);
// RelationshipStore
RelationshipStore relationshipStore = mock(RelationshipStore.class);
when(relationshipStore.newRecordCursor(any())).thenReturn(cursor);
when(neoStores.getRelationshipStore()).thenReturn(relationshipStore);
// RelationshipGroupStore
RelationshipGroupStore relationshipGroupStore = mock(RelationshipGroupStore.class);
when(relationshipGroupStore.newRecordCursor(any())).thenReturn(cursor);
when(neoStores.getRelationshipGroupStore()).thenReturn(relationshipGroupStore);
// PropertyStore
PropertyStore propertyStore = mock(PropertyStore.class);
when(propertyStore.newRecordCursor(any())).thenReturn(cursor);
when(neoStores.getPropertyStore()).thenReturn(propertyStore);
// PropertyStore -- DynamicStringStore
DynamicStringStore propertyStringStore = mock(DynamicStringStore.class);
when(propertyStringStore.newRecordCursor(any())).thenReturn(cursor);
when(propertyStore.getStringStore()).thenReturn(propertyStringStore);
// PropertyStore -- DynamicArrayStore
DynamicArrayStore propertyArrayStore = mock(DynamicArrayStore.class);
when(propertyArrayStore.newRecordCursor(any())).thenReturn(cursor);
when(propertyStore.getArrayStore()).thenReturn(propertyArrayStore);
return neoStores;
}
use of org.neo4j.kernel.impl.store.DynamicArrayStore in project neo4j by neo4j.
the class StorePropertyCursorTest method newStorePropertyCursor.
private static StorePropertyCursor newStorePropertyCursor(PropertyStore propertyStore, Consumer<StorePropertyCursor> cache) {
RecordCursor<PropertyRecord> propertyRecordCursor = propertyStore.newRecordCursor(propertyStore.newRecord());
propertyRecordCursor.acquire(0, NORMAL);
DynamicStringStore stringStore = propertyStore.getStringStore();
RecordCursor<DynamicRecord> dynamicStringCursor = stringStore.newRecordCursor(stringStore.nextRecord());
dynamicStringCursor.acquire(0, NORMAL);
DynamicArrayStore arrayStore = propertyStore.getArrayStore();
RecordCursor<DynamicRecord> dynamicArrayCursor = arrayStore.newRecordCursor(arrayStore.nextRecord());
dynamicArrayCursor.acquire(0, NORMAL);
RecordCursors cursors = mock(RecordCursors.class);
when(cursors.property()).thenReturn(propertyRecordCursor);
when(cursors.propertyString()).thenReturn(dynamicStringCursor);
when(cursors.propertyArray()).thenReturn(dynamicArrayCursor);
return new StorePropertyCursor(cursors, cache);
}
use of org.neo4j.kernel.impl.store.DynamicArrayStore in project neo4j by neo4j.
the class StorePropertyPayloadCursorTest method newCursor.
private static StorePropertyPayloadCursor newCursor(Object... values) {
DynamicStringStore dynamicStringStore = mock(DynamicStringStore.class);
DynamicArrayStore dynamicArrayStore = mock(DynamicArrayStore.class);
return newCursor(dynamicStringStore, dynamicArrayStore, values);
}
use of org.neo4j.kernel.impl.store.DynamicArrayStore in project neo4j by neo4j.
the class StoreIteratorRelationshipCursorTest method newRecordCursorsWithMockedNeoStores.
private static RecordCursors newRecordCursorsWithMockedNeoStores(RelationshipStore relationshipStore) {
NeoStores neoStores = mock(NeoStores.class);
NodeStore nodeStore = newStoreMockWithRecordCursor(NodeStore.class);
RelationshipGroupStore relGroupStore = newStoreMockWithRecordCursor(RelationshipGroupStore.class);
PropertyStore propertyStore = newStoreMockWithRecordCursor(PropertyStore.class);
DynamicStringStore dynamicStringStore = newStoreMockWithRecordCursor(DynamicStringStore.class);
DynamicArrayStore dynamicArrayStore = newStoreMockWithRecordCursor(DynamicArrayStore.class);
DynamicArrayStore dynamicLabelStore = newStoreMockWithRecordCursor(DynamicArrayStore.class);
when(neoStores.getNodeStore()).thenReturn(nodeStore);
when(neoStores.getRelationshipStore()).thenReturn(relationshipStore);
when(neoStores.getRelationshipGroupStore()).thenReturn(relGroupStore);
when(neoStores.getPropertyStore()).thenReturn(propertyStore);
when(propertyStore.getStringStore()).thenReturn(dynamicStringStore);
when(propertyStore.getArrayStore()).thenReturn(dynamicArrayStore);
when(nodeStore.getDynamicLabelStore()).thenReturn(dynamicLabelStore);
return new RecordCursors(neoStores);
}
use of org.neo4j.kernel.impl.store.DynamicArrayStore in project neo4j by neo4j.
the class TransactionRecordStateTest method assertDynamicLabelRecordInUse.
private void assertDynamicLabelRecordInUse(NeoStores store, long id, boolean inUse) {
DynamicArrayStore dynamicLabelStore = store.getNodeStore().getDynamicLabelStore();
DynamicRecord record = dynamicLabelStore.getRecord(id, dynamicLabelStore.nextRecord(), FORCE);
assertTrue(inUse == record.inUse());
}
Aggregations