Skip to content

Commit 377a48f

Browse files
authored
Migrate tests from Java Driver to Testkit (#979)
Migrated tests: - shouldAllowDatabaseNameInSessionRun -> test_should_support_database_name_using_session_run (Bolt bump from v4 to v4.1) - shouldAllowDatabaseNameInBeginTransaction -> test_should_read_successfully_with_database_name_using_tx_function (Bolt bump from v4 to v4.1) - shouldOnlyPullRecordsWhenNeededSimpleSession -> test_should_accept_custom_fetch_size_using_session_configuration (existing test)
1 parent 41180bb commit 377a48f

File tree

3 files changed

+0
-86
lines changed

3 files changed

+0
-86
lines changed

driver/src/test/java/org/neo4j/driver/internal/DirectDriverBoltKitIT.java

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@
3030
import java.util.ArrayList;
3131
import java.util.List;
3232

33-
import org.neo4j.driver.AccessMode;
3433
import org.neo4j.driver.AuthTokens;
3534
import org.neo4j.driver.Config;
3635
import org.neo4j.driver.Driver;
3736
import org.neo4j.driver.GraphDatabase;
38-
import org.neo4j.driver.Result;
3937
import org.neo4j.driver.Session;
4038
import org.neo4j.driver.async.AsyncSession;
4139
import org.neo4j.driver.async.ResultCursor;
@@ -55,7 +53,6 @@
5553
import static org.junit.jupiter.api.Assertions.assertEquals;
5654
import static org.junit.jupiter.api.Assertions.assertNull;
5755
import static org.neo4j.driver.SessionConfig.builder;
58-
import static org.neo4j.driver.SessionConfig.forDatabase;
5956
import static org.neo4j.driver.internal.logging.DevNullLogging.DEV_NULL_LOGGING;
6057
import static org.neo4j.driver.util.StubServer.INSECURE_CONFIG;
6158
import static org.neo4j.driver.util.TestUtil.await;
@@ -127,28 +124,6 @@ void shouldStreamingRecordsInBatchesRx() throws Exception
127124
}
128125
}
129126

130-
@Test
131-
void shouldOnlyPullRecordsWhenNeededSimpleSession() throws Exception
132-
{
133-
StubServer server = stubController.startStub( "streaming_records_v4_buffering.script", 9001 );
134-
try
135-
{
136-
try ( Driver driver = GraphDatabase.driver( "bolt://localhost:9001", INSECURE_CONFIG ) )
137-
{
138-
Session session = driver.session( builder().withFetchSize( 2 ).build() );
139-
Result result = session.run( "MATCH (n) RETURN n.name" );
140-
ArrayList<String> resultList = new ArrayList<>();
141-
result.forEachRemaining( ( rec ) -> resultList.add( rec.get( 0 ).asString() ) );
142-
143-
assertEquals( resultList, asList( "Bob", "Alice", "Tina", "Frank", "Daisy", "Clive" ) );
144-
}
145-
}
146-
finally
147-
{
148-
assertEquals( 0, server.exitStatus() );
149-
}
150-
}
151-
152127
@Test
153128
void shouldOnlyPullRecordsWhenNeededAsyncSession() throws Exception
154129
{
@@ -196,39 +171,6 @@ void shouldPullAllRecordsOnListAsyncWhenOverWatermark() throws Exception
196171
}
197172
}
198173

199-
@Test
200-
void shouldAllowDatabaseNameInSessionRun() throws Throwable
201-
{
202-
StubServer server = stubController.startStub( "read_server_v4_read.script", 9001 );
203-
204-
try ( Driver driver = GraphDatabase.driver( "bolt://localhost:9001", INSECURE_CONFIG );
205-
Session session = driver.session( builder().withDatabase( "mydatabase" ).withDefaultAccessMode( AccessMode.READ ).build() ) )
206-
{
207-
final Result result = session.run( "MATCH (n) RETURN n.name" );
208-
result.consume();
209-
}
210-
finally
211-
{
212-
assertEquals( 0, server.exitStatus() );
213-
}
214-
}
215-
216-
@Test
217-
void shouldAllowDatabaseNameInBeginTransaction() throws Throwable
218-
{
219-
StubServer server = stubController.startStub( "read_server_v4_read_tx.script", 9001 );
220-
221-
try ( Driver driver = GraphDatabase.driver( "bolt://localhost:9001", INSECURE_CONFIG );
222-
Session session = driver.session( forDatabase( "mydatabase" ) ) )
223-
{
224-
session.readTransaction( tx -> tx.run( "MATCH (n) RETURN n.name" ).consume() );
225-
}
226-
finally
227-
{
228-
assertEquals( 0, server.exitStatus() );
229-
}
230-
}
231-
232174
@Test
233175
void shouldDiscardIfPullNotFinished() throws Throwable
234176
{

driver/src/test/resources/read_server_v4_read.script

Lines changed: 0 additions & 12 deletions
This file was deleted.

driver/src/test/resources/read_server_v4_read_tx.script

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)