You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by gv...@apache.org on 2006/01/07 05:18:51 UTC

svn commit: r366647 - /struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java

Author: gvanmatre
Date: Fri Jan  6 20:18:39 2006
New Revision: 366647

URL: http://svn.apache.org/viewcvs?rev=366647&view=rev
Log:
Fix for Bug#: 38157 reported by Hermod Opstvedt is in the 20050106 nightly build.  Added test to support the patch.

Modified:
    struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java

Modified: struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java?rev=366647&r1=366646&r2=366647&view=diff
==============================================================================
--- struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java (original)
+++ struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/parser/ParserTestCase.java Fri Jan  6 20:18:39 2006
@@ -270,7 +270,7 @@
         // lazy html
         doc1
                 .append("<table>")
-                .append("<tr><th>Test")
+                .append("<tr><th>Test<th>Test")
                 .append("<tr><td>")
                 .append("<ol><li>1<li>2<li>3</ol>")
                 .append("<tr><td>")
@@ -285,7 +285,7 @@
         StringBuffer doc2 = new StringBuffer();
         doc2
                 .append("<table>")
-                .append("<tr><th>Test</th></tr>")
+                .append("<tr><th>Test</th><th>Test</th></tr>")
                 .append("<tr><td>")
                 .append("<ol><li>1</li><li>2</li><li>3</li></ol>")
                 .append("</td></tr>")
@@ -563,17 +563,31 @@
         StringBuffer doc = new StringBuffer();
 
         doc.append("<table>")
-           .append("<tr><th></th></tr>")
-           .append("<tr><td></td></tr>")
+           .append("<tr><th></th><th></tr>")
+           .append("<tr><td></td><td></tr>")
            .append("</table>");
         
         List nodes = p.parse(doc);
-        assertEquals("Table parse, 1 root node", nodes.size(), 1);   
+        assertEquals("table, 1 root node", nodes.size(), 1);   
         
         Node table = (Node) nodes.get(0);
+        assertNotNull("table", table);
         
         List trs = table.getChildren();
-        assertEquals("tr parse, 2 root node", trs.size(), 2);   
+        assertEquals("trs, 2 root nodes", trs.size(), 2);   
+        
+        Node tr = (Node) trs.get(0);
+        assertNotNull("tr row 1", tr);
+        
+        List ths = tr.getChildren();
+        assertEquals("ths, 2 root nodes", ths.size(), 2);           
+        
+        tr = (Node) trs.get(1);
+        assertNotNull("tr row 2", tr);
+        
+        List tds = tr.getChildren();
+        assertEquals("tds, 2 root nodes", tds.size(), 2);           
+        
         
     }
     



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org