Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteAndCommitShouldBePublishedToOtherTransaction2() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void DeleteAndCommitShouldBePublishedToOtherTransaction2()
        {
            WorkThread firstTx  = CreateWorker("First");
            WorkThread secondTx = CreateWorker("Second");

            firstTx.BeginTransaction();
            secondTx.BeginTransaction();

            firstTx.CreateNodeAndIndexBy(_key, "some value");
            secondTx.CreateNodeAndIndexBy(_key, "some other value");

            firstTx.DeleteIndex();
            firstTx.Commit();

            try
            {
                secondTx.QueryIndex(_key, "some other value");
                fail("Should throw exception");
            }
            catch (ExecutionException e)
            {
                assertThat(e.InnerException, instanceOf(typeof(NotFoundException)));
                assertThat(e.InnerException.Message.ToLower(), containsString("index 'index' doesn't exist"));
            }

            secondTx.Rollback();

            // Since $Before will start a tx, add a value and keep tx open and
            // workers will delete the index so this test will fail in @After
            // if we don't rollback this tx
            RollbackTx();
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteInOneTxShouldNotAffectTheOther() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void DeleteInOneTxShouldNotAffectTheOther()
        {
            _index.delete();

            WorkThread firstTx = CreateWorker("Single");

            firstTx.BeginTransaction();
            firstTx.CreateNodeAndIndexBy(_key, "another value");
            firstTx.Commit();
        }