Skip to content

Commit

Permalink
Fix some test failures due to changes to routing table procedure on r…
Browse files Browse the repository at this point in the history
…ead-replica in 4.0

Removed the changes to driver API
  • Loading branch information
Zhen Li committed Feb 28, 2019
1 parent 05370a6 commit e9e5a93
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public String host()
return host;
}

@Override
public String originalHost()
{
return originalHost;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ServerVersion
{
public static final String NEO4J_PRODUCT = "Neo4j";

public static final ServerVersion v4_0_0 = new ServerVersion( NEO4J_PRODUCT, 4, 0, 0 );
public static final ServerVersion v3_5_0 = new ServerVersion( NEO4J_PRODUCT, 3, 5, 0 );
public static final ServerVersion v3_4_0 = new ServerVersion( NEO4J_PRODUCT, 3, 4, 0 );
public static final ServerVersion v3_2_0 = new ServerVersion( NEO4J_PRODUCT, 3, 2, 0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ public interface ServerAddress
*/
String host();

/**
* Returns the original host name of this {@link ServerAddress}.
* This value might different from {@link #host()} when the host is a resolved IP address.
* @return the original host name, never {@code null}.
*/
String originalHost();

/**
* Retrieve the port portion of this {@link ServerAddress}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import static org.neo4j.driver.internal.util.ServerVersion.v3_2_0;
import static org.neo4j.driver.internal.util.ServerVersion.v3_4_0;
import static org.neo4j.driver.internal.util.ServerVersion.v3_5_0;
import static org.neo4j.driver.internal.util.ServerVersion.v4_0_0;

public enum Neo4jFeature
{
Expand All @@ -36,7 +37,8 @@ public enum Neo4jFeature
STATEMENT_RESULT_TIMINGS( v3_1_0 ),
LIST_QUERIES_PROCEDURE( v3_1_0 ),
CONNECTOR_LISTEN_ADDRESS_CONFIGURATION( v3_1_0 ),
BOLT_V3( v3_5_0 );
BOLT_V3( v3_5_0 ),
BOLT_V4( v4_0_0 );

private final ServerVersion availableFromVersion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.neo4j.driver.internal.cluster.RoutingSettings;
import org.neo4j.driver.internal.retry.RetrySettings;
import org.neo4j.driver.internal.util.ChannelTrackingDriverFactory;
import org.neo4j.driver.internal.util.DisabledOnNeo4jWith;
import org.neo4j.driver.internal.util.FailingConnectionDriverFactory;
import org.neo4j.driver.internal.util.FakeClock;
import org.neo4j.driver.internal.util.ServerVersion;
Expand Down Expand Up @@ -86,6 +87,7 @@
import static org.neo4j.driver.internal.logging.DevNullLogging.DEV_NULL_LOGGING;
import static org.neo4j.driver.internal.util.Matchers.connectionAcquisitionTimeoutError;
import static org.neo4j.driver.internal.util.Neo4jFeature.BOLT_V3;
import static org.neo4j.driver.internal.util.Neo4jFeature.BOLT_V4;
import static org.neo4j.driver.v1.Values.parameters;
import static org.neo4j.driver.v1.util.DaemonThreadFactory.daemon;
import static org.neo4j.driver.v1.util.TestUtil.await;
Expand Down Expand Up @@ -137,6 +139,7 @@ void shouldExecuteReadAndWritesWhenDriverSuppliedWithAddressOfLeader() throws Ex
}

@Test
@DisabledOnNeo4jWith( BOLT_V4 )
void shouldExecuteReadAndWritesWhenRouterIsDiscovered() throws Exception
{
Cluster cluster = clusterRule.getCluster();
Expand All @@ -157,6 +160,7 @@ void shouldExecuteReadAndWritesWhenDriverSuppliedWithAddressOfFollower() throws
}

@Test
@DisabledOnNeo4jWith( BOLT_V4 )
void sessionCreationShouldFailIfCallingDiscoveryProcedureOnEdgeServer()
{
Cluster cluster = clusterRule.getCluster();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void connectionUsedForSessionRunReturnedToThePoolWhenServerErrorDuringResultFetc
Connection connection1 = connectionPool.lastAcquiredConnectionSpy;
verify( connection1, never() ).release();

assertThrows( ClientException.class, result::hasNext );
assertThrows( ClientException.class, result::consume );

Connection connection2 = connectionPool.lastAcquiredConnectionSpy;
assertSame( connection1, connection2 );
Expand Down

0 comments on commit e9e5a93

Please sign in to comment.