freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [27/35] incubator-freemarker git commit: (Cleaned up and extended XML prefix outputting test a bit.)
Date Wed, 30 Dec 2015 18:11:47 GMT
(Cleaned up and extended XML prefix outputting test a bit.)


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/f20271e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/f20271e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/f20271e5

Branch: refs/heads/2.3
Commit: f20271e535792636988955d8591964cc812f91d0
Parents: 95859c3
Author: ddekany <ddekany@apache.org>
Authored: Mon Dec 28 22:44:08 2015 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Mon Dec 28 22:44:08 2015 +0100

----------------------------------------------------------------------
 src/test/java/freemarker/ext/dom/DOMTest.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/f20271e5/src/test/java/freemarker/ext/dom/DOMTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/ext/dom/DOMTest.java b/src/test/java/freemarker/ext/dom/DOMTest.java
index 4a96a83..8079d90 100644
--- a/src/test/java/freemarker/ext/dom/DOMTest.java
+++ b/src/test/java/freemarker/ext/dom/DOMTest.java
@@ -66,11 +66,17 @@ public class DOMTest extends TemplateTest {
                 "<root xmlns=\"http://example.com/ns1\" xmlns:a=\"http://example.com/ns2\">"
                 + "<a>A</a><a:b>B</a:b><c a1=\"1\" a:a2=\"2\"
/></root>");
         
-        // 
+        // When there's no matching prefix declared via the #ftl header, return null for
qname:
         assertOutput("${doc?children[0].@@qname!'null'}", "null");
         assertOutput("${doc?children[0]?children[1].@@qname!'null'}", "null");
+        assertOutput("${doc?children[0]?children[2]['@*'][1].@@qname!'null'}", "null");
+        
+        // When we have prefix declared in the #ftl header:
         assertOutput(ftlHeader + "${doc?children[0].@@qname}", "root");
         assertOutput(ftlHeader + "${doc?children[0]?children[1].@@qname}", "n2:b");
+        assertOutput(ftlHeader + "${doc?children[0]?children[2].@@qname}", "c");
+        assertOutput(ftlHeader + "${doc?children[0]?children[2]['@*'][0].@@qname}", "a1");
+        assertOutput(ftlHeader + "${doc?children[0]?children[2]['@*'][1].@@qname}", "n2:a2");
         // Unfortunately these include the xmlns attributes, but that would be non-BC to
fix now:
         assertThat(getOutput(ftlHeader + "${doc?children[0].@@start_tag}"), startsWith("<root"));
         assertThat(getOutput(ftlHeader + "${doc?children[0]?children[1].@@start_tag}"), startsWith("<n2:b"));


Mime
View raw message