com.atlassian.jira.functest.framework.assertions
Class TableAssertions

java.lang.Object
  extended by com.atlassian.jira.functest.framework.AbstractFuncTestUtil
      extended by com.atlassian.jira.functest.framework.assertions.TableAssertions
All Implemented Interfaces:
FuncTestLogger

public class TableAssertions
extends AbstractFuncTestUtil

Used to make assertions about web Tables.

Since:
v3.13.2

Field Summary
 
Fields inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
environmentData, FS, locators, logger, logIndentLevel, tester
 
Constructor Summary
TableAssertions(net.sourceforge.jwebunit.WebTester tester, JIRAEnvironmentData environmentData)
           
 
Method Summary
 void assertTableCellHasText(com.meterware.httpunit.WebTable webTable, int row, int column, String text)
          Asserts that the particular table cell contains the text specified.
 void assertTableContainsRow(com.meterware.httpunit.WebTable webTable, String[] expectedRow)
          This method asserts that the given table contains AT LEAST ONE copy of the given row.
 void assertTableContainsRowCount(com.meterware.httpunit.WebTable webTable, String[] expectedRow, int expectedCount)
          Asserts that the given table contains the expected number of copies of the given row.
 void assertTableContainsRowOnce(com.meterware.httpunit.WebTable webTable, Object[] expectedRow)
          This method asserts that the given table contains EXACTLY ONE copy of the given row.
 void assertTableContainsRowOnce(com.meterware.httpunit.WebTable webTable, Object[] expectedRow, boolean exactCellSearching)
          This method asserts that the given table contains EXACTLY ONE copy of the given row.
 void assertTableRowEquals(com.meterware.httpunit.WebTable table, int row, Object[] expectedRow)
          Assert that the specified row of the table is equal to the expectedRow.
 void assertTableRowEqualsCollapsed(com.meterware.httpunit.WebTable table, int row, Object[] expectedRow)
          Assert that the specified row of the table is equal to the expectedRow with whitespace collapsed.
 com.meterware.httpunit.WebTable getWebTable(String tableSummaryOrId)
          Gets a WebTable by summury or ID.
 
Methods inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
childLogIndentLevel, getAssertions, getEnvironmentData, getFuncTestHelperFactory, getLogger, log, log, navigation, submitAtPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableAssertions

public TableAssertions(net.sourceforge.jwebunit.WebTester tester,
                       JIRAEnvironmentData environmentData)
Method Detail

getWebTable

public com.meterware.httpunit.WebTable getWebTable(String tableSummaryOrId)
Gets a WebTable by summury or ID.

Parameters:
tableSummaryOrId - Table ID (or summary - whatever that is)
Returns:
a WebTable by summury or ID.
See Also:
HttpUnitDialog.getWebTableBySummaryOrId(String)

assertTableContainsRowOnce

public void assertTableContainsRowOnce(com.meterware.httpunit.WebTable webTable,
                                       Object[] expectedRow)
This method asserts that the given table contains EXACTLY ONE copy of the given row.

Parameters:
webTable - The webTable under tests
expectedRow - the row we expect to find exactly one copy of.

assertTableContainsRowOnce

public void assertTableContainsRowOnce(com.meterware.httpunit.WebTable webTable,
                                       Object[] expectedRow,
                                       boolean exactCellSearching)
This method asserts that the given table contains EXACTLY ONE copy of the given row.

Parameters:
webTable - The webTable under tests
expectedRow - the row we expect to find exactly one copy of.
exactCellSearching - set to true if cell contents should match exactly (equals); false for fuzzily (contains)

assertTableContainsRow

public void assertTableContainsRow(com.meterware.httpunit.WebTable webTable,
                                   String[] expectedRow)
This method asserts that the given table contains AT LEAST ONE copy of the given row. For a more strict test, use assertTableContainsRowOnce(com.meterware.httpunit.WebTable, Object[]).

Parameters:
webTable - The webTable under tests
expectedRow - the row we expect to find.
See Also:
assertTableContainsRowOnce(com.meterware.httpunit.WebTable, java.lang.Object[]), assertTableContainsRowCount(com.meterware.httpunit.WebTable, java.lang.String[], int)

assertTableContainsRowCount

public void assertTableContainsRowCount(com.meterware.httpunit.WebTable webTable,
                                        String[] expectedRow,
                                        int expectedCount)
Asserts that the given table contains the expected number of copies of the given row.

Parameters:
webTable - The webTable under tests
expectedRow - the row we expect to find exactly one copy of.
expectedCount - The number of copies of this row we expect to find.

assertTableRowEquals

public void assertTableRowEquals(com.meterware.httpunit.WebTable table,
                                 int row,
                                 Object[] expectedRow)
Assert that the specified row of the table is equal to the expectedRow. Equality for individual cells is determined by TableAssertions.StrictWhitespaceContainsChecker

Parameters:
table - table to look up the row
row - the row number of the table to compare
expectedRow - the expected row to match

assertTableRowEqualsCollapsed

public void assertTableRowEqualsCollapsed(com.meterware.httpunit.WebTable table,
                                          int row,
                                          Object[] expectedRow)
Assert that the specified row of the table is equal to the expectedRow with whitespace collapsed. Equality for individual cells is determined by EqualsChecker.

Parameters:
table - table to look up the row
row - the row number of the table to compare
expectedRow - the expected row to match with whitespace collapsed.

assertTableCellHasText

public void assertTableCellHasText(com.meterware.httpunit.WebTable webTable,
                                   int row,
                                   int column,
                                   String text)
Asserts that the particular table cell contains the text specified.

Parameters:
webTable - the web table
row - the row index (zero-based)
column - the column index (zero-based)
text - the text to find


Copyright © 2002-2012 Atlassian. All Rights Reserved.