[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit HtmlTablesTest.java,1.7,1.8
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2000-09-25 21:30:28
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory slayer.i.sourceforge.net:/tmp/cvs-serv23558/test/com/meterware/httpunit Modified Files: HtmlTablesTest.java Log Message: Allow searching for nested tables in any position Index: HtmlTablesTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/HtmlTablesTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- HtmlTablesTest.java 2000/09/01 14:54:07 1.7 +++ HtmlTablesTest.java 2000/09/25 21:30:24 1.8 @@ -176,7 +176,7 @@ public void testInnerTableSeek() throws Exception { ReceivedPage rp = new ReceivedPage( _baseURL, HEADER + "<body><h2>Interesting data</h2>" + "<table summary=\"outer one\">" + - "<tr><td> </td><td>" + + "<tr><td>Here we are</td><td>" + "Inner Table<br>" + "<table summary=\"inner one\">" + " <tr><td colspan=2> </td></tr>" + @@ -185,11 +185,16 @@ "</table></td></tr>" + "</table></body></html>" ); - String[][] cells = rp.getTableStartingWith( "Red" ).asText(); + WebTable wt = rp.getTableStartingWith( "Red" ); + assertNotNull( "Did not find table starting with 'Red'", wt ); + String[][] cells = wt.asText(); assertEquals( "Non-blank rows", 2, cells.length ); assertEquals( "Non-blank columns", 2, cells[0].length ); assertEquals( "cell at 1,0", "Blue", cells[1][0] ); - cells = rp.getTableStartingWithPrefix( "Re" ).asText(); + + wt = rp.getTableStartingWithPrefix( "Re" ); + assertNotNull( "Did not find table starting with prefix 'Re'", wt ); + cells = wt.asText(); assertEquals( "Non-blank rows", 2, cells.length ); assertEquals( "Non-blank columns", 2, cells[0].length ); assertEquals( "cell at 1,0", "Blue", cells[1][0] ); |