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: Release 1.3
>Status: Closed
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>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
    </tr>       
    <tr align="center">
                <td>child1</td>
                <td>&nbsp;</td>
                <td>child2</td>
                <td>&nbsp;</td>
    </tr>
    <tr align="center">
                <td>child1.1</td>
                <td>&nbsp;</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 &nbsp; (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-16 11:44

Message:
Logged In: YES 
user_id=619947

Ok, have added an option to allow table compression before
comparisons to be disabled.  Will be in the next release.  I
think table compression was in place to prevent me from
having to worry about empty columns / rows on tables I was
checking - wanted to worry about data being present and not
spacing / alignment.

----------------------------------------------------------------------

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: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Jwebunit-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to