Example #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> startFlipAndWaitForLatchBeforeFinishing(final FlippableIndexProxy flippable, final java.util.concurrent.CountDownLatch triggerFinishFlip, final java.util.concurrent.CountDownLatch triggerExternalAccess)
        private OtherThreadExecutor.WorkerCommand <Void, Void> StartFlipAndWaitForLatchBeforeFinishing(FlippableIndexProxy flippable, System.Threading.CountdownEvent triggerFinishFlip, System.Threading.CountdownEvent triggerExternalAccess)
        {
            return(state =>
            {
                flippable.Flip(() =>
                {
                    triggerExternalAccess.Signal();
                    assertTrue(awaitLatch(triggerFinishFlip));
                    return true;
                }, null);
                return null;
            });
        }
Example #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();
        }
Example #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));
        }