From: Georgios Gousios Date: Tue, 10 Jan 2012 15:40:49 +0000 (+0200) Subject: Simple test to try serialization of the complex user state class X-Git-Tag: aquarium-0.1~47 X-Git-Url: https://code.grnet.gr/git/aquarium/commitdiff_plain/d51f30e2bc8edcdc91eb8f35eaca29c2a65ed122 Simple test to try serialization of the complex user state class --- diff --git a/src/test/scala/gr/grnet/aquarium/user/UserActorTest.scala b/src/test/scala/gr/grnet/aquarium/user/UserActorTest.scala new file mode 100644 index 0000000..1302368 --- /dev/null +++ b/src/test/scala/gr/grnet/aquarium/user/UserActorTest.scala @@ -0,0 +1,33 @@ +package gr.grnet.aquarium.user + +import gr.grnet.aquarium.logic.test.DSLTest +import gr.grnet.aquarium.logic.accounting.Policy +import org.junit.Test + +/** + * + * @author Georgios Gousios + */ + +class UserActorTest extends DSLTest { + + @Test + def testUserStateSerialization = { + before + val now = System.currentTimeMillis() + val state = UserState( + "1", + ActiveSuspendedSnapshot(true, now), + CreditSnapshot(0, now), + AgreementSnapshot("default", now), + RolesSnapshot(Nil, now), + PaymentOrdersSnapshot(Nil, now), + OwnedGroupsSnapshot(Nil, now), + GroupMembershipsSnapshot(Nil, now), + OwnedResourcesSnapshot(Map(("foo", "1") -> (0F, 0L)), now) + ) + + println(state.toJson) + assertNotThrows(state.toJson) + } +} \ No newline at end of file