comparison tests/OnClientTester.java @ 600:c2581dbd1dbf

Change test output to make it more informative on Windows
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Thu, 09 Dec 2021 14:13:43 +0100 (2021-12-09)
parents 613f94a13ad6
children 2b5516ed0d92
comparison
equal deleted inserted replaced
599:6f68317d4d0f 600:c2581dbd1dbf
572 char[] chars = s.toCharArray(); 572 char[] chars = s.toCharArray();
573 for (char c: chars) { 573 for (char c: chars) {
574 buf.append(' '); 574 buf.append(' ');
575 buf.append((int)c); 575 buf.append((int)c);
576 576
577 UnicodeBlock b = UnicodeBlock.of(c); 577 // UnicodeBlock b = UnicodeBlock.of(c);
578 if (!Character.isISOControl(c) && b != null) { 578 // if (!Character.isISOControl(c) && b != null) {
579 if (b != UnicodeBlock.HIGH_SURROGATES && b != UnicodeBlock.LOW_SURROGATES && b != UnicodeBlock.SPECIALS) { 579 // if (b != UnicodeBlock.HIGH_SURROGATES && b != UnicodeBlock.LOW_SURROGATES && b != UnicodeBlock.SPECIALS) {
580 buf.append("='"); 580 // buf.append("='");
581 buf.append(c); 581 // buf.append(c);
582 buf.append("'"); 582 // buf.append("'");
583 } 583 // }
584 } 584 // }
585 } 585 }
586 586
587 return "<" + buf.toString().trim() + ">"; 587 return "<" + buf.toString().trim() + ">";
588 } 588 }
589 589
590 private void testFileTransferHandlerUpload(Charset handlerEncoding, String fileEncoding) throws IOException, SQLException, Failure { 590 private void testFileTransferHandlerUpload(Charset handlerEncoding, String fileEncoding) throws IOException, SQLException, Failure {
591 prepare(); 591 prepare();
592 outBuffer.append("Default encoding is " + Charset.defaultCharset().displayName() + "\n");
592 Path d = getTmpDir(currentTestName); 593 Path d = getTmpDir(currentTestName);
593 Path f = d.resolve("data.txt"); 594 Path f = d.resolve("data.txt");
594 OutputStream s = Files.newOutputStream(f, CREATE_NEW); 595 OutputStream s = Files.newOutputStream(f, CREATE_NEW);
595 PrintStream ps = new PrintStream(s, false, fileEncoding); 596 PrintStream ps = new PrintStream(s, false, fileEncoding);
596 ps.println("1|one"); 597 ps.println("1|one");
604 String two = "twø"; 605 String two = "twø";
605 // 606 //
606 String hexTwo = hexdump(two); 607 String hexTwo = hexdump(two);
607 String hexResult = hexdump(result); 608 String hexResult = hexdump(result);
608 assertEq("query result hexdump", hexTwo, hexResult); 609 assertEq("query result hexdump", hexTwo, hexResult);
609 assertEq("query result", two, result); 610 // assertEq("query result", two, result);
610 } 611 }
611 612
612 private void test_FileTransferHandlerUploadRefused() throws IOException, SQLException, Failure { 613 private void test_FileTransferHandlerUploadRefused() throws IOException, SQLException, Failure {
613 initTest("test_FileTransferHandlerUploadRefused"); 614 initTest("test_FileTransferHandlerUploadRefused");
614 prepare(); 615 prepare();