Skip to content

Commit

Permalink
Merge branch '1.2' into 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhen committed Mar 20, 2017
2 parents 0bdee8d + 5578383 commit 47deff5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.neo4j.driver.internal.util.ServerVersion;
import org.neo4j.driver.v1.util.TestNeo4j;

import static java.lang.String.format;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
Expand Down Expand Up @@ -968,7 +969,8 @@ private static ThrowingWork newThrowingWorkSpy( String query, int failures )
private static void assumeBookmarkSupport( Driver driver )
{
ServerVersion serverVersion = ServerVersion.version( driver );
assumeTrue( serverVersion.greaterThanOrEqual( v3_1_0 ) );
assumeTrue( format( "Server version `%s` does not support bookmark", serverVersion ),
serverVersion.greaterThanOrEqual( v3_1_0 ) );
}

private static class ThrowingWork implements TransactionWork<Record>
Expand Down
46 changes: 0 additions & 46 deletions driver/src/test/java/org/neo4j/driver/v1/util/cc/ClusterRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,8 @@

import org.junit.rules.ExternalResource;

import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;

import org.neo4j.driver.internal.util.ServerVersion;
import org.neo4j.driver.v1.AuthToken;
Expand Down Expand Up @@ -131,45 +126,4 @@ public void run()
}
} );
}

private static void deleteClusterDir()
{
delete( CLUSTER_DIR );
}

private static void delete( final Path path )
{
try
{
if ( !Files.exists( path ) )
{
return;
}

Files.walkFileTree( path, new SimpleFileVisitor<Path>()
{
@Override
public FileVisitResult visitFile( Path file, BasicFileAttributes attributes ) throws IOException
{
Files.delete( file );
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult postVisitDirectory( Path dir, IOException error ) throws IOException
{
if ( error != null )
{
return FileVisitResult.TERMINATE;
}
Files.delete( dir );
return FileVisitResult.CONTINUE;
}
} );
}
catch ( IOException e )
{
throw new RuntimeException( "Unable to delete '" + path + "'", e );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,19 @@ private static Set<ClusterMember> parseStartCommandOutput( String output )
String[] lines = output.split( lineSeparator() );
for ( int i = 0; i < lines.length; i++ )
{
String line = lines[i];
String line = lines[i].trim();
if( line.isEmpty() )
{
// skip any empty lines
continue;
}
String[] clusterMemberSplit = line.split( " " );
if ( clusterMemberSplit.length != 3 )
{
throw new IllegalArgumentException( String.format(
"Wrong start command output found at line [%s]. " +
"Expected to have 'http_uri bolt_uri path' on each line. " +
"Command output:%n'%s'", i + 1, output ) );
"Expected to have 'http_uri bolt_uri path' on each nonempty line. " +
"Command output:%n`%s`", i + 1, output ) );
}

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

0 comments on commit 47deff5

Please sign in to comment.