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 fulltextIndexContentsMustBeReplicatedWhenPopulaing() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void FulltextIndexContentsMustBeReplicatedWhenPopulaing()
        {
            _cluster.coreTx((db, tx) =>
            {
                Node node1 = Db.createNode(_label);
                node1.setProperty(PROP, "This is an integration test.");
                node1.setProperty(EC_PROP, true);
                Node node2 = Db.createNode(_label);
                node2.setProperty(PROP2, "This is a related integration test.");
                node2.setProperty(EC_PROP, true);
                Relationship rel = node1.createRelationshipTo(node2, _rel);
                rel.setProperty(PROP, "They relate");
                rel.setProperty(EC_PROP, true);
                _nodeId1 = node1.Id;
                _nodeId2 = node2.Id;
                _relId1  = rel.Id;
                tx.success();
            });
            _cluster.coreTx((db, tx) =>
            {
                Db.execute(format(NODE_CREATE, NODE_INDEX, array(_label.name()), array(PROP, PROP2))).close();
                Db.execute(format(RELATIONSHIP_CREATE, REL_INDEX, array(_rel.name()), array(PROP))).close();
                Db.execute(format(NODE_CREATE, NODE_INDEX_EC, array(_label.name()), array(PROP, PROP2, EC_PROP) + _eventuallyConsistentSetting)).close();
                Db.execute(format(RELATIONSHIP_CREATE, REL_INDEX_EC, array(_rel.name()), array(PROP, EC_PROP) + _eventuallyConsistentSetting)).close();
                tx.success();
            });

            AwaitCatchup();

            VerifyIndexContents(NODE_INDEX, "integration", true, _nodeId1, _nodeId2);
            VerifyIndexContents(NODE_INDEX_EC, "integration", true, _nodeId1, _nodeId2);
            VerifyIndexContents(NODE_INDEX, "test", true, _nodeId1, _nodeId2);
            VerifyIndexContents(NODE_INDEX_EC, "test", true, _nodeId1, _nodeId2);
            VerifyIndexContents(NODE_INDEX, "related", true, _nodeId2);
            VerifyIndexContents(NODE_INDEX_EC, "related", true, _nodeId2);
            VerifyIndexContents(REL_INDEX, "relate", false, _relId1);
            VerifyIndexContents(REL_INDEX_EC, "relate", false, _relId1);
        }
Ejemplo n.º 2
0
        // TODO test that creation and dropping of fulltext indexes is applied through incremental backup.
        // TODO test that custom analyzer configurations are applied through incremental backup.
        // TODO test that the eventually_consistent setting is transferred through incremental backup.

        private void InitializeTestData()
        {
            using (Transaction tx = _db.beginTx())
            {
                Node node1 = _db.createNode(_label);
                node1.SetProperty(PROP, "This is an integration test.");
                Node node2 = _db.createNode(_label);
                node2.SetProperty(PROP, "This is a related integration test.");
                Relationship relationship = node1.CreateRelationshipTo(node2, _rel);
                relationship.SetProperty(PROP, "They relate");
                _nodeId1 = node1.Id;
                _nodeId2 = node2.Id;
                _relId1  = relationship.Id;
                tx.Success();
            }
            using (Transaction tx = _db.beginTx())
            {
                _db.execute(format(NODE_CREATE, NODE_INDEX, array(_label.name()), array(PROP))).close();
                _db.execute(format(RELATIONSHIP_CREATE, REL_INDEX, array(_rel.name()), array(PROP))).close();
                tx.Success();
            }
            AwaitPopulation(_db);
        }