/** * Tests that the Hibernate {@link PersistentSet} can be serialized, but in way that * deserialized class will be java set and but not {@link PersistentSet}. * * @throws SerializationException * SerializationException */ @Test public void hibernatePersistentSet() throws SerializationException { PersistentSet object = new PersistentSet(); Object deserialized = serializeBackAndForth(object); assertThat(deserialized, is(not(instanceOf(PersistentSet.class)))); assertThat(deserialized, is(instanceOf(Set.class))); }
/** * Tests that the Hibernate {@link PersistentList} can be serialized, but in way that * deserialized class will be java list and but not {@link PersistentList}. * * @throws SerializationException * SerializationException */ @Test public void hibernatePersistentList() throws SerializationException { PersistentList object = new PersistentList(); Object deserialized = serializeBackAndForth(object); assertThat(deserialized, is(not(instanceOf(PersistentList.class)))); assertThat(deserialized, is(instanceOf(List.class))); }
/** * Tests that the Hibernate {@link PersistentMap} can be serialized, but in way that * deserialized class will be java map and but not {@link PersistentMap}. * * @throws SerializationException * SerializationException */ @Test public void hibernatePersistentMap() throws SerializationException { PersistentMap object = new PersistentMap(); Object deserialized = serializeBackAndForth(object); assertThat(deserialized, is(not(instanceOf(PersistentMap.class)))); assertThat(deserialized, is(instanceOf(Map.class))); }