mirror of
https://github.com/stleary/JSON-java.git
synced 2026-05-18 00:00:50 -04:00
Limiting implemetation by removing the new classes.
This commit is contained in:
@@ -36,7 +36,6 @@ import org.json.JSONString;
|
||||
import org.json.JSONTokener;
|
||||
import org.json.ParserConfiguration;
|
||||
import org.json.XML;
|
||||
import org.json.TypeConverter;
|
||||
import org.json.junit.data.BrokenToString;
|
||||
import org.json.junit.data.ExceptionalBean;
|
||||
import org.json.junit.data.Fraction;
|
||||
@@ -4121,17 +4120,13 @@ public class JSONObjectTest {
|
||||
|
||||
@Test
|
||||
public void jsonObjectParseFromJson_1() {
|
||||
JSONObject object = new JSONObject();
|
||||
object.setClassMapping(java.time.LocalDateTime.class, new TypeConverter<java.time.LocalDateTime>() {
|
||||
public java.time.LocalDateTime convert(Object input) {
|
||||
return java.time.LocalDateTime.parse((String) input);
|
||||
}
|
||||
});
|
||||
java.time.LocalDateTime localDateTime = java.time.LocalDateTime.now();
|
||||
object.put("localDate", localDateTime.toString());
|
||||
CustomClassA customClassA = object.fromJson(CustomClassA.class);
|
||||
CustomClassA compareClassClassA = new CustomClassA(localDateTime);
|
||||
assertEquals(customClassA, compareClassClassA);
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
BigInteger largeInt = new BigInteger("123");
|
||||
object.put("largeInt", largeInt.toString());
|
||||
CustomClassA customClassA = object.fromJson(CustomClassA.class);
|
||||
CustomClassA compareClassClassA = new CustomClassA(largeInt);
|
||||
assertEquals(customClassA, compareClassClassA);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user