* Tests for persistence of various non-standard Java types
*/
public class JDOTypesTest extends JDOTestCase {
public void testTypes1() {
HasExtraTypes1JDO holder = new HasExtraTypes1JDO();
holder.setCurrency(Currency.getInstance("GBP"));
holder.setLocale(Locale.ENGLISH);
holder.setStringBuffer(new StringBuffer("sausages"));
holder.setTimezone(TimeZone.getTimeZone("GMT"));
beginTxn();
pm.makePersistent(holder);
commitTxn();
Object id = pm.getObjectId(holder);
pm.evictAll();
beginTxn();
HasExtraTypes1JDO extra = (HasExtraTypes1JDO)pm.getObjectById(id);
assertEquals("GBP", extra.getCurrency().getCurrencyCode());
assertEquals("en", extra.getLocale().toString());
assertEquals("sausages", extra.getStringBuffer().toString());
assertEquals("GMT", extra.getTimezone().getID());
commitTxn();
}