Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite77708d

Browse files
author
Dave Cramer
committed
patch to make sure PSQLState is Serializable and a test case to prove it
1 parent6717306 commite77708d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

‎src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
importorg.postgresql.test.TestUtil;
44
importjunit.framework.TestCase;
55
importjava.sql.*;
6+
importjava.io.*;
67

78
/*
8-
* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java,v 1.11 2003/11/29 22:41:23 pgsql Exp $
9+
* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java,v 1.12 2003/12/11 15:11:43 davec Exp $
910
*
1011
* Some simple tests based on problems reported by users. Hopefully these will
1112
* help prevent previous problems from re-occuring ;-)
@@ -65,8 +66,18 @@ public void testError()
6566
fail("Should not execute this, as a SQLException s/b thrown" );
6667
con.commit();
6768
}
68-
catch (Exceptionex )
69-
{}
69+
catch (SQLExceptionex )
70+
{
71+
// Verify that the SQLException is serializable.
72+
try {
73+
ByteArrayOutputStreambaos =newByteArrayOutputStream();
74+
ObjectOutputStreamoos =newObjectOutputStream(baos);
75+
oos.writeObject(ex);
76+
oos.close();
77+
}catch (IOExceptionioe) {
78+
fail(ioe.getMessage());
79+
}
80+
}
7081
try
7182
{
7283
con.commit();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp