Beispiel #1
0
 public DirectStoreAccess(StoreAccess nativeStores, LabelScanStore labelScanStore, IndexProviderMap indexes, TokenHolders tokenHolders)
 {
     this._nativeStores   = nativeStores;
     this._labelScanStore = labelScanStore;
     this._indexes        = indexes;
     this._tokenHolders   = tokenHolders;
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void scanForHighIdOnlyOnceWhenProcessCache()
        internal virtual void ScanForHighIdOnlyOnceWhenProcessCache()
        {
            NeoStores      neoStores      = mock(typeof(NeoStores), Mockito.RETURNS_MOCKS);
            NodeStore      nodeStore      = mock(typeof(NodeStore));
            NodeRecord     nodeRecord     = mock(typeof(NodeRecord));
            StoreProcessor storeProcessor = mock(typeof(StoreProcessor));

            when(neoStores.NodeStore).thenReturn(nodeStore);
            when(nodeStore.HighId).thenReturn(10L);
            when(nodeStore.GetRecord(anyLong(), any(typeof(NodeRecord)), any(typeof(RecordLoad)))).thenReturn(nodeRecord);
            when(nodeStore.NewRecord()).thenReturn(nodeRecord);

            StoreAccess storeAccess = new StoreAccess(neoStores);

            storeAccess.Initialize();

            DefaultCacheAccess cacheAccess = new DefaultCacheAccess(Counts.NONE, 1);

            CacheTask.CheckNextRel cacheTask = new CacheTask.CheckNextRel(Org.Neo4j.Consistency.checking.full.Stage_Fields.SequentialForward, cacheAccess, storeAccess, storeProcessor);

            cacheAccess.CacheSlotSizes = CheckStage.Stage5_Check_NextRel.CacheSlotSizes;
            cacheTask.ProcessCache();

            verify(nodeStore, times(1)).HighId;
        }