Skip to content

Commit 33fecbf

Browse files
committed
Ensure all URI examples contain an explicit port
1 parent 8aa0c4f commit 33fecbf

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ available.
2121

2222
Connect to a Neo4j 3.0.0+ database:
2323

24-
Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic( "neo4j", "neo4j" ) );
24+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic( "neo4j", "neo4j" ) );
2525

2626
try ( Session session = driver.session() )
2727
{

driver/src/main/javadoc/overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h3>Getting Connected</h3>
1313

1414
<p>Once you have the driver and a connector on your classpath, you can establish sessions with Neo4j.</p>
1515

16-
<pre><code>Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic( "neo4j", "p4ssw0rd" ) );
16+
<pre><code>Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic( "neo4j", "p4ssw0rd" ) );
1717
try( Session session = driver.session() )
1818
{
1919
StatementResult result = session.run( "RETURN 'hello, world!'" );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class DirectDriverTest
4242
public void shouldUseDefaultPortIfMissing()
4343
{
4444
// Given
45-
URI uri = URI.create( "bolt://localhost" );
45+
URI uri = URI.create( "bolt://localhost:7687" );
4646

4747
// When
4848
DirectDriver driver = (DirectDriver) GraphDatabase.driver( uri );

driver/src/test/java/org/neo4j/driver/v1/stress/DriverStresser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void setup() throws Exception
5858
{
5959
server = Neo4jRunner.getOrCreateGlobalRunner();
6060
server.ensureRunning( Neo4jSettings.TEST_SETTINGS );
61-
driver = GraphDatabase.driver( "bolt://localhost" );
61+
driver = GraphDatabase.driver( "bolt://localhost:7687" );
6262
}
6363

6464
static class Worker

driver/src/test/java/org/neo4j/driver/v1/tck/ErrorReportingSteps.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public void itThrowsAnClientException( List<String> data ) throws Throwable
186186
@And( "^I get a session from the driver and close the driver$" )
187187
public void iGetASessionFromTheDriver() throws Throwable
188188
{
189-
try ( Driver driver = GraphDatabase.driver( "bolt://localhost" ) )
189+
try ( Driver driver = GraphDatabase.driver( "bolt://localhost:7687" ) )
190190
{
191191
transactionRunner = new TransactionRunner( driver.session() );
192192
}
@@ -228,7 +228,7 @@ public void iSetUpADriverToAnIncorrectScheme() throws Throwable
228228
@Given( "^I have a driver with fixed pool size of (\\d+)$" )
229229
public void iHaveADriverWithFixedPoolSizeOf( int poolSize ) throws Throwable
230230
{
231-
smallDriver = GraphDatabase.driver( "bolt://localhost", Config.build().withMaxSessions( poolSize ).toConfig() );
231+
smallDriver = GraphDatabase.driver( "bolt://localhost:7687", Config.build().withMaxSessions( poolSize ).toConfig() );
232232
}
233233

234234
@And( "^I try to get a session$" )

examples/src/main/java/org/neo4j/docs/driver/Examples.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class Examples
4141
public static Driver constructDriver() throws Exception
4242
{
4343
// tag::construct-driver[]
44-
Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic("neo4j", "neo4j") );
44+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic("neo4j", "neo4j") );
4545
// end::construct-driver[]
4646

4747
return driver;
@@ -51,7 +51,7 @@ public static Driver configuration() throws Exception
5151
{
5252
// tag::configuration[]
5353
Driver driver = GraphDatabase.driver(
54-
"bolt://localhost",
54+
"bolt://localhost:7687",
5555
AuthTokens.basic("neo4j", "neo4j"),
5656
Config.build().withMaxSessions( 10 ).toConfig() );
5757
// end::configuration[]
@@ -215,7 +215,7 @@ public static void notifications( Session session ) throws Exception
215215
public static Driver requireEncryption() throws Exception
216216
{
217217
// tag::tls-require-encryption[]
218-
Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic("neo4j", "neo4j"),
218+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic("neo4j", "neo4j"),
219219
Config.build().withEncryptionLevel( Config.EncryptionLevel.REQUIRED ).toConfig() );
220220
// end::tls-require-encryption[]
221221

@@ -225,7 +225,7 @@ public static Driver requireEncryption() throws Exception
225225
public static Driver trustOnFirstUse() throws Exception
226226
{
227227
// tag::tls-trust-on-first-use[]
228-
Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic("neo4j", "neo4j"), Config.build()
228+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic("neo4j", "neo4j"), Config.build()
229229
.withEncryptionLevel( Config.EncryptionLevel.REQUIRED )
230230
.withTrustStrategy( Config.TrustStrategy.trustOnFirstUse( new File( "/path/to/neo4j_known_hosts" ) ) )
231231
.toConfig() );
@@ -237,7 +237,7 @@ public static Driver trustOnFirstUse() throws Exception
237237
public static Driver trustSignedCertificates() throws Exception
238238
{
239239
// tag::tls-signed[]
240-
Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic("neo4j", "neo4j"), Config.build()
240+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic("neo4j", "neo4j"), Config.build()
241241
.withEncryptionLevel( Config.EncryptionLevel.REQUIRED )
242242
.withTrustStrategy( Config.TrustStrategy.trustCustomCertificateSignedBy( new File( "/path/to/ca-certificate.pem") ) )
243243
.toConfig() );
@@ -249,7 +249,7 @@ public static Driver trustSignedCertificates() throws Exception
249249
public static Driver connectWithAuthDisabled() throws Exception
250250
{
251251
// tag::connect-with-auth-disabled[]
252-
Driver driver = GraphDatabase.driver( "bolt://localhost",
252+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687",
253253
Config.build().withEncryptionLevel( Config.EncryptionLevel.REQUIRED ).toConfig() );
254254
// end::connect-with-auth-disabled[]
255255

examples/src/main/java/org/neo4j/docs/driver/MinimalWorkingExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class MinimalWorkingExample
2828
public static void minimalWorkingExample() throws Exception
2929
{
3030
// tag::minimal-example[]
31-
Driver driver = GraphDatabase.driver( "bolt://localhost", AuthTokens.basic( "neo4j", "neo4j" ) );
31+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic( "neo4j", "neo4j" ) );
3232
Session session = driver.session();
3333

3434
session.run( "CREATE (a:Person {name:'Arthur', title:'King'})" );

examples/src/test/java/org/neo4j/docs/driver/ExamplesIT.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void statement() throws Throwable
8686
{
8787
StdIOCapture stdIO = new StdIOCapture();
8888
try ( AutoCloseable captured = stdIO.capture();
89-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
89+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
9090
Session session = driver.session() )
9191
{
9292
Examples.statement( session );
@@ -101,7 +101,7 @@ public void statementWithoutParameters() throws Throwable
101101
{
102102
StdIOCapture stdIO = new StdIOCapture();
103103
try ( AutoCloseable captured = stdIO.capture();
104-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
104+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
105105
Session session = driver.session() )
106106
{
107107
Examples.statementWithoutParameters( session );
@@ -116,7 +116,7 @@ public void resultTraversal() throws Throwable
116116
{
117117
StdIOCapture stdIO = new StdIOCapture();
118118
try ( AutoCloseable captured = stdIO.capture();
119-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
119+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
120120
Session session = driver.session() )
121121
{
122122
session.run( "MATCH (n) DETACH DELETE n" );
@@ -134,7 +134,7 @@ public void accessRecord() throws Throwable
134134
{
135135
StdIOCapture stdIO = new StdIOCapture();
136136
try ( AutoCloseable captured = stdIO.capture();
137-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
137+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
138138
Session session = driver.session() )
139139
{
140140
session.run( "MATCH (n) DETACH DELETE n" );
@@ -152,7 +152,7 @@ public void retainResultsForNestedQuerying() throws Throwable
152152
{
153153
StdIOCapture stdIO = new StdIOCapture();
154154
try ( AutoCloseable captured = stdIO.capture();
155-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
155+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
156156
Session session = driver.session() )
157157
{
158158
session.run( "MATCH (n) DETACH DELETE n" );
@@ -172,7 +172,7 @@ public void retainResultsForLaterProcessing() throws Throwable
172172
{
173173
StdIOCapture stdIO = new StdIOCapture();
174174
try ( AutoCloseable captured = stdIO.capture();
175-
Driver driver = GraphDatabase.driver( "bolt://localhost" ) )
175+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" ) )
176176
{
177177
try ( Session setup = driver.session() )
178178
{
@@ -192,7 +192,7 @@ public void handleCypherError() throws Throwable
192192
{
193193
StdIOCapture stdIO = new StdIOCapture();
194194
try ( AutoCloseable captured = stdIO.capture();
195-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
195+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
196196
Session session = driver.session() )
197197
{
198198
exception.expect(RuntimeException.class);
@@ -203,7 +203,7 @@ public void handleCypherError() throws Throwable
203203
@Test
204204
public void transactionCommit() throws Throwable
205205
{
206-
try ( Driver driver = GraphDatabase.driver( "bolt://localhost" );
206+
try ( Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
207207
Session session = driver.session() )
208208
{
209209
session.run( "MATCH (n) DETACH DELETE n" );
@@ -218,7 +218,7 @@ public void transactionCommit() throws Throwable
218218
@Test
219219
public void transactionRollback() throws Throwable
220220
{
221-
try ( Driver driver = GraphDatabase.driver( "bolt://localhost" );
221+
try ( Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
222222
Session session = driver.session() )
223223
{
224224
session.run( "MATCH (n) DETACH DELETE n" );
@@ -236,7 +236,7 @@ public void resultSummary() throws Throwable
236236
{
237237
StdIOCapture stdIO = new StdIOCapture();
238238
try ( AutoCloseable captured = stdIO.capture();
239-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
239+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
240240
Session session = driver.session() )
241241
{
242242
Examples.resultSummary( session );
@@ -253,7 +253,7 @@ public void notifications() throws Throwable
253253
{
254254
StdIOCapture stdIO = new StdIOCapture();
255255
try ( AutoCloseable captured = stdIO.capture();
256-
Driver driver = GraphDatabase.driver( "bolt://localhost" );
256+
Driver driver = GraphDatabase.driver( "bolt://localhost:7687" );
257257
Session session = driver.session() )
258258
{
259259
Examples.notifications( session );

0 commit comments

Comments
 (0)