FlowHelper.setContextObject(objectModel, flowContextObject);
objectModel.put(ObjectModelHelper.REQUEST_OBJECT, request);
Map contextObjectModel = new HashMap();
contextObjectModel.put(ContextHelper.CONTEXT_OBJECT_MODEL, objectModel);
Context context = new DefaultContext(contextObjectModel);
Source sampleSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.source.xml");
Document sample = this.parser.parse(sampleSource.getInputStream());
Element datatypeElement = (Element) sample.getElementsByTagNameNS(FormsConstants.DEFINITION_NS, "datatype").item(0);
Datatype datatype = this.datatypeManager.createDatatype(datatypeElement, false);
FlowJXPathSelectionList list = new FlowJXPathSelectionList
(context, "beans", "key", "value", datatype,null,false,null,false);
DOMBuilder dest = new DOMBuilder();
list.generateSaxFragment(dest, Locale.ENGLISH);
Source expectedSource = new ResourceSource("resource://org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCaseWithNull.dest.xml");
Document expected = this.parser.parse(expectedSource.getInputStream());
Document destDocument = dest.getDocument();
assertEqual("Test if generated list matches expected",
expected, destDocument);
}