示例#1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private org.neo4j.test.OtherThreadExecutor.WorkerCommand<Void, Void> dropTheIndex(final FlippableIndexProxy flippable)
        private OtherThreadExecutor.WorkerCommand <Void, Void> DropTheIndex(FlippableIndexProxy flippable)
        {
            return(state =>
            {
                flippable.Drop();
                return null;
            });
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldBeAbleToSwitchDelegate() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldBeAbleToSwitchDelegate()
        {
            // GIVEN
            IndexProxy          actual    = mockIndexProxy();
            IndexProxy          other     = mockIndexProxy();
            FlippableIndexProxy @delegate = new FlippableIndexProxy(actual);

            @delegate.FlipTarget = SingleProxy(other);

            // WHEN
            @delegate.Flip(NoOp(), null);
            @delegate.Drop();

            // THEN
            verify(other).drop();
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotBeAbleToFlipAfterDrop() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotBeAbleToFlipAfterDrop()
        {
            //GIVEN
            IndexProxy        actual = mockIndexProxy();
            IndexProxy        failed = mockIndexProxy();
            IndexProxyFactory indexContextFactory = mock(typeof(IndexProxyFactory));

            FlippableIndexProxy @delegate = new FlippableIndexProxy(actual);

            @delegate.FlipTarget = indexContextFactory;

            //WHEN
            @delegate.Drop();

            //THEN
            ExpectedException.expect(typeof(IndexProxyAlreadyClosedKernelException));
            @delegate.Flip(NoOp(), SingleFailedDelegate(failed));
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAbortStoreScanWaitOnDrop() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAbortStoreScanWaitOnDrop()
        {
            // given the proxy structure
            FakePopulatingIndexProxy   @delegate = new FakePopulatingIndexProxy();
            FlippableIndexProxy        flipper   = new FlippableIndexProxy(@delegate);
            OtherThreadExecutor <Void> waiter    = Cleanup.add(new OtherThreadExecutor <Void>("Waiter", null));

            // and a thread stuck in the awaitStoreScanCompletion loop
            Future <object> waiting = waiter.ExecuteDontWait(state => flipper.AwaitStoreScanCompleted(0, MILLISECONDS));

            while ([email protected])
            {
                Thread.Sleep(10);
            }

            // when
            flipper.Drop();

            // then the waiting should quickly be over
            waiting.get(10, SECONDS);
        }