com.atlassian.jira.webtests.table
Class LinkCell

java.lang.Object
  extended by com.atlassian.jira.webtests.table.AbstractSimpleCell
      extended by com.atlassian.jira.webtests.table.LinkCell
All Implemented Interfaces:
SimpleCell

public class LinkCell
extends AbstractSimpleCell

This is used with the JIRAWebTest.tableRowEquals(com.meterware.httpunit.WebTable,int,java.util.List) to identify which table cells should check for a link and not a text


Constructor Summary
LinkCell(String url, String label)
           
 
Method Summary
 boolean equals(com.meterware.httpunit.WebTable table, int row, int col)
          Checks if the cell table[row][col] is equal to this cell
 String getCellAsText(com.meterware.httpunit.WebTable table, int row, int col)
          WebTable.getCellAsText(int, int) returns the text of the cell only.
protected  boolean tableCellHasLinkThatContains(com.meterware.httpunit.WebTable table, int row, int col, String link)
          Checks if a particular table cell contains the link URL specified.
protected  boolean tableCellHasNoLinks(com.meterware.httpunit.WebTable table, int row, int col)
           
protected  boolean tableCellHasStrictText(com.meterware.httpunit.WebTable table, int row, int col, String text)
          todo - this should really be getting the anchor tag and asserting that the link has the text not the whole cell
 String toString()
           
 
Methods inherited from class com.atlassian.jira.webtests.table.AbstractSimpleCell
log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkCell

public LinkCell(String url,
                String label)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getCellAsText

public String getCellAsText(com.meterware.httpunit.WebTable table,
                            int row,
                            int col)
Description copied from interface: SimpleCell
WebTable.getCellAsText(int, int) returns the text of the cell only. Using this in log statements is often useless because it does not give interesting information. Eg. ImageCell will return the cells information about the image rather than the text.

Specified by:
getCellAsText in interface SimpleCell
Overrides:
getCellAsText in class AbstractSimpleCell
Parameters:
table - table
row - row index (starting from 0)
col - col index (starting from 0)
Returns:
String representing the WebTable cell that is interesting to this SimpleCell

equals

public boolean equals(com.meterware.httpunit.WebTable table,
                      int row,
                      int col)
Description copied from interface: SimpleCell
Checks if the cell table[row][col] is equal to this cell

Parameters:
table - table
row - row index (starting from 0)
col - col index (starting from 0)
Returns:
true if the referenced cell is equal to this cell, false otherwise

tableCellHasLinkThatContains

protected boolean tableCellHasLinkThatContains(com.meterware.httpunit.WebTable table,
                                               int row,
                                               int col,
                                               String link)
Checks if a particular table cell contains the link URL specified.

Parameters:
table - table to compare
row - row index of table
col - col index of table
link - URL
Returns:
True if the table cell contains the link URL specified.

tableCellHasNoLinks

protected boolean tableCellHasNoLinks(com.meterware.httpunit.WebTable table,
                                      int row,
                                      int col)

tableCellHasStrictText

protected boolean tableCellHasStrictText(com.meterware.httpunit.WebTable table,
                                         int row,
                                         int col,
                                         String text)
todo - this should really be getting the anchor tag and asserting that the link has the text not the whole cell

Parameters:
table - table to compare
row - row index of table
col - col index of table
text - text to verify
Returns:
Returns true if the text is contained in the table cell specified.


Copyright © 2002-2014 Atlassian. All Rights Reserved.