/external/apache-harmony/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLTimeoutExceptionTest.java

https://gitlab.com/brian0218/rk3288_r-box_android4.4.2_sdk · Java · 1064 lines · 805 code · 69 blank · 190 comment · 0 complexity · de4e270c2b1f254740929829fe674f20 MD5 · raw file

  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package org.apache.harmony.sql.tests.java.sql;
  18. import java.sql.SQLTimeoutException;
  19. import junit.framework.TestCase;
  20. import org.apache.harmony.testframework.serialization.SerializationTest;
  21. public class SQLTimeoutExceptionTest extends TestCase {
  22. private SQLTimeoutException sQLTimeoutException;
  23. protected void setUp() throws Exception {
  24. sQLTimeoutException = new SQLTimeoutException("MYTESTSTRING",
  25. "MYTESTSTRING", 1, new Exception("MYTHROWABLE"));
  26. }
  27. protected void tearDown() throws Exception {
  28. sQLTimeoutException = null;
  29. }
  30. /**
  31. * @test java.sql.SQLTimeoutException(String)
  32. */
  33. public void test_Constructor_LString() {
  34. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  35. "MYTESTSTRING");
  36. assertNotNull(sQLTimeoutException);
  37. assertNull("The SQLState of SQLTimeoutException should be null",
  38. sQLTimeoutException.getSQLState());
  39. assertEquals(
  40. "The reason of SQLTimeoutException set and get should be equivalent",
  41. "MYTESTSTRING", sQLTimeoutException.getMessage());
  42. assertEquals("The error code of SQLTimeoutException should be 0",
  43. sQLTimeoutException.getErrorCode(), 0);
  44. }
  45. /**
  46. * @test java.sql.SQLTimeoutException(String)
  47. */
  48. public void test_Constructor_LString_1() {
  49. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  50. (String) null);
  51. assertNotNull(sQLTimeoutException);
  52. assertNull("The SQLState of SQLTimeoutException should be null",
  53. sQLTimeoutException.getSQLState());
  54. assertNull("The reason of SQLTimeoutException should be null",
  55. sQLTimeoutException.getMessage());
  56. assertEquals("The error code of SQLTimeoutException should be 0",
  57. sQLTimeoutException.getErrorCode(), 0);
  58. }
  59. /**
  60. * @test java.sql.SQLTimeoutException(String, String)
  61. */
  62. public void test_Constructor_LStringLString() {
  63. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  64. "MYTESTSTRING1", "MYTESTSTRING2");
  65. assertNotNull(sQLTimeoutException);
  66. assertEquals(
  67. "The SQLState of SQLTimeoutException set and get should be equivalent",
  68. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  69. assertEquals(
  70. "The reason of SQLTimeoutException set and get should be equivalent",
  71. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  72. assertEquals("The error code of SQLTimeoutException should be 0",
  73. sQLTimeoutException.getErrorCode(), 0);
  74. }
  75. /**
  76. * @test java.sql.SQLTimeoutException(String, String)
  77. */
  78. public void test_Constructor_LStringLString_1() {
  79. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  80. "MYTESTSTRING", (String) null);
  81. assertNotNull(sQLTimeoutException);
  82. assertNull("The SQLState of SQLTimeoutException should be null",
  83. sQLTimeoutException.getSQLState());
  84. assertEquals(
  85. "The reason of SQLTimeoutException set and get should be equivalent",
  86. "MYTESTSTRING", sQLTimeoutException.getMessage());
  87. assertEquals("The error code of SQLTimeoutException should be 0",
  88. sQLTimeoutException.getErrorCode(), 0);
  89. }
  90. /**
  91. * @test java.sql.SQLTimeoutException(String, String)
  92. */
  93. public void test_Constructor_LStringLString_2() {
  94. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  95. "MYTESTSTRING");
  96. assertNotNull(sQLTimeoutException);
  97. assertEquals(
  98. "The SQLState of SQLTimeoutException set and get should be equivalent",
  99. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  100. assertNull("The reason of SQLTimeoutException should be null",
  101. sQLTimeoutException.getMessage());
  102. assertEquals("The error code of SQLTimeoutException should be 0",
  103. sQLTimeoutException.getErrorCode(), 0);
  104. }
  105. /**
  106. * @test java.sql.SQLTimeoutException(String, String)
  107. */
  108. public void test_Constructor_LStringLString_3() {
  109. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  110. (String) null, (String) null);
  111. assertNotNull(sQLTimeoutException);
  112. assertNull("The SQLState of SQLTimeoutException should be null",
  113. sQLTimeoutException.getSQLState());
  114. assertNull("The reason of SQLTimeoutException should be null",
  115. sQLTimeoutException.getMessage());
  116. assertEquals("The error code of SQLTimeoutException should be 0",
  117. sQLTimeoutException.getErrorCode(), 0);
  118. }
  119. /**
  120. * @test java.sql.SQLTimeoutException(String, String, int)
  121. */
  122. public void test_Constructor_LStringLStringI() {
  123. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  124. "MYTESTSTRING1", "MYTESTSTRING2", 1);
  125. assertNotNull(sQLTimeoutException);
  126. assertEquals(
  127. "The SQLState of SQLTimeoutException set and get should be equivalent",
  128. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  129. assertEquals(
  130. "The reason of SQLTimeoutException set and get should be equivalent",
  131. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  132. assertEquals("The error code of SQLTimeoutException should be 1",
  133. sQLTimeoutException.getErrorCode(), 1);
  134. }
  135. /**
  136. * @test java.sql.SQLTimeoutException(String, String, int)
  137. */
  138. public void test_Constructor_LStringLStringI_1() {
  139. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  140. "MYTESTSTRING1", "MYTESTSTRING2", 0);
  141. assertNotNull(sQLTimeoutException);
  142. assertEquals(
  143. "The SQLState of SQLTimeoutException set and get should be equivalent",
  144. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  145. assertEquals(
  146. "The reason of SQLTimeoutException set and get should be equivalent",
  147. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  148. assertEquals("The error code of SQLTimeoutException should be 0",
  149. sQLTimeoutException.getErrorCode(), 0);
  150. }
  151. /**
  152. * @test java.sql.SQLTimeoutException(String, String, int)
  153. */
  154. public void test_Constructor_LStringLStringI_2() {
  155. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  156. "MYTESTSTRING1", "MYTESTSTRING2", -1);
  157. assertNotNull(sQLTimeoutException);
  158. assertEquals(
  159. "The SQLState of SQLTimeoutException set and get should be equivalent",
  160. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  161. assertEquals(
  162. "The reason of SQLTimeoutException set and get should be equivalent",
  163. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  164. assertEquals("The error code of SQLTimeoutException should be -1",
  165. sQLTimeoutException.getErrorCode(), -1);
  166. }
  167. /**
  168. * @test java.sql.SQLTimeoutException(String, String, int)
  169. */
  170. public void test_Constructor_LStringLStringI_3() {
  171. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  172. "MYTESTSTRING", null, 1);
  173. assertNotNull(sQLTimeoutException);
  174. assertNull("The SQLState of SQLTimeoutException should be null",
  175. sQLTimeoutException.getSQLState());
  176. assertEquals(
  177. "The reason of SQLTimeoutException set and get should be equivalent",
  178. "MYTESTSTRING", sQLTimeoutException.getMessage());
  179. assertEquals("The error code of SQLTimeoutException should be 1",
  180. sQLTimeoutException.getErrorCode(), 1);
  181. }
  182. /**
  183. * @test java.sql.SQLTimeoutException(String, String, int)
  184. */
  185. public void test_Constructor_LStringLStringI_4() {
  186. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  187. "MYTESTSTRING", null, 0);
  188. assertNotNull(sQLTimeoutException);
  189. assertNull("The SQLState of SQLTimeoutException should be null",
  190. sQLTimeoutException.getSQLState());
  191. assertEquals(
  192. "The reason of SQLTimeoutException set and get should be equivalent",
  193. "MYTESTSTRING", sQLTimeoutException.getMessage());
  194. assertEquals("The error code of SQLTimeoutException should be 0",
  195. sQLTimeoutException.getErrorCode(), 0);
  196. }
  197. /**
  198. * @test java.sql.SQLTimeoutException(String, String, int)
  199. */
  200. public void test_Constructor_LStringLStringI_5() {
  201. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  202. "MYTESTSTRING", null, -1);
  203. assertNotNull(sQLTimeoutException);
  204. assertNull("The SQLState of SQLTimeoutException should be null",
  205. sQLTimeoutException.getSQLState());
  206. assertEquals(
  207. "The reason of SQLTimeoutException set and get should be equivalent",
  208. "MYTESTSTRING", sQLTimeoutException.getMessage());
  209. assertEquals("The error code of SQLTimeoutException should be -1",
  210. sQLTimeoutException.getErrorCode(), -1);
  211. }
  212. /**
  213. * @test java.sql.SQLTimeoutException(String, String, int)
  214. */
  215. public void test_Constructor_LStringLStringI_6() {
  216. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  217. "MYTESTSTRING", 1);
  218. assertNotNull(sQLTimeoutException);
  219. assertEquals(
  220. "The SQLState of SQLTimeoutException set and get should be equivalent",
  221. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  222. assertNull("The reason of SQLTimeoutException should be null",
  223. sQLTimeoutException.getMessage());
  224. assertEquals("The error code of SQLTimeoutException should be 1",
  225. sQLTimeoutException.getErrorCode(), 1);
  226. }
  227. /**
  228. * @test java.sql.SQLTimeoutException(String, String, int)
  229. */
  230. public void test_Constructor_LStringLStringI_7() {
  231. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  232. "MYTESTSTRING", 0);
  233. assertNotNull(sQLTimeoutException);
  234. assertEquals(
  235. "The SQLState of SQLTimeoutException set and get should be equivalent",
  236. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  237. assertNull("The reason of SQLTimeoutException should be null",
  238. sQLTimeoutException.getMessage());
  239. assertEquals("The error code of SQLTimeoutException should be 0",
  240. sQLTimeoutException.getErrorCode(), 0);
  241. }
  242. /**
  243. * @test java.sql.SQLTimeoutException(String, String, int)
  244. */
  245. public void test_Constructor_LStringLStringI_8() {
  246. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  247. "MYTESTSTRING", -1);
  248. assertNotNull(sQLTimeoutException);
  249. assertEquals(
  250. "The SQLState of SQLTimeoutException set and get should be equivalent",
  251. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  252. assertNull("The reason of SQLTimeoutException should be null",
  253. sQLTimeoutException.getMessage());
  254. assertEquals("The error code of SQLTimeoutException should be -1",
  255. sQLTimeoutException.getErrorCode(), -1);
  256. }
  257. /**
  258. * @test java.sql.SQLTimeoutException(String, String, int)
  259. */
  260. public void test_Constructor_LStringLStringI_9() {
  261. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  262. null, 1);
  263. assertNotNull(sQLTimeoutException);
  264. assertNull("The SQLState of SQLTimeoutException should be null",
  265. sQLTimeoutException.getSQLState());
  266. assertNull("The reason of SQLTimeoutException should be null",
  267. sQLTimeoutException.getMessage());
  268. assertEquals("The error code of SQLTimeoutException should be 1",
  269. sQLTimeoutException.getErrorCode(), 1);
  270. }
  271. /**
  272. * @test java.sql.SQLTimeoutException(String, String, int)
  273. */
  274. public void test_Constructor_LStringLStringI_10() {
  275. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  276. null, 0);
  277. assertNotNull(sQLTimeoutException);
  278. assertNull("The SQLState of SQLTimeoutException should be null",
  279. sQLTimeoutException.getSQLState());
  280. assertNull("The reason of SQLTimeoutException should be null",
  281. sQLTimeoutException.getMessage());
  282. assertEquals("The error code of SQLTimeoutException should be 0",
  283. sQLTimeoutException.getErrorCode(), 0);
  284. }
  285. /**
  286. * @test java.sql.SQLTimeoutException(String, String, int)
  287. */
  288. public void test_Constructor_LStringLStringI_11() {
  289. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  290. null, -1);
  291. assertNotNull(sQLTimeoutException);
  292. assertNull("The SQLState of SQLTimeoutException should be null",
  293. sQLTimeoutException.getSQLState());
  294. assertNull("The reason of SQLTimeoutException should be null",
  295. sQLTimeoutException.getMessage());
  296. assertEquals("The error code of SQLTimeoutException should be -1",
  297. sQLTimeoutException.getErrorCode(), -1);
  298. }
  299. /**
  300. * @test java.sql.SQLTimeoutException(Throwable)
  301. */
  302. public void test_Constructor_LThrowable() {
  303. Throwable cause = new Exception("MYTHROWABLE");
  304. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(cause);
  305. assertNotNull(sQLTimeoutException);
  306. assertEquals(
  307. "The reason of SQLTimeoutException should be equals to cause.toString()",
  308. "java.lang.Exception: MYTHROWABLE", sQLTimeoutException
  309. .getMessage());
  310. assertNull("The SQLState of SQLTimeoutException should be null",
  311. sQLTimeoutException.getSQLState());
  312. assertEquals("The error code of SQLTimeoutException should be 0",
  313. sQLTimeoutException.getErrorCode(), 0);
  314. assertEquals(
  315. "The cause of SQLTimeoutException set and get should be equivalent",
  316. cause, sQLTimeoutException.getCause());
  317. }
  318. /**
  319. * @test java.sql.SQLTimeoutException(Throwable)
  320. */
  321. public void test_Constructor_LThrowable_1() {
  322. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  323. (Throwable) null);
  324. assertNotNull(sQLTimeoutException);
  325. assertNull("The SQLState of SQLTimeoutException should be null",
  326. sQLTimeoutException.getSQLState());
  327. assertNull("The reason of SQLTimeoutException should be null",
  328. sQLTimeoutException.getMessage());
  329. assertEquals("The error code of SQLTimeoutException should be 0",
  330. sQLTimeoutException.getErrorCode(), 0);
  331. assertNull("The cause of SQLTimeoutException should be null",
  332. sQLTimeoutException.getCause());
  333. }
  334. /**
  335. * @test java.sql.SQLTimeoutException(String, Throwable)
  336. */
  337. public void test_Constructor_LStringLThrowable() {
  338. Throwable cause = new Exception("MYTHROWABLE");
  339. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  340. "MYTESTSTRING", cause);
  341. assertNotNull(sQLTimeoutException);
  342. assertEquals(
  343. "The reason of SQLTimeoutException set and get should be equivalent",
  344. "MYTESTSTRING", sQLTimeoutException.getMessage());
  345. assertNull("The SQLState of SQLTimeoutException should be null",
  346. sQLTimeoutException.getSQLState());
  347. assertEquals("The error code of SQLTimeoutException should be 0",
  348. sQLTimeoutException.getErrorCode(), 0);
  349. assertEquals(
  350. "The cause of SQLTimeoutException set and get should be equivalent",
  351. cause, sQLTimeoutException.getCause());
  352. }
  353. /**
  354. * @test java.sql.SQLTimeoutException(String, Throwable)
  355. */
  356. public void test_Constructor_LStringLThrowable_1() {
  357. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  358. "MYTESTSTRING", (Throwable) null);
  359. assertNotNull(sQLTimeoutException);
  360. assertEquals(
  361. "The reason of SQLTimeoutException set and get should be equivalent",
  362. "MYTESTSTRING", sQLTimeoutException.getMessage());
  363. assertNull("The SQLState of SQLTimeoutException should be null",
  364. sQLTimeoutException.getSQLState());
  365. assertEquals("The error code of SQLTimeoutException should be 0",
  366. sQLTimeoutException.getErrorCode(), 0);
  367. assertNull("The cause of SQLTimeoutException should be null",
  368. sQLTimeoutException.getCause());
  369. }
  370. /**
  371. * @test java.sql.SQLTimeoutException(String, Throwable)
  372. */
  373. public void test_Constructor_LStringLThrowable_2() {
  374. Throwable cause = new Exception("MYTHROWABLE");
  375. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  376. cause);
  377. assertNotNull(sQLTimeoutException);
  378. assertNull("The reason of SQLTimeoutException should be null",
  379. sQLTimeoutException.getMessage());
  380. assertNull("The SQLState of SQLTimeoutException should be null",
  381. sQLTimeoutException.getSQLState());
  382. assertEquals("The error code of SQLTimeoutException should be 0",
  383. sQLTimeoutException.getErrorCode(), 0);
  384. }
  385. /**
  386. * @test java.sql.SQLTimeoutException(String, Throwable)
  387. */
  388. public void test_Constructor_LStringLThrowable_3() {
  389. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  390. (String) null, (Throwable) null);
  391. assertNotNull(sQLTimeoutException);
  392. assertNull("The SQLState of SQLTimeoutException should be null",
  393. sQLTimeoutException.getSQLState());
  394. assertNull("The reason of SQLTimeoutException should be null",
  395. sQLTimeoutException.getMessage());
  396. assertEquals("The error code of SQLTimeoutException should be 0",
  397. sQLTimeoutException.getErrorCode(), 0);
  398. assertNull("The cause of SQLTimeoutException should be null",
  399. sQLTimeoutException.getCause());
  400. }
  401. /**
  402. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  403. */
  404. public void test_Constructor_LStringLStringLThrowable() {
  405. Throwable cause = new Exception("MYTHROWABLE");
  406. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  407. "MYTESTSTRING1", "MYTESTSTRING2", cause);
  408. assertNotNull(sQLTimeoutException);
  409. assertEquals(
  410. "The SQLState of SQLTimeoutException set and get should be equivalent",
  411. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  412. assertEquals(
  413. "The reason of SQLTimeoutException set and get should be equivalent",
  414. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  415. assertEquals("The error code of SQLTimeoutException should be 0",
  416. sQLTimeoutException.getErrorCode(), 0);
  417. assertEquals(
  418. "The cause of SQLTimeoutException set and get should be equivalent",
  419. cause, sQLTimeoutException.getCause());
  420. }
  421. /**
  422. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  423. */
  424. public void test_Constructor_LStringLStringLThrowable_1() {
  425. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  426. "MYTESTSTRING1", "MYTESTSTRING2", null);
  427. assertNotNull(sQLTimeoutException);
  428. assertEquals(
  429. "The SQLState of SQLTimeoutException set and get should be equivalent",
  430. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  431. assertEquals(
  432. "The reason of SQLTimeoutException set and get should be equivalent",
  433. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  434. assertEquals("The error code of SQLTimeoutException should be 0",
  435. sQLTimeoutException.getErrorCode(), 0);
  436. assertNull("The cause of SQLTimeoutException should be null",
  437. sQLTimeoutException.getCause());
  438. }
  439. /**
  440. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  441. */
  442. public void test_Constructor_LStringLStringLThrowable_2() {
  443. Throwable cause = new Exception("MYTHROWABLE");
  444. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  445. "MYTESTSTRING", null, cause);
  446. assertNotNull(sQLTimeoutException);
  447. assertNull("The SQLState of SQLTimeoutException should be null",
  448. sQLTimeoutException.getSQLState());
  449. assertEquals(
  450. "The reason of SQLTimeoutException set and get should be equivalent",
  451. "MYTESTSTRING", sQLTimeoutException.getMessage());
  452. assertEquals("The error code of SQLTimeoutException should be 0",
  453. sQLTimeoutException.getErrorCode(), 0);
  454. assertEquals(
  455. "The cause of SQLTimeoutException set and get should be equivalent",
  456. cause, sQLTimeoutException.getCause());
  457. }
  458. /**
  459. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  460. */
  461. public void test_Constructor_LStringLStringLThrowable_3() {
  462. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  463. "MYTESTSTRING", null, null);
  464. assertNotNull(sQLTimeoutException);
  465. assertNull("The SQLState of SQLTimeoutException should be null",
  466. sQLTimeoutException.getSQLState());
  467. assertEquals(
  468. "The reason of SQLTimeoutException set and get should be equivalent",
  469. "MYTESTSTRING", sQLTimeoutException.getMessage());
  470. assertEquals("The error code of SQLTimeoutException should be 0",
  471. sQLTimeoutException.getErrorCode(), 0);
  472. assertNull("The cause of SQLTimeoutException should be null",
  473. sQLTimeoutException.getCause());
  474. }
  475. /**
  476. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  477. */
  478. public void test_Constructor_LStringLStringLThrowable_4() {
  479. Throwable cause = new Exception("MYTHROWABLE");
  480. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  481. "MYTESTSTRING", cause);
  482. assertNotNull(sQLTimeoutException);
  483. assertEquals(
  484. "The SQLState of SQLTimeoutException set and get should be equivalent",
  485. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  486. assertNull("The reason of SQLTimeoutException should be null",
  487. sQLTimeoutException.getMessage());
  488. assertEquals("The error code of SQLTimeoutException should be 0",
  489. sQLTimeoutException.getErrorCode(), 0);
  490. assertEquals(
  491. "The cause of SQLTimeoutException set and get should be equivalent",
  492. cause, sQLTimeoutException.getCause());
  493. }
  494. /**
  495. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  496. */
  497. public void test_Constructor_LStringLStringLThrowable_5() {
  498. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  499. "MYTESTSTRING", null);
  500. assertNotNull(sQLTimeoutException);
  501. assertEquals(
  502. "The SQLState of SQLTimeoutException set and get should be equivalent",
  503. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  504. assertNull("The reason of SQLTimeoutException should be null",
  505. sQLTimeoutException.getMessage());
  506. assertEquals("The error code of SQLTimeoutException should be 0",
  507. sQLTimeoutException.getErrorCode(), 0);
  508. assertNull("The cause of SQLTimeoutException should be null",
  509. sQLTimeoutException.getCause());
  510. }
  511. /**
  512. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  513. */
  514. public void test_Constructor_LStringLStringLThrowable_6() {
  515. Throwable cause = new Exception("MYTHROWABLE");
  516. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  517. null, cause);
  518. assertNotNull(sQLTimeoutException);
  519. assertNull("The SQLState of SQLTimeoutException should be null",
  520. sQLTimeoutException.getSQLState());
  521. assertNull("The reason of SQLTimeoutException should be null",
  522. sQLTimeoutException.getMessage());
  523. assertEquals("The error code of SQLTimeoutException should be 0",
  524. sQLTimeoutException.getErrorCode(), 0);
  525. assertEquals(
  526. "The cause of SQLTimeoutException set and get should be equivalent",
  527. cause, sQLTimeoutException.getCause());
  528. }
  529. /**
  530. * @test java.sql.SQLTimeoutException(String, String, Throwable)
  531. */
  532. public void test_Constructor_LStringLStringLThrowable_7() {
  533. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  534. null, null);
  535. assertNotNull(sQLTimeoutException);
  536. assertNull("The SQLState of SQLTimeoutException should be null",
  537. sQLTimeoutException.getSQLState());
  538. assertNull("The reason of SQLTimeoutException should be null",
  539. sQLTimeoutException.getMessage());
  540. assertEquals("The error code of SQLTimeoutException should be 0",
  541. sQLTimeoutException.getErrorCode(), 0);
  542. assertNull("The cause of SQLTimeoutException should be null",
  543. sQLTimeoutException.getCause());
  544. }
  545. /**
  546. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  547. */
  548. public void test_Constructor_LStringLStringILThrowable() {
  549. Throwable cause = new Exception("MYTHROWABLE");
  550. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  551. "MYTESTSTRING1", "MYTESTSTRING2", 1, cause);
  552. assertNotNull(sQLTimeoutException);
  553. assertEquals(
  554. "The SQLState of SQLTimeoutException set and get should be equivalent",
  555. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  556. assertEquals(
  557. "The reason of SQLTimeoutException set and get should be equivalent",
  558. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  559. assertEquals("The error code of SQLTimeoutException should be 1",
  560. sQLTimeoutException.getErrorCode(), 1);
  561. assertEquals(
  562. "The cause of SQLTimeoutException set and get should be equivalent",
  563. cause, sQLTimeoutException.getCause());
  564. }
  565. /**
  566. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  567. */
  568. public void test_Constructor_LStringLStringILThrowable_1() {
  569. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  570. "MYTESTSTRING1", "MYTESTSTRING2", 1, null);
  571. assertNotNull(sQLTimeoutException);
  572. assertEquals(
  573. "The SQLState of SQLTimeoutException set and get should be equivalent",
  574. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  575. assertEquals(
  576. "The reason of SQLTimeoutException set and get should be equivalent",
  577. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  578. assertEquals("The error code of SQLTimeoutException should be 1",
  579. sQLTimeoutException.getErrorCode(), 1);
  580. assertNull("The cause of SQLTimeoutException should be null",
  581. sQLTimeoutException.getCause());
  582. }
  583. /**
  584. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  585. */
  586. public void test_Constructor_LStringLStringILThrowable_2() {
  587. Throwable cause = new Exception("MYTHROWABLE");
  588. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  589. "MYTESTSTRING1", "MYTESTSTRING2", 0, cause);
  590. assertNotNull(sQLTimeoutException);
  591. assertEquals(
  592. "The SQLState of SQLTimeoutException set and get should be equivalent",
  593. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  594. assertEquals(
  595. "The reason of SQLTimeoutException set and get should be equivalent",
  596. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  597. assertEquals("The error code of SQLTimeoutException should be 0",
  598. sQLTimeoutException.getErrorCode(), 0);
  599. assertEquals(
  600. "The cause of SQLTimeoutException set and get should be equivalent",
  601. cause, sQLTimeoutException.getCause());
  602. }
  603. /**
  604. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  605. */
  606. public void test_Constructor_LStringLStringILThrowable_3() {
  607. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  608. "MYTESTSTRING1", "MYTESTSTRING2", 0, null);
  609. assertNotNull(sQLTimeoutException);
  610. assertEquals(
  611. "The SQLState of SQLTimeoutException set and get should be equivalent",
  612. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  613. assertEquals(
  614. "The reason of SQLTimeoutException set and get should be equivalent",
  615. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  616. assertEquals("The error code of SQLTimeoutException should be 0",
  617. sQLTimeoutException.getErrorCode(), 0);
  618. assertNull("The cause of SQLTimeoutException should be null",
  619. sQLTimeoutException.getCause());
  620. }
  621. /**
  622. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  623. */
  624. public void test_Constructor_LStringLStringILThrowable_4() {
  625. Throwable cause = new Exception("MYTHROWABLE");
  626. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  627. "MYTESTSTRING1", "MYTESTSTRING2", -1, cause);
  628. assertNotNull(sQLTimeoutException);
  629. assertEquals(
  630. "The SQLState of SQLTimeoutException set and get should be equivalent",
  631. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  632. assertEquals(
  633. "The reason of SQLTimeoutException set and get should be equivalent",
  634. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  635. assertEquals("The error code of SQLTimeoutException should be -1",
  636. sQLTimeoutException.getErrorCode(), -1);
  637. assertEquals(
  638. "The cause of SQLTimeoutException set and get should be equivalent",
  639. cause, sQLTimeoutException.getCause());
  640. }
  641. /**
  642. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  643. */
  644. public void test_Constructor_LStringLStringILThrowable_5() {
  645. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  646. "MYTESTSTRING1", "MYTESTSTRING2", -1, null);
  647. assertNotNull(sQLTimeoutException);
  648. assertEquals(
  649. "The SQLState of SQLTimeoutException set and get should be equivalent",
  650. "MYTESTSTRING2", sQLTimeoutException.getSQLState());
  651. assertEquals(
  652. "The reason of SQLTimeoutException set and get should be equivalent",
  653. "MYTESTSTRING1", sQLTimeoutException.getMessage());
  654. assertEquals("The error code of SQLTimeoutException should be -1",
  655. sQLTimeoutException.getErrorCode(), -1);
  656. assertNull("The cause of SQLTimeoutException should be null",
  657. sQLTimeoutException.getCause());
  658. }
  659. /**
  660. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  661. */
  662. public void test_Constructor_LStringLStringILThrowable_6() {
  663. Throwable cause = new Exception("MYTHROWABLE");
  664. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  665. "MYTESTSTRING", null, 1, cause);
  666. assertNotNull(sQLTimeoutException);
  667. assertNull("The SQLState of SQLTimeoutException should be null",
  668. sQLTimeoutException.getSQLState());
  669. assertEquals(
  670. "The reason of SQLTimeoutException set and get should be equivalent",
  671. "MYTESTSTRING", sQLTimeoutException.getMessage());
  672. assertEquals("The error code of SQLTimeoutException should be 1",
  673. sQLTimeoutException.getErrorCode(), 1);
  674. assertEquals(
  675. "The cause of SQLTimeoutException set and get should be equivalent",
  676. cause, sQLTimeoutException.getCause());
  677. }
  678. /**
  679. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  680. */
  681. public void test_Constructor_LStringLStringILThrowable_7() {
  682. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  683. "MYTESTSTRING", null, 1, null);
  684. assertNotNull(sQLTimeoutException);
  685. assertNotNull(sQLTimeoutException);
  686. assertNull("The SQLState of SQLTimeoutException should be null",
  687. sQLTimeoutException.getSQLState());
  688. assertEquals(
  689. "The reason of SQLTimeoutException set and get should be equivalent",
  690. "MYTESTSTRING", sQLTimeoutException.getMessage());
  691. assertEquals("The error code of SQLTimeoutException should be 1",
  692. sQLTimeoutException.getErrorCode(), 1);
  693. assertNull("The cause of SQLTimeoutException should be null",
  694. sQLTimeoutException.getCause());
  695. }
  696. /**
  697. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  698. */
  699. public void test_Constructor_LStringLStringILThrowable_8() {
  700. Throwable cause = new Exception("MYTHROWABLE");
  701. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  702. "MYTESTSTRING", null, 0, cause);
  703. assertNotNull(sQLTimeoutException);
  704. assertNull("The SQLState of SQLTimeoutException should be null",
  705. sQLTimeoutException.getSQLState());
  706. assertEquals(
  707. "The reason of SQLTimeoutException set and get should be equivalent",
  708. "MYTESTSTRING", sQLTimeoutException.getMessage());
  709. assertEquals("The error code of SQLTimeoutException should be 0",
  710. sQLTimeoutException.getErrorCode(), 0);
  711. assertEquals(
  712. "The cause of SQLTimeoutException set and get should be equivalent",
  713. cause, sQLTimeoutException.getCause());
  714. }
  715. /**
  716. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  717. */
  718. public void test_Constructor_LStringLStringILThrowable_9() {
  719. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  720. "MYTESTSTRING", null, 0, null);
  721. assertNotNull(sQLTimeoutException);
  722. assertNull("The SQLState of SQLTimeoutException should be null",
  723. sQLTimeoutException.getSQLState());
  724. assertEquals(
  725. "The reason of SQLTimeoutException set and get should be equivalent",
  726. "MYTESTSTRING", sQLTimeoutException.getMessage());
  727. assertEquals("The error code of SQLTimeoutException should be 0",
  728. sQLTimeoutException.getErrorCode(), 0);
  729. assertNull("The cause of SQLTimeoutException should be null",
  730. sQLTimeoutException.getCause());
  731. }
  732. /**
  733. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  734. */
  735. public void test_Constructor_LStringLStringILThrowable_10() {
  736. Throwable cause = new Exception("MYTHROWABLE");
  737. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  738. "MYTESTSTRING", null, -1, cause);
  739. assertNotNull(sQLTimeoutException);
  740. assertNull("The SQLState of SQLTimeoutException should be null",
  741. sQLTimeoutException.getSQLState());
  742. assertEquals(
  743. "The reason of SQLTimeoutException set and get should be equivalent",
  744. "MYTESTSTRING", sQLTimeoutException.getMessage());
  745. assertEquals("The error code of SQLTimeoutException should be -1",
  746. sQLTimeoutException.getErrorCode(), -1);
  747. assertEquals(
  748. "The cause of SQLTimeoutException set and get should be equivalent",
  749. cause, sQLTimeoutException.getCause());
  750. }
  751. /**
  752. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  753. */
  754. public void test_Constructor_LStringLStringILThrowable_11() {
  755. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
  756. "MYTESTSTRING", null, -1, null);
  757. assertNotNull(sQLTimeoutException);
  758. assertNull("The SQLState of SQLTimeoutException should be null",
  759. sQLTimeoutException.getSQLState());
  760. assertEquals(
  761. "The reason of SQLTimeoutException set and get should be equivalent",
  762. "MYTESTSTRING", sQLTimeoutException.getMessage());
  763. assertEquals("The error code of SQLTimeoutException should be -1",
  764. sQLTimeoutException.getErrorCode(), -1);
  765. assertNull("The cause of SQLTimeoutException should be null",
  766. sQLTimeoutException.getCause());
  767. }
  768. /**
  769. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  770. */
  771. public void test_Constructor_LStringLStringILThrowable_12() {
  772. Throwable cause = new Exception("MYTHROWABLE");
  773. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  774. "MYTESTSTRING", 1, cause);
  775. assertNotNull(sQLTimeoutException);
  776. assertEquals(
  777. "The SQLState of SQLTimeoutException set and get should be equivalent",
  778. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  779. assertNull("The reason of SQLTimeoutException should be null",
  780. sQLTimeoutException.getMessage());
  781. assertEquals("The error code of SQLTimeoutException should be 1",
  782. sQLTimeoutException.getErrorCode(), 1);
  783. assertEquals(
  784. "The cause of SQLTimeoutException set and get should be equivalent",
  785. cause, sQLTimeoutException.getCause());
  786. }
  787. /**
  788. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  789. */
  790. public void test_Constructor_LStringLStringILThrowable_13() {
  791. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  792. "MYTESTSTRING", 1, null);
  793. assertNotNull(sQLTimeoutException);
  794. assertEquals(
  795. "The SQLState of SQLTimeoutException set and get should be equivalent",
  796. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  797. assertNull("The reason of SQLTimeoutException should be null",
  798. sQLTimeoutException.getMessage());
  799. assertEquals("The error code of SQLTimeoutException should be 1",
  800. sQLTimeoutException.getErrorCode(), 1);
  801. assertNull("The cause of SQLTimeoutException should be null",
  802. sQLTimeoutException.getCause());
  803. }
  804. /**
  805. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  806. */
  807. public void test_Constructor_LStringLStringILThrowable_14() {
  808. Throwable cause = new Exception("MYTHROWABLE");
  809. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  810. "MYTESTSTRING", 0, cause);
  811. assertNotNull(sQLTimeoutException);
  812. assertEquals(
  813. "The SQLState of SQLTimeoutException set and get should be equivalent",
  814. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  815. assertNull("The reason of SQLTimeoutException should be null",
  816. sQLTimeoutException.getMessage());
  817. assertEquals("The error code of SQLTimeoutException should be 0",
  818. sQLTimeoutException.getErrorCode(), 0);
  819. assertEquals(
  820. "The cause of SQLTimeoutException set and get should be equivalent",
  821. cause, sQLTimeoutException.getCause());
  822. }
  823. /**
  824. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  825. */
  826. public void test_Constructor_LStringLStringILThrowable_15() {
  827. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  828. "MYTESTSTRING", 0, null);
  829. assertNotNull(sQLTimeoutException);
  830. assertEquals(
  831. "The SQLState of SQLTimeoutException set and get should be equivalent",
  832. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  833. assertNull("The reason of SQLTimeoutException should be null",
  834. sQLTimeoutException.getMessage());
  835. assertEquals("The error code of SQLTimeoutException should be 0",
  836. sQLTimeoutException.getErrorCode(), 0);
  837. assertNull("The cause of SQLTimeoutException should be null",
  838. sQLTimeoutException.getCause());
  839. }
  840. /**
  841. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  842. */
  843. public void test_Constructor_LStringLStringILThrowable_16() {
  844. Throwable cause = new Exception("MYTHROWABLE");
  845. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  846. "MYTESTSTRING", -1, cause);
  847. assertNotNull(sQLTimeoutException);
  848. assertEquals(
  849. "The SQLState of SQLTimeoutException set and get should be equivalent",
  850. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  851. assertNull("The reason of SQLTimeoutException should be null",
  852. sQLTimeoutException.getMessage());
  853. assertEquals("The error code of SQLTimeoutException should be -1",
  854. sQLTimeoutException.getErrorCode(), -1);
  855. assertEquals(
  856. "The cause of SQLTimeoutException set and get should be equivalent",
  857. cause, sQLTimeoutException.getCause());
  858. }
  859. /**
  860. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  861. */
  862. public void test_Constructor_LStringLStringILThrowable_17() {
  863. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  864. "MYTESTSTRING", -1, null);
  865. assertNotNull(sQLTimeoutException);
  866. assertEquals(
  867. "The SQLState of SQLTimeoutException set and get should be equivalent",
  868. "MYTESTSTRING", sQLTimeoutException.getSQLState());
  869. assertNull("The reason of SQLTimeoutException should be null",
  870. sQLTimeoutException.getMessage());
  871. assertEquals("The error code of SQLTimeoutException should be -1",
  872. sQLTimeoutException.getErrorCode(), -1);
  873. assertNull("The cause of SQLTimeoutException should be null",
  874. sQLTimeoutException.getCause());
  875. }
  876. /**
  877. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  878. */
  879. public void test_Constructor_LStringLStringILThrowable_18() {
  880. Throwable cause = new Exception("MYTHROWABLE");
  881. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  882. null, 1, cause);
  883. assertNotNull(sQLTimeoutException);
  884. assertNull("The SQLState of SQLTimeoutException should be null",
  885. sQLTimeoutException.getSQLState());
  886. assertNull("The reason of SQLTimeoutException should be null",
  887. sQLTimeoutException.getMessage());
  888. assertEquals("The error code of SQLTimeoutException should be 1",
  889. sQLTimeoutException.getErrorCode(), 1);
  890. assertEquals(
  891. "The cause of SQLTimeoutException set and get should be equivalent",
  892. cause, sQLTimeoutException.getCause());
  893. }
  894. /**
  895. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  896. */
  897. public void test_Constructor_LStringLStringILThrowable_19() {
  898. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  899. null, 1, null);
  900. assertNotNull(sQLTimeoutException);
  901. assertNull("The SQLState of SQLTimeoutException should be null",
  902. sQLTimeoutException.getSQLState());
  903. assertNull("The reason of SQLTimeoutException should be null",
  904. sQLTimeoutException.getMessage());
  905. assertEquals("The error code of SQLTimeoutException should be 1",
  906. sQLTimeoutException.getErrorCode(), 1);
  907. assertNull("The cause of SQLTimeoutException should be null",
  908. sQLTimeoutException.getCause());
  909. }
  910. /**
  911. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  912. */
  913. public void test_Constructor_LStringLStringILThrowable_20() {
  914. Throwable cause = new Exception("MYTHROWABLE");
  915. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  916. null, 0, cause);
  917. assertNotNull(sQLTimeoutException);
  918. assertNull("The SQLState of SQLTimeoutException should be null",
  919. sQLTimeoutException.getSQLState());
  920. assertNull("The reason of SQLTimeoutException should be null",
  921. sQLTimeoutException.getMessage());
  922. assertEquals("The error code of SQLTimeoutException should be 0",
  923. sQLTimeoutException.getErrorCode(), 0);
  924. assertEquals(
  925. "The cause of SQLTimeoutException set and get should be equivalent",
  926. cause, sQLTimeoutException.getCause());
  927. }
  928. /**
  929. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  930. */
  931. public void test_Constructor_LStringLStringILThrowable_21() {
  932. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  933. null, 0, null);
  934. assertNotNull(sQLTimeoutException);
  935. assertNull("The SQLState of SQLTimeoutException should be null",
  936. sQLTimeoutException.getSQLState());
  937. assertNull("The reason of SQLTimeoutException should be null",
  938. sQLTimeoutException.getMessage());
  939. assertEquals("The error code of SQLTimeoutException should be 0",
  940. sQLTimeoutException.getErrorCode(), 0);
  941. assertNull("The cause of SQLTimeoutException should be null",
  942. sQLTimeoutException.getCause());
  943. }
  944. /**
  945. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  946. */
  947. public void test_Constructor_LStringLStringILThrowable_22() {
  948. Throwable cause = new Exception("MYTHROWABLE");
  949. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  950. null, -1, cause);
  951. assertNotNull(sQLTimeoutException);
  952. assertNull("The SQLState of SQLTimeoutException should be null",
  953. sQLTimeoutException.getSQLState());
  954. assertNull("The reason of SQLTimeoutException should be null",
  955. sQLTimeoutException.getMessage());
  956. assertEquals("The error code of SQLTimeoutException should be -1",
  957. sQLTimeoutException.getErrorCode(), -1);
  958. assertEquals(
  959. "The cause of SQLTimeoutException set and get should be equivalent",
  960. cause, sQLTimeoutException.getCause());
  961. }
  962. /**
  963. * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
  964. */
  965. public void test_Constructor_LStringLStringILThrowable_23() {
  966. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(null,
  967. null, -1, null);
  968. assertNotNull(sQLTimeoutException);
  969. assertNull("The SQLState of SQLTimeoutException should be null",
  970. sQLTimeoutException.getSQLState());
  971. assertNull("The reason of SQLTimeoutException should be null",
  972. sQLTimeoutException.getMessage());
  973. assertEquals("The error code of SQLTimeoutException should be -1",
  974. sQLTimeoutException.getErrorCode(), -1);
  975. assertNull("The cause of SQLTimeoutException should be null",
  976. sQLTimeoutException.getCause());
  977. }
  978. /**
  979. * @test java.sql.SQLTimeoutException()
  980. */
  981. public void test_Constructor() {
  982. SQLTimeoutException sQLTimeoutException = new SQLTimeoutException();
  983. assertNotNull(sQLTimeoutException);
  984. assertNull("The SQLState of SQLTimeoutException should be null",
  985. sQLTimeoutException.getSQLState());
  986. assertNull("The reason of SQLTimeoutException should be null",
  987. sQLTimeoutException.getMessage());
  988. assertEquals("The error code of SQLTimeoutException should be 0",
  989. sQLTimeoutException.getErrorCode(), 0);
  990. }
  991. /**
  992. * @test serialization/deserialization compatibility.
  993. */
  994. public void test_serialization() throws Exception {
  995. Serializati