use of org.jboss.marshalling.MarshallingConfiguration in project netty by netty.
the class AbstractCompatibleMarshallingDecoderTest method testSimpleUnmarshalling.
@Test
public void testSimpleUnmarshalling() throws IOException {
MarshallerFactory marshallerFactory = createMarshallerFactory();
MarshallingConfiguration configuration = createMarshallingConfig();
EmbeddedChannel ch = new EmbeddedChannel(createDecoder(Integer.MAX_VALUE));
ByteArrayOutputStream bout = new ByteArrayOutputStream();
Marshaller marshaller = marshallerFactory.createMarshaller(configuration);
marshaller.start(Marshalling.createByteOutput(bout));
marshaller.writeObject(testObject);
marshaller.finish();
marshaller.close();
byte[] testBytes = bout.toByteArray();
ch.writeInbound(input(testBytes));
assertTrue(ch.finish());
String unmarshalled = ch.readInbound();
assertEquals(testObject, unmarshalled);
assertNull(ch.readInbound());
}
use of org.jboss.marshalling.MarshallingConfiguration in project netty by netty.
the class SerialCompatibleMarshallingEncoderTest method createMarshallingConfig.
@Override
protected MarshallingConfiguration createMarshallingConfig() {
// Create a configuration
final MarshallingConfiguration configuration = new MarshallingConfiguration();
configuration.setVersion(5);
return configuration;
}
Aggregations