Skip to content
Permalink
Browse files

[misc] deprecating Connection.getUsername(), Connection.getPort() and…

… Connection.getHostname()

and adding connection test coverage

(cherry picked from commit 7e7ad38)
  • Loading branch information...
rusher committed Jan 24, 2019
1 parent e1266f3 commit 48829cd73b01ec503783d2a0a2571dc3afb05be6
@@ -67,6 +67,7 @@
* @param out outputStream
* @param clientPrepareResult clientPrepareResult
* @param parameters parameter
* @param queryTimeout query timeout
* @throws IOException if connection fail
*/
public static void sendSubCmd(final PacketOutputStream out,
@@ -270,7 +270,7 @@ void resetStateAfterFailover(long maxRows, int transactionIsolationLevel, String

boolean isServerMariaDb() throws SQLException;

SQLException handleIoException(IOException initialException);
SQLException handleIoException(Exception initialException);

PacketInputStream getReader();

@@ -126,7 +126,6 @@ public void testPosition() throws SQLException {
assertEquals(11, blob.position(pattern, 1));
pattern = new byte[]{1, 2};
assertEquals(1, blob.position(pattern, 1));

}

@Test(expected = SQLException.class)
@@ -601,4 +600,12 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
}
}

@Test
public void connectionBlob() throws SQLException {
Blob blob = sharedConnection.createBlob();
assertArrayEquals(new byte[]{0}, blob.getBytes(1, 1));
blob.setBytes(5, new byte[]{1, 2, 3, 4, 5, 6});
assertArrayEquals(new byte[]{0, 0, 0, 0, 1, 2, 3, 4, 5}, blob.getBytes(1, 9));
}

}

0 comments on commit 48829cd

Please sign in to comment.
You can’t perform that action at this time.