예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void markDirtyVersionLookupOnKeyReset() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MarkDirtyVersionLookupOnKeyReset()
        {
            long updaterVersionTxId = 25;
            long lastClosedTxId     = 20;

            when(_store.version()).thenReturn(updaterVersionTxId);
            TransactionVersionContextSupplier versionContextSupplier = new TransactionVersionContextSupplier();

            versionContextSupplier.Init(() => lastClosedTxId);
            VersionContext versionContext = versionContextSupplier.VersionContext;

            ConcurrentMapState <string> mapState = CreateMapState(versionContextSupplier);

            versionContext.InitRead();
            mapState.ResettingUpdater(@lock, Runnables.EMPTY_RUNNABLE).apply("a", new SimpleValueUpdate(1));
            mapState.Lookup("a", new EmptyValueSink());
            assertTrue(versionContext.Dirty);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void doNotMarkVersionAsDirtyOnAnotherKeyUpdate() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void DoNotMarkVersionAsDirtyOnAnotherKeyUpdate()
        {
            long updaterVersionTxId = 25;
            long lastClosedTxId     = 20;
            TransactionVersionContextSupplier versionContextSupplier = new TransactionVersionContextSupplier();

            versionContextSupplier.Init(() => lastClosedTxId);
            ConcurrentMapState <string> mapState = CreateMapState(versionContextSupplier);
            VersionContext versionContext        = versionContextSupplier.VersionContext;

            using (EntryUpdater <string> updater = mapState.Updater(updaterVersionTxId, @lock))
            {
                updater.Apply("b", new SimpleValueUpdate(2));
            }

            assertEquals(updaterVersionTxId, mapState.Version());
            versionContext.InitRead();
            mapState.Lookup("a", new EmptyValueSink());
            assertFalse(versionContext.Dirty);
        }