Author: ozizka(a)redhat.com
Date: 2009-03-10 19:22:42 -0400 (Tue, 10 Mar 2009)
New Revision: 203
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
Log:
normalize-string() replaced with normalize-space() in XPath expressions
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-03-10
23:18:53 UTC (rev 202)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-03-10
23:22:42 UTC (rev 203)
@@ -885,26 +885,29 @@
return (HtmlSelect) client.getElement(ID_PAGE_SIZE_SELECT);
}
- public int getTotalItemsCount() throws ActionNotAvailableException {
+ public int getTotalItemsCount() throws ActionNotAvailableException
+ {
Element e = client.getElement(ID_PAGINATION_TOTAL_ITEMS);
String textContent = e.getTextContent();
String[] parts = textContent.split(":");
if( parts.length < 2 )
throw new ActionNotAvailableException("Total pagination items count expected
after 'Total:' or similar.");
+
+ String countStr = parts[1].trim();
try{
- return NumberUtils.createInteger(parts[1]);
+ return NumberUtils.createInteger( countStr );
}catch(NumberFormatException ex ){
- throw new ActionNotAvailableException("Can't parse pagination items count
from '"+parts[1]+"'", ex);
+ throw new ActionNotAvailableException("Can't parse pagination items count
from '"+countStr+"'", ex);
}
}
protected HtmlSpan getGoSpan( String spanLabel ){
- String xPath = ".//span[normalize-string() =
'"+spanLabel+"']";
+ String xPath = ".//span[normalize-space() =
'"+spanLabel+"']";
return (HtmlSpan) getPageContols().getFirstByXPath(xPath);
}
protected HtmlTableCell getGoPage( int pageNumber ) throws
HtmlElementNotFoundException{
- String xPath = ".//td[normalize-string() =
'"+pageNumber+"']";
+ String xPath = ".//td[normalize-space() =
'"+pageNumber+"']";
HtmlElement td = getPageContols().getFirstByXPath(xPath);
if( null == td )
throw new HtmlElementNotFoundException(
@@ -947,7 +950,7 @@
}
public int getPageCount(){
- String xPath = ".//td[ count(./*) = 0 and normalize-string() > 0 ]";
+ String xPath = ".//td[ count(./*) = 0 and normalize-space() > 0 ]";
List<?> elements = getPageContols().getByXPath(xPath);
return elements.size();
}
Show replies by date