use of org.apache.wicket.core.util.objects.checker.ObjectSerializationChecker in project wicket by apache.
the class SerializableCheckerTest method valueMap.
/**
* Test {@link ValueMap} serializability.
*
* @throws IOException
*/
@Test
public void valueMap() throws IOException {
CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(), new ObjectSerializationChecker(new NotSerializableException()));
checker.writeObject(new ValueMap());
}
use of org.apache.wicket.core.util.objects.checker.ObjectSerializationChecker in project wicket by apache.
the class SerializableCheckerTest method nonSerializableTypeDetection.
/**
* @throws IOException
*/
@Test
public void nonSerializableTypeDetection() throws IOException {
CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(), new ObjectSerializationChecker(new NotSerializableException()));
String exceptionMessage = null;
try {
checker.writeObject(new TestType2());
} catch (CheckingObjectOutputStream.ObjectCheckException e) {
exceptionMessage = e.getMessage();
}
assertTrue(exceptionMessage.contains(NonSerializableType.class.getName()));
}
Aggregations