test to reproduce issue 87

This commit is contained in:
Inderjeet Singh 2008-12-31 00:43:40 +00:00
parent 3690d362b9
commit 6fe2fdf7a0

View File

@ -24,6 +24,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import java.util.Properties;
import java.util.Set;
import java.util.UUID;
@ -258,4 +259,17 @@ public class DefaultTypeAdaptersTest extends TestCase {
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"));
}
}