}
else if (simpleTestName.startsWith("type-builtins")) {
dataModel.put("testmethod", new TestMethod());
dataModel.put("testnode", new TestNode());
dataModel.put("testcollection", new SimpleCollection(new ArrayList()));
dataModel.put("bean", new TestBean());
}
else if (simpleTestName.equals("date-type-builtins")) {
GregorianCalendar cal = new GregorianCalendar(2003, 4 - 1, 5, 6, 7, 8);
cal.setTimeZone(TimeZone.getTimeZone("UTC"));
Date d = cal.getTime();
dataModel.put("unknown", d);
dataModel.put("timeOnly", new java.sql.Time(d.getTime()));
dataModel.put("dateOnly", new java.sql.Date(d.getTime()));
dataModel.put("dateTime", new java.sql.Timestamp(d.getTime()));
}
else if (simpleTestName.equals("var-layers")) {
dataModel.put("x", new Integer(4));
dataModel.put("z", new Integer(4));
conf.setSharedVariable("y", new Integer(7));
}
else if (simpleTestName.equals("xml-fragment")) {
DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
f.setNamespaceAware(true);
DocumentBuilder db = f.newDocumentBuilder();
org.w3c.dom.Document doc = db.parse(new InputSource(getClass().getResourceAsStream("models/xmlfragment.xml")));
dataModel.put("node", NodeModel.wrap(doc.getDocumentElement().getFirstChild().getFirstChild()));
}
else if (simpleTestName.equals("xmlns1")) {
InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns.xml"));
NodeModel nm = NodeModel.parse(is);
dataModel.put("doc", nm);
}
else if (simpleTestName.equals("xmlns2")) {
InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns2.xml"));
NodeModel nm = NodeModel.parse(is);
dataModel.put("doc", nm);
}
else if (simpleTestName.equals("xmlns3") || simpleTestName.equals("xmlns4")) {
InputSource is = new InputSource(getClass().getResourceAsStream("models/xmlns3.xml"));
NodeModel nm = NodeModel.parse(is);
dataModel.put("doc", nm);
}
else if (simpleTestName.equals("xmlns5")) {
InputSource is = new InputSource(getClass().getResourceAsStream("models/defaultxmlns1.xml"));
NodeModel nm = NodeModel.parse(is);
dataModel.put("doc", nm);
}
else if (simpleTestName.startsWith("sequence-builtins")) {
Set abcSet = new TreeSet();
abcSet.add("a");
abcSet.add("b");
abcSet.add("c");
dataModel.put("abcSet", abcSet);
List listWithNull = new ArrayList();
listWithNull.add("a");
listWithNull.add(null);
listWithNull.add("c");
dataModel.put("listWithNull", listWithNull);
List listWithNullsOnly = new ArrayList();
listWithNull.add(null);
listWithNull.add(null);
listWithNull.add(null);
dataModel.put("listWithNullsOnly", listWithNullsOnly);
dataModel.put("abcCollection", new SimpleCollection(abcSet));
}
else if (simpleTestName.equals("number-to-date")) {
dataModel.put("bigInteger", new BigInteger("1305575275540"));
dataModel.put("bigDecimal", new BigDecimal("1305575275539.5"));