Mercurial > hg > monetdb-java
diff tests/OnClientTester.java @ 548:d1f6678f92c5 onclient
Test that throwing an IO Exception in the download handler invalidates the connection
At the moment we cannot report the error to the server.
It is easier to invalidate the connection now and switch to something more sophisticated
in the future than the other way around.
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Tue, 14 Sep 2021 09:23:21 +0200 (2021-09-14) |
parents | 79393647d7fb |
children | 5ce6a942aff3 |
line wrap: on
line diff
--- a/tests/OnClientTester.java +++ b/tests/OnClientTester.java @@ -237,13 +237,14 @@ public final class OnClientTester extend } // Disabled because it hangs, triggering the watchdog timer - public void testx_FailDownloadLate() throws SQLException, Failure { + public void test_FailDownloadLate() throws SQLException, Failure { prepare(); MyDownloadHandler handler = new MyDownloadHandler(200, "download refused"); conn.setDownloadHandler(handler); update("INSERT INTO foo SELECT value as i, 'number' || value AS t FROM sys.generate_series(0, 100)", 100); - expectError("COPY (SELECT * FROM foo) INTO 'banana' ON CLIENT", "download refused"); - queryInt("SELECT 42 -- check if the connection still works", 42); + expectError("COPY (SELECT * FROM sys.generate_series(0,200)) INTO 'banana' ON CLIENT", "download refused"); + // Exception closes the connection + assertEq("connection is closed", conn.isClosed(), true); } static class MyUploadHandler implements UploadHandler {