Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Sep 19, 2019
1 parent 8b251cb commit 488107e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/test/java/com/alibaba/json/bvt/SqlDateTest1.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ public void test_date() throws Exception {
JSON.toJSONStringWithDateFormat(date, "yyyy-MM-dd HH:mm:ss.SSS",
SerializerFeature.UseSingleQuotes));
}

public void test_date2() throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date d = sdf.parse("2019-09-12 16:00:00");
java.sql.Date ds = new java.sql.Date(d.getTime());
// System.out.println("Java Obj: " + sdf.format(ds));

String jvs = JSON.toJSONString(ds);
// System.out.println("JSON Str: " + jvs);

java.sql.Date d2s = JSON.parseObject(jvs, java.sql.Date.class);
// System.out.println("Java Obj: " + sdf.format(d2s));
// System.out.println("LONG: " + d2s.getTime());

assertEquals(d.getTime(), d2s.getTime());
}
//
// public void test_date2() throws Exception {
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// java.util.Date d = sdf.parse("2019-09-12 16:00:00");
// java.sql.Date ds = new java.sql.Date(d.getTime());
//// System.out.println("Java Obj: " + sdf.format(ds));
//
// String jvs = JSON.toJSONString(ds);
//// System.out.println("JSON Str: " + jvs);
//
// java.sql.Date d2s = JSON.parseObject(jvs, java.sql.Date.class);
//// System.out.println("Java Obj: " + sdf.format(d2s));
//// System.out.println("LONG: " + d2s.getTime());
//
// assertEquals(d.getTime(), d2s.getTime());
// }
}

0 comments on commit 488107e

Please sign in to comment.