示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAllowOtherHostToCompleteIfFirstHostRollsBackTransaction() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAllowOtherHostToCompleteIfFirstHostRollsBackTransaction()
        {
            // given
            ClusterManager.ManagedCluster cluster = ClusterRule.startCluster();

            HighlyAvailableGraphDatabase slave1 = cluster.AnySlave;
            HighlyAvailableGraphDatabase slave2 = cluster.GetAnySlave(slave1);

            // when
            Future <bool> created;

            using (Transaction tx = slave1.BeginTx())
            {
                slave1.CreateNode(_label).setProperty(PROPERTY_KEY, "value4");

                created = OtherThread.execute(CreateNode(slave2, _label.name(), PROPERTY_KEY, "value4"));

                assertThat(OtherThread, Waiting);

                tx.Failure();
            }

            // then
            assertTrue("creating data that conflicts only with rolled back data should pass", created.get());
        }