List:Commits« Previous MessageNext Message »
From:tikeda Date:January 25 2006 10:49pm
Subject:Connector/J commit: r4852 - branches/branch_5_1/connector-j/src/testsuite/simple
View as plain text  
Modified:
   branches/branch_5_1/connector-j/src/testsuite/simple/StatementsTest.java
Log:
upgraded setNString stuffs

Modified: branches/branch_5_1/connector-j/src/testsuite/simple/StatementsTest.java
===================================================================
--- branches/branch_5_1/connector-j/src/testsuite/simple/StatementsTest.java	2006-01-25 22:46:17 UTC (rev 4851)
+++ branches/branch_5_1/connector-j/src/testsuite/simple/StatementsTest.java	2006-01-25 22:49:15 UTC (rev 4852)
@@ -1435,13 +1435,13 @@
             conn1.prepareStatement("INSERT INTO testSetNString (c1) VALUES (?)");
         pstmt1.setNString(1, "aaa");
         pstmt1.execute();
-        pstmt1.setNString(1, "\'aaa");
+        pstmt1.setNString(1, "\'aaa\'");
         pstmt1.execute();
         ResultSet rs1 = this.stmt.executeQuery("SELECT c1 FROM testSetNString");
         rs1.next();
         assertEquals("aaa", rs1.getString(1));
         rs1.next();
-        assertEquals("\'aaa", rs1.getString(1));
+        assertEquals("\'aaa\'", rs1.getString(1));
         rs1.close();
         pstmt1.close();
         conn1.close();
@@ -1456,13 +1456,13 @@
             conn2.prepareStatement("INSERT INTO testSetNString (c1) VALUES (?)");
         pstmt2.setNString(1, "aaa");
         pstmt2.execute();
-        pstmt2.setNString(1, "\'aaa");
+        pstmt2.setNString(1, "\'aaa\'");
         pstmt2.execute();
         ResultSet rs2 = this.stmt.executeQuery("SELECT c1 FROM testSetNString");
         rs2.next();
         assertEquals("aaa", rs2.getString(1));
         rs2.next();
-        assertEquals("\'aaa", rs2.getString(1));
+        assertEquals("\'aaa\'", rs2.getString(1));
         rs2.close();
         pstmt2.close();
         conn2.close();
@@ -1487,6 +1487,8 @@
             fail();
         } catch (SQLException e) {
             // ok
+            assertEquals("Can not call setNString() when connection character set isn't UTF-8",
+                e.getMessage());  
         }
         pstmt1.close();
         conn1.close();
@@ -1501,13 +1503,13 @@
             conn2.prepareStatement("INSERT INTO testSetNStringServer (c1) VALUES (?)");
         pstmt2.setNString(1, "aaa");
         pstmt2.execute();
-        pstmt2.setNString(1, "\'aaa");
+        pstmt2.setNString(1, "\'aaa\'");
         pstmt2.execute();
         ResultSet rs2 = this.stmt.executeQuery("SELECT c1 FROM testSetNStringServer");
         rs2.next();
         assertEquals("aaa", rs2.getString(1));
         rs2.next();
-        assertEquals("\'aaa", rs2.getString(1));
+        assertEquals("\'aaa\'", rs2.getString(1));
         rs2.close();
         pstmt2.close();
         conn2.close();

Thread
Connector/J commit: r4852 - branches/branch_5_1/connector-j/src/testsuite/simpletikeda25 Jan