improved postgresql support

This commit is contained in:
wenshao
2014-12-08 23:47:20 +08:00
parent aaccb63c33
commit fbb27230e1
2 changed files with 22 additions and 1 deletions
@@ -0,0 +1,21 @@
package com.alibaba.druid.bvt.pool.vendor;
import org.junit.Assert;
import org.postgresql.util.GT;
import org.postgresql.util.PSQLException;
import org.postgresql.util.PSQLState;
import junit.framework.TestCase;
import com.alibaba.druid.pool.vendor.PGExceptionSorter;
public class PGExceptionSorterTest extends TestCase {
public void test_pg() throws Exception {
PGExceptionSorter exSorter = new PGExceptionSorter();
PSQLException ex = new PSQLException(GT.tr("Expected an EOF from server, got: {0}", new Integer(0)),
PSQLState.COMMUNICATION_ERROR);
Assert.assertTrue(exSorter.isExceptionFatal(ex));
}
}