Skip to content

Commit 47deff5

Browse files
author
Zhen
committed
Merge branch '1.2' into 1.3
2 parents 0bdee8d + 5578383 commit 47deff5

File tree

3 files changed

+11
-50
lines changed

3 files changed

+11
-50
lines changed

driver/src/test/java/org/neo4j/driver/v1/integration/SessionIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.neo4j.driver.internal.util.ServerVersion;
4848
import org.neo4j.driver.v1.util.TestNeo4j;
4949

50+
import static java.lang.String.format;
5051
import static org.hamcrest.CoreMatchers.containsString;
5152
import static org.hamcrest.CoreMatchers.equalTo;
5253
import static org.hamcrest.CoreMatchers.instanceOf;
@@ -968,7 +969,8 @@ private static ThrowingWork newThrowingWorkSpy( String query, int failures )
968969
private static void assumeBookmarkSupport( Driver driver )
969970
{
970971
ServerVersion serverVersion = ServerVersion.version( driver );
971-
assumeTrue( serverVersion.greaterThanOrEqual( v3_1_0 ) );
972+
assumeTrue( format( "Server version `%s` does not support bookmark", serverVersion ),
973+
serverVersion.greaterThanOrEqual( v3_1_0 ) );
972974
}
973975

974976
private static class ThrowingWork implements TransactionWork<Record>

driver/src/test/java/org/neo4j/driver/v1/util/cc/ClusterRule.java

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@
2020

2121
import org.junit.rules.ExternalResource;
2222

23-
import java.io.IOException;
24-
import java.nio.file.FileVisitResult;
25-
import java.nio.file.Files;
2623
import java.nio.file.Path;
2724
import java.nio.file.Paths;
28-
import java.nio.file.SimpleFileVisitor;
29-
import java.nio.file.attribute.BasicFileAttributes;
3025

3126
import org.neo4j.driver.internal.util.ServerVersion;
3227
import org.neo4j.driver.v1.AuthToken;
@@ -131,45 +126,4 @@ public void run()
131126
}
132127
} );
133128
}
134-
135-
private static void deleteClusterDir()
136-
{
137-
delete( CLUSTER_DIR );
138-
}
139-
140-
private static void delete( final Path path )
141-
{
142-
try
143-
{
144-
if ( !Files.exists( path ) )
145-
{
146-
return;
147-
}
148-
149-
Files.walkFileTree( path, new SimpleFileVisitor<Path>()
150-
{
151-
@Override
152-
public FileVisitResult visitFile( Path file, BasicFileAttributes attributes ) throws IOException
153-
{
154-
Files.delete( file );
155-
return FileVisitResult.CONTINUE;
156-
}
157-
158-
@Override
159-
public FileVisitResult postVisitDirectory( Path dir, IOException error ) throws IOException
160-
{
161-
if ( error != null )
162-
{
163-
return FileVisitResult.TERMINATE;
164-
}
165-
Files.delete( dir );
166-
return FileVisitResult.CONTINUE;
167-
}
168-
} );
169-
}
170-
catch ( IOException e )
171-
{
172-
throw new RuntimeException( "Unable to delete '" + path + "'", e );
173-
}
174-
}
175129
}

driver/src/test/java/org/neo4j/driver/v1/util/cc/SharedCluster.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,19 @@ private static Set<ClusterMember> parseStartCommandOutput( String output )
127127
String[] lines = output.split( lineSeparator() );
128128
for ( int i = 0; i < lines.length; i++ )
129129
{
130-
String line = lines[i];
130+
String line = lines[i].trim();
131+
if( line.isEmpty() )
132+
{
133+
// skip any empty lines
134+
continue;
135+
}
131136
String[] clusterMemberSplit = line.split( " " );
132137
if ( clusterMemberSplit.length != 3 )
133138
{
134139
throw new IllegalArgumentException( String.format(
135140
"Wrong start command output found at line [%s]. " +
136-
"Expected to have 'http_uri bolt_uri path' on each line. " +
137-
"Command output:%n'%s'", i + 1, output ) );
141+
"Expected to have 'http_uri bolt_uri path' on each nonempty line. " +
142+
"Command output:%n`%s`", i + 1, output ) );
138143
}
139144

140145
URI boltUri = URI.create( clusterMemberSplit[1] );

0 commit comments

Comments
 (0)