Step step = new DefaultStep(version1, version2,
new TestStreamMigrator(inputData, outputData));
graph.addStep(step);
type.setGraph(graph);
resourceRecogniser.addType(type);
DefaultResourceMigrator resourceMigrator =
new DefaultResourceMigrator(streamBufferFactory,
resourceRecogniser, notificationReporter);
ByteArrayInputStream bais = new ByteArrayInputStream(
inputData.getBytes());
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputMetadata meta = new DefaultInputMetadata(filename, true);
resourceMigrator.migrate(meta, bais, new OutputCreator() {
public OutputStream createOutputStream() {
return baos;
}
});
assertEquals("", outputData, new String(baos.toByteArray()));