comparison tests/OnClientTester.java @ 589:718492fb8714

Answer to question. Please test if it works for your system.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Wed, 10 Nov 2021 19:07:21 +0100 (2021-11-10)
parents 5aef0ea654b1
children b2cd3b828967
comparison
equal deleted inserted replaced
588:9f658a97666f 589:718492fb8714
14 import java.io.*; 14 import java.io.*;
15 import java.nio.charset.Charset; 15 import java.nio.charset.Charset;
16 import java.nio.charset.StandardCharsets; 16 import java.nio.charset.StandardCharsets;
17 import java.nio.file.Files; 17 import java.nio.file.Files;
18 import java.nio.file.Path; 18 import java.nio.file.Path;
19 import java.sql.DriverManager;
19 import java.sql.SQLException; 20 import java.sql.SQLException;
20 import java.util.List; 21 import java.util.List;
21 22
22 import static java.nio.file.StandardOpenOption.CREATE_NEW; 23 import static java.nio.file.StandardOpenOption.CREATE_NEW;
23 24
32 String requiredPrefix = null; 33 String requiredPrefix = null;
33 int verbosity = 0; 34 int verbosity = 0;
34 boolean watchDogEnabled = true; 35 boolean watchDogEnabled = true;
35 36
36 // Don't know why I need this all of a sudden.. is it only on my system? 37 // Don't know why I need this all of a sudden.. is it only on my system?
37 Class.forName("org.monetdb.jdbc.MonetDriver"); 38 // Class.forName("org.monetdb.jdbc.MonetDriver"); // should not be needed if you add: import java.sql.DriverManager;
38 39
39 for (String arg : args) { 40 for (String arg : args) {
40 if (arg.equals("-v")) 41 if (arg.equals("-v"))
41 verbosity++; 42 verbosity++;
42 else if (arg.equals("-vv")) 43 else if (arg.equals("-vv"))
321 conn.setUploadHandler(handler); 322 conn.setUploadHandler(handler);
322 expectError("COPY INTO foo FROM 'banana' ON CLIENT", "i don't like"); 323 expectError("COPY INTO foo FROM 'banana' ON CLIENT", "i don't like");
323 assertEq("cancellation callback called", false, handler.isCancelled()); 324 assertEq("cancellation callback called", false, handler.isCancelled());
324 assertEq("connection is closed", true, conn.isClosed()); 325 assertEq("connection is closed", true, conn.isClosed());
325 } 326 }
326
327 327
328 public void test_FailUploadLate2() throws SQLException, Failure { 328 public void test_FailUploadLate2() throws SQLException, Failure {
329 // Here we send empty lines only, to check if the server detects is properly instead 329 // Here we send empty lines only, to check if the server detects is properly instead
330 // of simply complaining about an incomplete file. 330 // of simply complaining about an incomplete file.
331 prepare(); 331 prepare();
570 if (startOfLine != bytesSeen) 570 if (startOfLine != bytesSeen)
571 lines++; 571 lines++;
572 return lines; 572 return lines;
573 } 573 }
574 } 574 }
575
576 } 575 }