test to reproduce issue 87
This commit is contained in:
parent
3690d362b9
commit
6fe2fdf7a0
|
@ -24,6 +24,7 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -258,4 +259,17 @@ public class DefaultTypeAdaptersTest extends TestCase {
|
||||||
return "{\"value\":" + value + "}";
|
return "{\"value\":" + value + "}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testPropertiesSerialization() {
|
||||||
|
Properties props = new Properties();
|
||||||
|
props.put("foo", "bar");
|
||||||
|
String json = gson.toJson(props);
|
||||||
|
System.out.println(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testPropertiesDeserialization() {
|
||||||
|
String json = "{foo:'bar'}";
|
||||||
|
Properties props = gson.fromJson(json, Properties.class);
|
||||||
|
assertEquals("bar", props.get("foo"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user