Java Code Examples for org.springframework.core.serializer.support.DeserializingConverter

The following examples show how to use org.springframework.core.serializer.support.DeserializingConverter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   Source File: SerializationConverterTests.java    License: MIT License 5 votes vote down vote up
@Test
public void serializeAndDeserializeString() {
	SerializingConverter toBytes = new SerializingConverter();
	byte[] bytes = toBytes.convert("Testing");
	DeserializingConverter fromBytes = new DeserializingConverter();
	assertEquals("Testing", fromBytes.convert(bytes));
}
 
Example 2
@Test
public void serializeAndDeserializeString() {
	SerializingConverter toBytes = new SerializingConverter();
	byte[] bytes = toBytes.convert("Testing");
	DeserializingConverter fromBytes = new DeserializingConverter();
	assertEquals("Testing", fromBytes.convert(bytes));
}
 
Example 3
@Test
public void serializeAndDeserializeString() {
	SerializingConverter toBytes = new SerializingConverter();
	byte[] bytes = toBytes.convert("Testing");
	DeserializingConverter fromBytes = new DeserializingConverter();
	assertEquals("Testing", fromBytes.convert(bytes));
}
 
Example 4
Source Project: spring-analysis-note   Source File: SerializationConverterTests.java    License: MIT License 4 votes vote down vote up
@Test(expected = SerializationFailedException.class)
public void deserializationFailure() {
	DeserializingConverter fromBytes = new DeserializingConverter();
	fromBytes.convert("Junk".getBytes());
}
 
Example 5
@Test(expected = SerializationFailedException.class)
public void deserializationFailure() {
	DeserializingConverter fromBytes = new DeserializingConverter();
	fromBytes.convert("Junk".getBytes());
}
 
Example 6
public CustomJdkSerializationRedisSerializer() {
    this(new SerializingConverter(), new DeserializingConverter());
}
 
Example 7
public CustomJdkSerializationRedisSerializer(ClassLoader classLoader) {
    this(new SerializingConverter(), new DeserializingConverter(classLoader));
}
 
Example 8
@Test(expected = SerializationFailedException.class)
public void deserializationFailure() {
	DeserializingConverter fromBytes = new DeserializingConverter();
	fromBytes.convert("Junk".getBytes());
}
 
Example 9
public SpringDevToolsSerializer(){
	this.deserializer = new DeserializingConverter(new DefaultDeserializer(Thread.currentThread().getContextClassLoader()));
}
 
Example 10
private static GenericConversionService createDefaultConversionService() {
	GenericConversionService converter = new GenericConversionService();
	converter.addConverter(Object.class, byte[].class, new SerializingConverter());
	converter.addConverter(byte[].class, Object.class, new DeserializingConverter());
	return converter;
}
 
Example 11
private static GenericConversionService createConversionServiceWithBeanClassLoader(ClassLoader classLoader) {
	GenericConversionService conversionService = new GenericConversionService();
	conversionService.addConverter(Object.class, byte[].class, new SerializingConverter());
	conversionService.addConverter(byte[].class, Object.class, new DeserializingConverter(classLoader));
	return conversionService;
}