Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotAllowTokenCreationFromAFollowerWithNoInitialTokens() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotAllowTokenCreationFromAFollowerWithNoInitialTokens()
        {
            // given
            CoreClusterMember leader = _cluster.coreTx((db, tx) =>
            {
                Db.createNode();
                tx.success();
            });

            AwaitForDataToBeApplied(leader);
            dataMatchesEventually(leader, _cluster.coreMembers());

            CoreGraphDatabase follower = _cluster.getMemberWithRole(Role.FOLLOWER).database();

            // when
            try
            {
                using (Transaction tx = follower.BeginTx())
                {
                    follower.AllNodes.GetEnumerator().next().setProperty("name", "Mark");
                    tx.Success();
                    fail("Should have thrown exception");
                }
            }
            catch (WriteOperationsNotAllowedException ex)
            {
                assertThat(ex.Message, containsString("No write operations are allowed"));
            }
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotAllowSchemaChangesFromAFollower() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotAllowSchemaChangesFromAFollower()
        {
            // given
            _cluster.awaitLeader();

            CoreGraphDatabase follower = _cluster.getMemberWithRole(Role.FOLLOWER).database();

            // when
            try
            {
                using (Transaction tx = follower.BeginTx())
                {
                    follower.Schema().constraintFor(Label.label("Foo")).assertPropertyIsUnique("name").create();
                    tx.Success();
                    fail("Should have thrown exception");
                }
            }
            catch (WriteOperationsNotAllowedException ex)
            {
                // expected
                assertThat(ex.Message, containsString("No write operations are allowed"));
            }
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotAllowWritesFromAFollower() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotAllowWritesFromAFollower()
        {
            // given
            _cluster.awaitLeader();

            CoreGraphDatabase follower = _cluster.getMemberWithRole(Role.FOLLOWER).database();

            // when
            try
            {
                using (Transaction tx = follower.BeginTx())
                {
                    follower.CreateNode();
                    tx.Success();
                    fail("Should have thrown exception");
                }
            }
            catch (WriteOperationsNotAllowedException ex)
            {
                // expected
                assertThat(ex.Message, containsString("No write operations are allowed"));
            }
        }