Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void fulltextIndexesMustBeTransferredInBackup()
        public virtual void FulltextIndexesMustBeTransferredInBackup()
        {
            InitializeTestData();
            VerifyData(_db);
            File backup = _dir.storeDir("backup");

            OnlineBackup.from("127.0.0.1", _backupPort).backup(backup);
            _db.shutdown();

            GraphDatabaseAPI backupDb = StartBackupDatabase(backup);

            VerifyData(backupDb);
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void fulltextIndexesMustBeUpdatedByIncrementalBackup()
        public virtual void FulltextIndexesMustBeUpdatedByIncrementalBackup()
        {
            InitializeTestData();
            File backup = _dir.databaseDir("backup");

            OnlineBackup.from("127.0.0.1", _backupPort).backup(backup);

            long nodeId3;
            long nodeId4;
            long relId2;

            using (Transaction tx = _db.beginTx())
            {
                Node node3 = _db.createNode(_label);
                node3.SetProperty(PROP, "Additional data.");
                Node node4 = _db.createNode(_label);
                node4.SetProperty(PROP, "Even more additional data.");
                Relationship rel = node3.CreateRelationshipTo(node4, _rel);
                rel.SetProperty(PROP, "Knows of");
                nodeId3 = node3.Id;
                nodeId4 = node4.Id;
                relId2  = rel.Id;
                tx.Success();
            }
            VerifyData(_db);

            OnlineBackup.from("127.0.0.1", _backupPort).backup(backup);
            _db.shutdown();

            GraphDatabaseAPI backupDb = StartBackupDatabase(backup);

            VerifyData(backupDb);

            using (Transaction tx = backupDb.BeginTx())
            {
                using (Result nodes = backupDb.Execute(format(QUERY_NODES, NODE_INDEX, "additional")))
                {
                    IList <long> nodeIds = nodes.Select(m => (( Node )m.get(NODE)).Id).ToList();
                    assertThat(nodeIds, containsInAnyOrder(nodeId3, nodeId4));
                }
                using (Result relationships = backupDb.Execute(format(QUERY_RELS, REL_INDEX, "knows")))
                {
                    IList <long> relIds = relationships.Select(m => (( Relationship )m.get(RELATIONSHIP)).Id).ToList();
                    assertThat(relIds, containsInAnyOrder(relId2));
                }
                tx.Success();
            }
        }