public void testNonSerializable() throws Exception { try { marshaller.objectToByteBuffer(new Object()); } catch (NotSerializableException e) { log.info("Log exception for output format verification", e); TraceInformation inf = (TraceInformation) e.getCause(); if (inf != null) { assert inf.toString().contains("in object java.lang.Object@"); } } }
public void testErrorUnmarshalling() throws Exception { Pojo pojo = new PojoWhichFailsOnUnmarshalling(); byte[] bytes = marshaller.objectToByteBuffer(pojo); try { marshaller.objectFromByteBuffer(bytes); } catch (IOException e) { log.info("Log exception for output format verification", e); TraceInformation inf = (TraceInformation) e.getCause(); if (inf != null) assert inf.toString().contains("in object of type org.infinispan.marshall.VersionAwareMarshallerTest$PojoWhichFailsOnUnmarshalling"); } }
public void testNestedNonSerializable() throws Exception { PutKeyValueCommand cmd = new PutKeyValueCommand( "k", new Object(), false, null, new EmbeddedMetadata.Builder().build(), 0, EnumUtil.EMPTY_BIT_SET, CommandInvocationId.generateId(null)); try { marshaller.objectToByteBuffer(cmd); } catch (NotSerializableException e) { log.info("Log exception for output format verification", e); TraceInformation inf = (TraceInformation) e.getCause(); if (inf != null) { assert inf.toString().contains("in object java.lang.Object@"); } } }