| 13 | }; |
| 14 | |
| 15 | TEST_F(ImportExportDBTest, Test) { |
| 16 | auto tempDir = TestHelper::getTempDir(getTestGroupAndName()); |
| 17 | auto dbPath = common::LocalFileSystem::joinPath(tempDir, "export.tmp"); |
| 18 | auto result = conn->query("EXPORT DATABASE '" + dbPath + "'"); |
| 19 | ASSERT_TRUE(result->isSuccess()) << result->getErrorMessage(); |
| 20 | result.reset(); |
| 21 | createNewDB(); |
| 22 | result = conn->query("IMPORT DATABASE '" + dbPath + "'"); |
| 23 | ASSERT_TRUE(result->isSuccess()) << result->getErrorMessage(); |
| 24 | result = conn->query("MATCH (a:person)-[e:knows]->(b:person) RETURN COUNT(*)"); |
| 25 | ASSERT_TRUE(result->isSuccess()) << result->getErrorMessage(); |
| 26 | ASSERT_TRUE(result->hasNext()); |
| 27 | ASSERT_EQ(result->getNext()->getValue(0)->getValue<int64_t>(), 14); |
| 28 | } |
| 29 | |
| 30 | } // namespace testing |
| 31 | } // namespace lbug |