Permalink
Browse files

Added test for Enum

  • Loading branch information...
1 parent 10538e6 commit 7621c122f4fa31232d8a1b2489e2f65eed6b93ba @dan-g dan-g committed Apr 29, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 src/test/java/net/kotek/jdbm/SerializationTest.java
@@ -409,6 +409,26 @@ public void testLocale() throws Exception{
}
+ enum Order
+ {
+ ASCENDING,
+ DESCENDING
+ }
+ public void testEnum() throws Exception{
+ Order o = Order.ASCENDING;
+ o = (Order) ser.deserialize(ser.serialize(o));
+ assertEquals(o,Order.ASCENDING );
+ assertEquals(o.ordinal(),Order.ASCENDING .ordinal());
+ assertEquals(o.name(),Order.ASCENDING .name());
+
+ o = Order.DESCENDING;
+ o = (Order) ser.deserialize(ser.serialize(o));
+ assertEquals(o,Order.DESCENDING );
+ assertEquals(o.ordinal(),Order.DESCENDING .ordinal());
+ assertEquals(o.name(),Order.DESCENDING .name());
+
+ }
+
}

0 comments on commit 7621c12

Please sign in to comment.