コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void updateForHigherNodeIgnoredWhenUsingFullNodeStoreScan() throws org.neo4j.kernel.api.exceptions.index.IndexPopulationFailedKernelException, java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UpdateForHigherNodeIgnoredWhenUsingFullNodeStoreScan()
        {
            NeoStores neoStores = Mockito.mock(typeof(NeoStores));
            NodeStore nodeStore = mock(typeof(NodeStore));

            when(neoStores.NodeStore).thenReturn(nodeStore);

            ProcessListenableNeoStoreIndexView storeView      = new ProcessListenableNeoStoreIndexView(this, LockService.NO_LOCK_SERVICE, neoStores);
            MultipleIndexPopulator             indexPopulator = new MultipleIndexPopulator(storeView, _logProvider, EntityType.NODE, mock(typeof(SchemaState)));

            storeView.ProcessListener = new NodeUpdateProcessListener(indexPopulator);

            IndexPopulator populator    = CreateIndexPopulator();
            IndexUpdater   indexUpdater = mock(typeof(IndexUpdater));

            AddPopulator(indexPopulator, populator, 1, TestIndexDescriptorFactory.forLabel(1, 1));

            indexPopulator.Create();
            StoreScan <IndexPopulationFailedKernelException> storeScan = indexPopulator.IndexAllEntities();

            storeScan.Run();

            Mockito.verify(indexUpdater, never()).process(any(typeof(IndexEntryUpdate)));
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustFlipToFailedIfFailureToApplyLastBatchWhileFlipping() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustFlipToFailedIfFailureToApplyLastBatchWhileFlipping()
        {
            // given
            NullLogProvider logProvider = NullLogProvider.Instance;
            IndexStoreView  storeView   = EmptyIndexStoreViewThatProcessUpdates();

            Org.Neo4j.Kernel.Api.Index.IndexPopulator_Adapter populator = EmptyPopulatorWithThrowingUpdater();
            FailedIndexProxy    failedProxy = FailedIndexProxy(storeView, populator);
            OnlineIndexProxy    onlineProxy = OnlineIndexProxy(storeView);
            FlippableIndexProxy flipper     = new FlippableIndexProxy();

            flipper.FlipTarget = () => onlineProxy;
            MultipleIndexPopulator multipleIndexPopulator = new MultipleIndexPopulator(storeView, logProvider, EntityType.NODE, mock(typeof(SchemaState)));

            MultipleIndexPopulator.IndexPopulation indexPopulation = multipleIndexPopulator.AddPopulator(populator, DummyMeta(), flipper, t => failedProxy, "userDescription");
            multipleIndexPopulator.QueueUpdate(SomeUpdate());
            multipleIndexPopulator.IndexAllEntities().run();

            // when
            indexPopulation.Flip(false);

            // then
            assertSame("flipper should have flipped to failing proxy", flipper.State, InternalIndexState.FAILED);
        }