Skip to content

Commit a822166

Browse files
authored
Correct examples for Config. Use example.com for URIs (neo4j#735)
1 parent f90696c commit a822166

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

driver/src/main/java/org/neo4j/driver/Config.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,22 @@
4848
* To build a simple config with custom logging implementation:
4949
* <pre>
5050
* {@code
51-
* Config config = Config
52-
* .build()
53-
* .withLogging(new MyLogging())
54-
* .toConfig();
51+
* Config config = Config.builder()
52+
* .withLogging(new MyLogging())
53+
* .build();
5554
* }
5655
* </pre>
5756
* <p>
5857
* To build a more complicated config with tuned connection pool options:
5958
* <pre>
6059
* {@code
61-
* Config config = Config.build()
62-
* .withEncryption()
63-
* .withConnectionTimeout(10, TimeUnit.SECONDS)
64-
* .withMaxConnectionLifetime(30, TimeUnit.MINUTES)
65-
* .withMaxConnectionPoolSize(10)
66-
* .withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
67-
* .toConfig();
60+
* Config config = Config.builder()
61+
* .withEncryption()
62+
* .withConnectionTimeout( 10, TimeUnit.SECONDS)
63+
* .withMaxConnectionLifetime(30, TimeUnit.MINUTES)
64+
* .withMaxConnectionPoolSize(10)
65+
* .withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
66+
* .build();
6867
* }
6968
* </pre>
7069
*

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ private void addPerson( String name )
6262
String username = "neo4j";
6363
String password = "some password";
6464

65-
try ( Driver driver = createDriver( "neo4j://x.acme.com", username, password, ServerAddress.of( "a.acme.com", 7676 ),
66-
ServerAddress.of( "b.acme.com", 8787 ), ServerAddress.of( "c.acme.com", 9898 ) ) )
65+
try ( Driver driver = createDriver( "neo4j://x.example.com", username, password, ServerAddress.of( "a.example.com", 7676 ),
66+
ServerAddress.of( "b.example.com", 8787 ), ServerAddress.of( "c.example.com", 9898 ) ) )
6767
{
6868
try ( Session session = driver.session( builder().withDefaultAccessMode( AccessMode.WRITE ).build() ) )
6969
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void testShouldRunConfigCustomResolverExample() throws Exception
3535
StubServer server2 = StubServer.start( "return_1.script", 9002 );
3636

3737
// Given
38-
try ( ConfigCustomResolverExample example = new ConfigCustomResolverExample( "neo4j://x.acme.com", ServerAddress.of( "localhost", 9001 ) ) )
38+
try ( ConfigCustomResolverExample example = new ConfigCustomResolverExample( "neo4j://x.example.com", ServerAddress.of( "localhost", 9001 ) ) )
3939
{
4040
// Then
4141
assertTrue( example.canConnect() );

examples/src/test/resources/get_routing_table_only.script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
!: AUTO HELLO
44
!: AUTO GOODBYE
55

6-
C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": { "address": "x.acme.com:7687" }} {}
6+
C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": { "address": "x.example.com:7687" }} {}
77
PULL_ALL
88
S: SUCCESS {"fields": ["ttl", "servers"]}
99
RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001"], "role": "ROUTE"}]]

0 commit comments

Comments
 (0)