Author: DartPeng
Date: 2009-12-17 08:17:08 -0500 (Thu, 17 Dec 2009)
New Revision: 19419
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.templating.test/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilderTest.java
Log:
JBIDE-5205
write a test case
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.templating.test/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilderTest.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.templating.test/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilderTest.java 2009-12-17
13:09:59 UTC (rev 19418)
+++
trunk/smooks/tests/org.jboss.tools.smooks.templating.test/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilderTest.java 2009-12-17
13:17:08 UTC (rev 19419)
@@ -141,18 +141,20 @@
assertEquals(template, builder2.buildTemplate());
}
- public void test_elementname() throws IOException, ModelBuilderException{
- File xsdFile = new
File("src/org/jboss/tools/smooks/templating/template/xml/smooks1_0.xsd");
- URI uri = URI.createFileURI(xsdFile.getCanonicalFile().toString());
- XSDModelBuilder builder = new XSDModelBuilder(uri);
+ public void test_elementname() throws IOException, ModelBuilderException {
+ File xsdFile = new
File("src/org/jboss/tools/smooks/templating/template/xml/smooks1_0.xsd");
+ URI uri = URI.createFileURI(xsdFile.getCanonicalFile().toString());
+ XSDModelBuilder builder = new XSDModelBuilder(uri);
builder.setRootElementName("smooks-resource-list");
XMLFreeMarkerTemplateBuilder templateBuilder = new
XMLFreeMarkerTemplateBuilder(builder);
Document document = templateBuilder.getModel();
checkNodeName(document.getDocumentElement());
- }
-
- private void checkNodeName(Node node){
- assertNotNull(node.getNodeName());
+ }
+
+ private void checkNodeName(Node node) {
+ if (node instanceof Element) {
+ assertNotNull(((Element)node).getTagName());
+ }
System.out.println(node.getNodeName());
assertTrue(node.getNodeName().indexOf("null") == -1);
NodeList nodeList = node.getChildNodes();
Show replies by date