Mercurial > hg > monetdb-java
comparison tests/TLSTester.java @ 855:839d76eeb4ae
Added missing Copyright header comments
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 18 Jan 2024 16:36:03 +0100 (15 months ago) |
parents | 157dcb2d6516 |
children | d74e850e2991 |
comparison
equal
deleted
inserted
replaced
854:cd365d70c745 | 855:839d76eeb4ae |
---|---|
1 /* | |
2 * SPDX-License-Identifier: MPL-2.0 | |
3 * | |
4 * This Source Code Form is subject to the terms of the Mozilla Public | |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
7 * | |
8 * Copyright 2024 MonetDB Foundation; | |
9 * Copyright August 2008 - 2023 MonetDB B.V.; | |
10 * Copyright 1997 - July 2008 CWI. | |
11 */ | |
12 | |
1 import org.monetdb.mcl.net.Parameter; | 13 import org.monetdb.mcl.net.Parameter; |
2 | 14 |
3 import java.io.*; | 15 import java.io.*; |
4 import java.net.URL; | 16 import java.net.URL; |
5 import java.net.URLConnection; | 17 import java.net.URLConnection; |
128 test_refuse_no_cert(); | 140 test_refuse_no_cert(); |
129 test_refuse_wrong_cert(); | 141 test_refuse_wrong_cert(); |
130 test_refuse_wrong_host(); | 142 test_refuse_wrong_host(); |
131 test_refuse_tlsv12(); | 143 test_refuse_tlsv12(); |
132 test_refuse_expired(); | 144 test_refuse_expired(); |
133 // test_connect_client_auth1(); | 145 // test_connect_client_auth1(); |
134 // test_connect_client_auth2(); | 146 // test_connect_client_auth2(); |
135 test_fail_tls_to_plain(); | 147 test_fail_tls_to_plain(); |
136 test_fail_plain_to_tls(); | 148 test_fail_plain_to_tls(); |
137 test_connect_server_name(); | 149 test_connect_server_name(); |
138 test_connect_alpn_mapi9(); | 150 test_connect_alpn_mapi9(); |
139 test_connect_trusted(); | 151 test_connect_trusted(); |
299 return; | 311 return; |
300 try { | 312 try { |
301 expectSuccess(); | 313 expectSuccess(); |
302 throw new RuntimeException("Expected test " + testName + " to throw an exception but it didn't"); | 314 throw new RuntimeException("Expected test " + testName + " to throw an exception but it didn't"); |
303 } catch (SQLException e) { | 315 } catch (SQLException e) { |
304 for (String expected : expectedMessages) | 316 for (String expected : expectedMessages) { |
305 if (e.getMessage().contains(expected)) | 317 if (e.getMessage().contains(expected)) |
306 return; | 318 return; |
319 } | |
307 String message = "Test " + testName + " threw the wrong exception: " + e.getMessage() + '\n' + "Expected:\n <" + String.join(">\n <", expectedMessages) + ">"; | 320 String message = "Test " + testName + " threw the wrong exception: " + e.getMessage() + '\n' + "Expected:\n <" + String.join(">\n <", expectedMessages) + ">"; |
308 throw new RuntimeException(message, e); | 321 throw new RuntimeException(message, e); |
309 | 322 } |
310 } | 323 } |
311 } | |
312 | |
313 } | 324 } |
314 } | 325 } |