[richfaces-issues] [JBoss JIRA] Created: (RF-3535) Add messages to all scripts/styles unit tests
Nick Belaevski (JIRA)
jira-events at lists.jboss.org
Fri May 23 21:39:42 EDT 2008
Add messages to all scripts/styles unit tests
---------------------------------------------
Key: RF-3535
URL: http://jira.jboss.com/jira/browse/RF-3535
Project: RichFaces
Issue Type: Sub-task
Reporter: Nick Belaevski
Add messages with information about resource being processed to all applicable asserts:
public void testRenderScript() throws Exception {
HtmlPage view = renderView();
assertNotNull(view);
List<HtmlScript> scripts = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.SCRIPT_ELEM);
int foundCount = 0;
for (Iterator<HtmlScript> it = scripts.iterator(); it.hasNext();) {
HtmlScript item = it.next();
String srcAttr = item.getSrcAttribute();
if (StringUtils.isNotBlank(srcAttr)) {
boolean found = false;
for (Iterator<String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
String src = (String) srcIt.next();
found = srcAttr.contains(src);
if (found) {
foundCount++;
String uri = "http:" + srcAttr;
Page page = webClient.getPage(uri);
assertNotNull(page);
assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
break;
}
}
assertTrue(found);
}
}
assertEquals(javaScripts.size(), foundCount);
}
E.g.:
assertTrue(found); -> assertTrue(srcAttr, found);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list