|
23 | 23 | import com.arcadedb.schema.Schema; |
24 | 24 | import com.arcadedb.schema.Type; |
25 | 25 | import com.arcadedb.test.BaseGraphServerTest; |
26 | | - |
27 | 26 | import org.assertj.core.data.Offset; |
28 | 27 | import org.junit.jupiter.api.AfterEach; |
29 | 28 | import org.junit.jupiter.api.Test; |
30 | | -import org.neo4j.driver.*; |
| 29 | +import org.neo4j.driver.AuthTokens; |
| 30 | +import org.neo4j.driver.Config; |
| 31 | +import org.neo4j.driver.Driver; |
| 32 | +import org.neo4j.driver.GraphDatabase; |
| 33 | +import org.neo4j.driver.Record; |
| 34 | +import org.neo4j.driver.Result; |
| 35 | +import org.neo4j.driver.Session; |
| 36 | +import org.neo4j.driver.SessionConfig; |
| 37 | +import org.neo4j.driver.Transaction; |
| 38 | +import org.neo4j.driver.Values; |
31 | 39 | import org.neo4j.driver.exceptions.ClientException; |
32 | 40 | import org.neo4j.driver.summary.ResultSummary; |
33 | | -import org.neo4j.driver.Values; |
34 | 41 |
|
35 | 42 | import java.io.BufferedReader; |
36 | 43 | import java.io.DataInputStream; |
|
44 | 51 | import java.nio.ByteBuffer; |
45 | 52 | import java.nio.charset.StandardCharsets; |
46 | 53 | import java.security.MessageDigest; |
47 | | -import java.util.Base64; |
48 | | -import java.util.concurrent.CompletableFuture; |
49 | | -import java.util.concurrent.CompletionStage; |
50 | | -import java.util.concurrent.TimeUnit; |
51 | 54 | import java.util.ArrayList; |
| 55 | +import java.util.Base64; |
52 | 56 | import java.util.HashMap; |
53 | 57 | import java.util.List; |
54 | 58 | import java.util.Map; |
| 59 | +import java.util.concurrent.CompletableFuture; |
| 60 | +import java.util.concurrent.CompletionStage; |
| 61 | +import java.util.concurrent.TimeUnit; |
55 | 62 |
|
56 | 63 | import static org.assertj.core.api.Assertions.assertThat; |
57 | 64 | import static org.assertj.core.api.Assertions.assertThatThrownBy; |
58 | 65 |
|
59 | | -import org.neo4j.driver.Record; |
60 | | - |
61 | 66 | /** |
62 | 67 | * Integration tests for BOLT protocol using Neo4j Java driver. |
63 | 68 | */ |
@@ -161,7 +166,8 @@ void createAndMatchEdge() { |
161 | 166 | session.run("CREATE (a:EdgePerson {name: 'EdgeAlice'}), (b:EdgePerson {name: 'EdgeBob'})"); |
162 | 167 |
|
163 | 168 | // Create edge |
164 | | - session.run("MATCH (a:EdgePerson {name: 'EdgeAlice'}), (b:EdgePerson {name: 'EdgeBob'}) CREATE (a)-[:KNOWS {since: 2020}]->(b)"); |
| 169 | + session.run( |
| 170 | + "MATCH (a:EdgePerson {name: 'EdgeAlice'}), (b:EdgePerson {name: 'EdgeBob'}) CREATE (a)-[:KNOWS {since: 2020}]->(b)"); |
165 | 171 |
|
166 | 172 | // Query edge |
167 | 173 | final Result result = session.run( |
@@ -877,7 +883,8 @@ void concurrentSessions() throws Exception { |
877 | 883 |
|
878 | 884 | // Check for errors |
879 | 885 | if (!errors.isEmpty()) { |
880 | | - throw new AssertionError("Concurrent test failed with " + errors.size() + " errors: " + errors.get(0).getMessage(), errors.get(0)); |
| 886 | + throw new AssertionError("Concurrent test failed with " + errors.size() + " errors: " + errors.get(0).getMessage(), |
| 887 | + errors.get(0)); |
881 | 888 | } |
882 | 889 | } |
883 | 890 |
|
@@ -957,7 +964,8 @@ void largeParameterMap() { |
957 | 964 | // Build a query that uses all parameters |
958 | 965 | StringBuilder query = new StringBuilder("RETURN "); |
959 | 966 | for (int i = 0; i < 50; i++) { |
960 | | - if (i > 0) query.append(" + "); |
| 967 | + if (i > 0) |
| 968 | + query.append(" + "); |
961 | 969 | query.append("$param").append(i); |
962 | 970 | } |
963 | 971 | query.append(" AS sum"); |
@@ -1103,7 +1111,8 @@ void httpDiscoveryOnBoltPort() throws Exception { |
1103 | 1111 | @Test |
1104 | 1112 | void systemDatabaseDbmsComponents() { |
1105 | 1113 | // Neo4j Desktop queries the "system" database for version info |
1106 | | - try (final Driver driver = GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("root", DEFAULT_PASSWORD_FOR_TESTS))) { |
| 1114 | + try (final Driver driver = GraphDatabase.driver("bolt://localhost:7687", |
| 1115 | + AuthTokens.basic("root", DEFAULT_PASSWORD_FOR_TESTS))) { |
1107 | 1116 | try (final Session session = driver.session(SessionConfig.forDatabase("system"))) { |
1108 | 1117 | final var result = session.run("CALL dbms.components()"); |
1109 | 1118 | assertThat(result.hasNext()).isTrue(); |
@@ -1615,4 +1624,18 @@ void showVectorIndexesReturnsEmptyWithoutVectorIndexes() { |
1615 | 1624 | } |
1616 | 1625 | } |
1617 | 1626 | } |
| 1627 | + |
| 1628 | + @Test |
| 1629 | + void showSparseVectorIndexesReturnsEmptyWithoutSparseVectorIndexes() { |
| 1630 | + try (Driver driver = getDriver()) { |
| 1631 | + try (Session session = driver.session(SessionConfig.forDatabase(getDatabaseName()))) { |
| 1632 | + final Result result = session.run("SHOW SPARSE_VECTOR INDEXES"); |
| 1633 | + assertThat(result.keys()).containsExactly("id", "name", "state", "populationPercent", "type", |
| 1634 | + "entityType", "labelsOrTypes", "properties", "indexProvider", "owningConstraint", "lastRead", "readCount"); |
| 1635 | + final List<Record> rows = result.list(); |
| 1636 | + for (final Record r : rows) |
| 1637 | + assertThat(r.get("type").asString()).isEqualTo("SPARSE_VECTOR"); |
| 1638 | + } |
| 1639 | + } |
| 1640 | + } |
1618 | 1641 | } |
0 commit comments