Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ext {
argparse4jVersion = '0.7.0'
junitVersion = '4.12'
evaluatorVersion = '3.5.4'
neo4jJavaDriverVersion = '2.0.0-alpha03'
neo4jJavaDriverVersion = '4.0.0-beta01'
findbugsVersion = '3.0.0'
jansiVersion = '1.13'
jlineVersion = '2.14.6'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,10 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.neo4j.driver.AccessMode;
import org.neo4j.driver.AuthToken;
import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Config;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;
import org.neo4j.driver.Session;
import org.neo4j.driver.Statement;
import org.neo4j.driver.StatementResult;
import org.neo4j.driver.Transaction;
import org.neo4j.driver.*;
import org.neo4j.driver.exceptions.ClientException;
import org.neo4j.driver.exceptions.SessionExpiredException;
import org.neo4j.driver.internal.SessionConfig;
import org.neo4j.driver.internal.Bookmark;
import org.neo4j.driver.summary.DatabaseInfo;
import org.neo4j.shell.ConnectionConfig;
import org.neo4j.shell.Connector;
Expand Down Expand Up @@ -184,7 +175,7 @@ private void reconnect(boolean keepBookmark) {
if ( session != null && keepBookmark )
{
// Save the last bookmark and close the session
final String bookmark = session.lastBookmark();
final Bookmark bookmark = session.lastBookmark();
session.close();
builder.withBookmarks( bookmark );
}
Expand Down Expand Up @@ -312,13 +303,13 @@ private void clearTransactionStatements() {
}

private Driver getDriver(@Nonnull ConnectionConfig connectionConfig, @Nullable AuthToken authToken) {
Config.ConfigBuilder configBuilder = Config.build().withLogging(NullLogging.NULL_LOGGING);
Config.ConfigBuilder configBuilder = Config.builder().withLogging(NullLogging.NULL_LOGGING);
if (connectionConfig.encryption()) {
configBuilder = configBuilder.withEncryption();
} else {
configBuilder = configBuilder.withoutEncryption();
}
return driverProvider.apply(connectionConfig.driverUrl(), authToken, configBuilder.toConfig());
return driverProvider.apply(connectionConfig.driverUrl(), authToken, configBuilder.build());
}

private Optional<List<BoltResult>> captureResults(@Nonnull List<Statement> transactionStatements) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public void turnOffEncryptionIfRequested() throws CommandException {
BoltStateHandler handler = new BoltStateHandler(provider, false);
ConnectionConfig config = new ConnectionConfig("bolt://", "", -1, "", "", false, ABSENT_DB_NAME);
handler.connect(config);
assertEquals(Config.EncryptionLevel.NONE, provider.config.encryptionLevel());
assertFalse(provider.config.encrypted());
}

@Test
Expand All @@ -412,7 +412,7 @@ public void turnOnEncryptionIfRequested() throws CommandException {
BoltStateHandler handler = new BoltStateHandler(provider, false);
ConnectionConfig config = new ConnectionConfig("bolt://", "", -1, "", "", true, ABSENT_DB_NAME);
handler.connect(config);
assertEquals(Config.EncryptionLevel.REQUIRED, provider.config.encryptionLevel());
assertTrue(provider.config.encrypted());
}

private Driver stubResultSummaryInAnOpenSession(StatementResult resultMock, Session sessionMock, String version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import org.neo4j.driver.Driver;
import org.neo4j.driver.Metrics;
import org.neo4j.driver.Session;
import org.neo4j.driver.SessionConfig;
import org.neo4j.driver.async.AsyncSession;
import org.neo4j.driver.exceptions.Neo4jException;
import org.neo4j.driver.internal.SessionConfig;
import org.neo4j.driver.reactive.RxSession;
import org.neo4j.driver.types.TypeSystem;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.neo4j.shell.test.bolt;

import org.neo4j.driver.*;
import org.neo4j.driver.internal.Bookmark;
import org.neo4j.driver.types.TypeSystem;

import java.util.Map;
Expand Down Expand Up @@ -63,7 +64,7 @@ public StatementResult run(Statement statement, TransactionConfig config)
}

@Override
public String lastBookmark() {
public Bookmark lastBookmark() {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions tyrekicking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function prepare-bundle {

function testscript {
# first try with encryption off (4.X series), if that fails with encryption on (3.X series)
if cypher-shell/cypher-shell -u neo4j -p neo --encryption false "RETURN 1;"; then
if cypher-shell/cypher-shell -u neo4j -p neo "RETURN 1;"; then
echo "$1 Success!"
elif cypher-shell/cypher-shell -a "bolt://localhost:7687" -u neo4j -p neo --encryption true "RETURN 1;"; then
elif cypher-shell/cypher-shell -a "bolt://localhost:7687" -u neo4j -p neo "RETURN 1;"; then
echo "$1 Success!"
else
echo "$1 Failure!"
Expand Down