Skip to content

Commit d9931df

Browse files
author
Stanley Shyiko
committed
Fixed failing BinaryLogClientIntegrationTest
1 parent 31fdde8 commit d9931df

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/test/java/com/github/shyiko/mysql/binlog/BinaryLogClientIntegrationTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,7 @@ private Serializable[] writeAndCaptureRow(BinaryLogClient client, final String c
451451
final String... values) throws Exception {
452452
CapturingEventListener capturingEventListener = new CapturingEventListener();
453453
client.registerEventListener(capturingEventListener);
454-
// ensure "capturingEventListener -> eventListener" order
455-
client.unregisterEventListener(eventListener);
454+
CountDownEventListener eventListener = new CountDownEventListener();
456455
client.registerEventListener(eventListener);
457456
try {
458457
master.execute(new Callback<Statement>() {
@@ -472,6 +471,7 @@ public void execute(Statement statement) throws SQLException {
472471
});
473472
eventListener.waitFor(WriteRowsEventData.class, 1, DEFAULT_TIMEOUT);
474473
} finally {
474+
client.unregisterEventListener(eventListener);
475475
client.unregisterEventListener(capturingEventListener);
476476
}
477477
List<Serializable[]> writtenRows =
@@ -648,6 +648,7 @@ public void execute(Statement statement) throws SQLException {
648648
eventListener.waitFor(WriteRowsEventData.class, 1, DEFAULT_TIMEOUT);
649649
}
650650

651+
@SuppressWarnings("deprecation")
651652
@Test
652653
public void testAutomaticFailover() throws Exception {
653654
TCPReverseProxy tcpReverseProxy = new TCPReverseProxy(33262, slave.port);
@@ -731,6 +732,7 @@ private void testCommunicationFailureInTheMiddleOfEventDataDeserialization(final
731732
testCommunicationFailure(eventDeserializer);
732733
}
733734

735+
@SuppressWarnings("deprecation")
734736
protected void testCommunicationFailure(EventDeserializer eventDeserializer) throws Exception {
735737
try {
736738
client.disconnect();
@@ -1071,8 +1073,8 @@ public MySQLConnection(String hostname, int port, String username, String passwo
10711073
}
10721074

10731075
private void connect() throws SQLException {
1074-
this.connection = DriverManager.getConnection("jdbc:mysql://" + hostname + ":" + port,
1075-
username, password);
1076+
this.connection = DriverManager.getConnection("jdbc:mysql://" + hostname + ":" + port +
1077+
"?serverTimezone=UTC", username, password);
10761078
execute(new Callback<Statement>() {
10771079

10781080
@Override

0 commit comments

Comments
 (0)