* @author Max Ross <maxr@google.com>
*/
public class JDOEnumTest extends JDOTestCase {
public void testRoundtrip() {
HasEnumJDO pojo = new HasEnumJDO();
pojo.setMyEnum(V1);
pojo.setMyEnumArray(new MyEnum[] {V2, V1, V2});
pojo.setMyEnumList(Utils.newArrayList(V1, V2, V1));
beginTxn();
pm.makePersistent(pojo);
commitTxn();
beginTxn();
pojo = pm.getObjectById(HasEnumJDO.class, pojo.getKey());
assertEquals(HasEnumJDO.MyEnum.V1, pojo.getMyEnum());
assertTrue(Arrays.equals(new MyEnum[] {V2, V1, V2 }, pojo.getMyEnumArray()));
assertEquals(Utils.newArrayList(V1, V2, V1), pojo.getMyEnumList());
commitTxn();
}