net.sourceforge.jwebunit
Class ExpectedTable

java.lang.Object
  |
  +--net.sourceforge.jwebunit.ExpectedTable

public class ExpectedTable
extends java.lang.Object

Represents an expected table for comparison with an actual html table.

Author:
Jim Weaver

Constructor Summary
ExpectedTable()
          Construct an expected table without providing any expecteds; they can be appended subsequently.
ExpectedTable(java.lang.Object[][] expectedValues)
          Construct an expected table from a two dimensional array of objects.
 
Method Summary
 void appendRow(ExpectedRow row)
          Append a single expected row.
 void appendRows(ExpectedTable exptectedTable)
          Append another expected table's rows.
 void appendRows(java.lang.Object[][] newExpectedValues)
          Append any number of expected rows, represented by a two dimensional array of objects.
 java.lang.String[][] getExpectedStrings()
          Return a two dimensional array of strings which represent the expected values.
 java.lang.String toString()
          Return a brace-delimited, printable version of the expected table for use in assertion failure output or debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpectedTable

public ExpectedTable()
Construct an expected table without providing any expecteds; they can be appended subsequently.

ExpectedTable

public ExpectedTable(java.lang.Object[][] expectedValues)
Construct an expected table from a two dimensional array of objects. Each object's string value will be used with an expected colspan of 1, unless an object is an ExpectedCell, in which case its defined value and colspan are used.
Parameters:
expectedValues - two-dimensional array representing expected table cells.
Method Detail

appendRows

public void appendRows(java.lang.Object[][] newExpectedValues)
Append any number of expected rows, represented by a two dimensional array of objects. Each object's string value will be used with an expected colspan of 1, unless an object is an ExpectedCell, in which case its defined value and colspan are used.
Parameters:
newExpectedValues - two-dimensional array representing expected table cells.

appendRows

public void appendRows(ExpectedTable exptectedTable)
Append another expected table's rows.
Parameters:
exptectedTable - expected table whose rows are to be appended.

appendRow

public void appendRow(ExpectedRow row)
Append a single expected row.
Parameters:
row - row to be appended.

getExpectedStrings

public java.lang.String[][] getExpectedStrings()
Return a two dimensional array of strings which represent the expected values. Cells which have a colspan other than one will occupy a number of positions within a row equal to their colspan. This array is used to compare against the HttpUnit representation of an actual html table.

toString

public java.lang.String toString()
Return a brace-delimited, printable version of the expected table for use in assertion failure output or debugging.
Overrides:
toString in class java.lang.Object


Copyright © 2002 ThoughtWorks, Inc. All Rights Reserved.