处理字符集测试用例报错问题

This commit is contained in:
zhangting
2024-05-10 16:07:55 +08:00
parent 8ad6d74015
commit 521ae5bc81

View File

@ -4,6 +4,7 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.postgresql.test.TestUtil; import org.postgresql.test.TestUtil;
import org.postgresql.test.jdbc2.BaseTest4;
import java.sql.*; import java.sql.*;
import java.util.Properties; import java.util.Properties;
@ -11,21 +12,15 @@ import java.util.Properties;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
public class EncodingTest { public class EncodingTest extends BaseTest4 {
private Connection con;
@After
public void tearDown() throws Exception {
TestUtil.closeDB(con);
}
/* /*
* Tests encoding change * Tests encoding change
*/ */
@Test @Test
public void testEncodingChange() throws Exception { public void testEncodingChange() throws Exception {
Properties properties = new Properties(); Properties properties = new Properties();
properties.put("preferQueryMode", "simple");
properties.put("allowEncodingChanges", "true");
properties.put("characterEncoding", "SQL_ASCII"); properties.put("characterEncoding", "SQL_ASCII");
con = TestUtil.openDB(properties); con = TestUtil.openDB(properties);