}
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");
// Add the ListBinding to the CSVReader, but no need to add it to the model since it is
// not a "namespace root" object...
csvReader.setListBinding(listBinding);
StringWriter modelWriter = new StringWriter();
model.writeModel(modelWriter);
// System.out.println(modelWriter);
XMLUnit.setIgnoreWhitespace( true );