Skip to content

Commit

Permalink
Fix | Use formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-ye committed Jan 23, 2019
1 parent a5f8315 commit bcc8e03
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.DateFormatSymbols;
import java.text.MessageFormat;
import java.util.Calendar;
import java.util.EnumSet;
Expand Down Expand Up @@ -1095,7 +1096,6 @@ public void testCallableStatementGetters() throws Exception {
@Test
public void testResultSetMetaData() throws Exception {
try (Connection conn = DriverManager.getConnection(connectionString)) {
TestValue v[] = TestValue.values();
for (TestValue value : TestValue.values())
value.sqlValue.verifyResultSetMetaData(conn);
}
Expand Down Expand Up @@ -1385,9 +1385,11 @@ public void testWithThaiLocale() throws Exception {
* Timestamp returned from varchar column may be wrongly formatted. E.g: 12:12PM will not pass if
* compared to 12:12p.m.
*/
String recievedTimePortion = rs.getString(1).substring(rs.getString(1).length() - 7).trim()
.replaceAll("\\.", "");
String expectedTimePortion = timeFormat.format(ts.getTime()).trim().replaceAll("\\.", "");
DateFormatSymbols symbols = new DateFormatSymbols(Locale.getDefault());
symbols.setAmPmStrings(new String[] {"am", "pm"});
timeFormat.setDateFormatSymbols(symbols);
String expectedTimePortion = timeFormat.format(ts);
String recievedTimePortion = rs.getString(1).substring(rs.getString(1).length() - 7).trim();
assertTrue(
"Timestamp mismatch, expected: " + expectedTimePortion + " but recieved: "
+ recievedTimePortion + ".",
Expand Down

0 comments on commit bcc8e03

Please sign in to comment.