Bugs item #897022, was opened at 2004-02-14 07:01
Message generated for change (Comment added) made by jimweaver
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=897022&group_id=61302
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: trz (nottrz)
Assigned to: Jim Weaver (jimweaver)
Summary: Empty table cells problem
Initial Comment:
Hi, I have this test
beginAt("/index.jsp?tree=fullTree.xml");
assertTablePresent("tree");
String[][] table = {{"root", "", "", ""},
{"child1", "", "child2", ""},
{"child1.1", "", "child2.1", "child2.2"}};
assertTableEquals("tree", table);
this page is the page
<!doctype html public "-//w3c//dtd html 4.0
transitional//en"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<body>
<table id="tree" border=1 width="800">
<tbody>
<tr align="center">
<td>root</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr align="center">
<td>child1</td>
<td> </td>
<td>child2</td>
<td> </td>
</tr>
<tr align="center">
<td>child1.1</td>
<td> </td>
<td>child2.1</td>
<td>child2.2</td>
</tr>
</tbody>
</table>
</body>
</html>
last assert fail with this
junit.framework.AssertionFailedError: Unequal number of
columns for row 0 of table tree. Expected [4] found [3].
at junit.framework.Assert.fail(Assert.java:47)
at
net.sourceforge.jwebunit.WebTester.assertTableRowsEqual(Unknown
Source)
at
net.sourceforge.jwebunit.WebTester.assertTableEquals(Unknown
Source)
at
net.sourceforge.jwebunit.WebTestCase.assertTableEquals(Unknown
Source)
at
trz.genea.HomeWTest.testDisplayFullTree(HomeWTest.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
...
I tryed with (like in the page above) a blank
and nothing at all. and a comment. If I fill the cell
with something "visible" it works.
The error is not about the cell content, but on row
length. I think that something bad happens in table
reading.
Bye
Lorenzo
----------------------------------------------------------------------
>Comment By: Jim Weaver (jimweaver)
Date: 2004-09-15 15:34
Message:
Logged In: YES
user_id=619947
Hi,
I'm not sure if you are still waiting an answer to this or
not, but the problem you see is due to how jWebUnit is
handling empty cells in a document table. It compares the
expected array against a "sparse" version of the target
table in the document. The sparse table has a minimum
number of columns needed for non-empty cells. In your case,
the table is condensed such that the following assertion passes:
assertTablePresent("tree");
String[][] table = {{"root", "", "",},
{"child1", "child2", ""},
{"child1.1", "child2.1", "child2.2"}};
assertTableEquals("tree", table);
Now you are going to make me try to remember the reason why
aren't you ;-)? I'll contemplate and post again.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=897022&group_id=61302
-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Jwebunit-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development