assertTrue( "Wrong serialization provider", serializationProvider instanceof AvroSerializationProvider );
}
@Test
public void testAvroSerialization() throws Exception {
LuceneWorkSerializer converter = new LuceneWorkSerializerImpl(
serializationProvider,
searchFactoryHolder.getSearchFactory()
);
List<LuceneWork> worksAsSerialized = buildWorks();
//this is how the 'persistent-avro-1.0' resource was created:
// final byte[] outbytes = converter.toSerializedModel( worksAsSerialized );
// storeSerializedForm(outbytes);
byte[] bytes = loadResource();
List<LuceneWork> deserialized = converter.toLuceneWorks( bytes );
assertThat( deserialized ).hasSize( worksAsSerialized.size() );
for ( int index = 0; index < worksAsSerialized.size(); index++ ) {
AvroTestHelpers.assertLuceneWork( worksAsSerialized.get( index ), deserialized.get( index ) );
}