XMLUnit.setIgnoreWhitespace( true );
XMLAssert.assertXMLEqual(new InputStreamReader(getClass().getResourceAsStream(messageFile)), new StringReader(modelWriter.toString()));
}
public void test_programmatic_build() throws IOException, SAXException {
SmooksModel smooksModel = new SmooksModel();
Model<SmooksModel> model = new Model<SmooksModel>(smooksModel, modelBuilder);
CSVReader csvReader = new CSVReader();
// Populate it...
csvReader.setFields("name,address,age");
csvReader.setRootElementName("people");
csvReader.setRecordElementName("person");
csvReader.setIndent(true);
// Set strict on the model... should have no effect as it's not supported in v1.2...
csvReader.setStrict(true);
// Need to register all the "namespace root" bean instances...
model.registerBean(csvReader).setNamespace("http://www.milyn.org/xsd/smooks/csv-1.2.xsd").setNamespacePrefix("csv12");
// Add it in the appropriate place in the object graph....
smooksModel.getReaders().add(csvReader);
ListBinding listBinding = new ListBinding();
listBinding.setBeanId("beanX");
listBinding.setBeanClass("com.acme.XClass");