[richfaces-issues] [JBoss JIRA] Updated: (RF-3535) Add messages to all scripts/styles unit tests

Nick Belaevski (JIRA) jira-events at lists.jboss.org
Tue May 27 14:31:55 EDT 2008


     [ http://jira.jboss.com/jira/browse/RF-3535?page=all ]

Nick Belaevski updated RF-3535:
-------------------------------

        Fix Version/s: 3.2.1
    Affects Version/s: 3.2.1
             Assignee: Nick Belaevski

> 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
>    Affects Versions: 3.2.1
>            Reporter: Nick Belaevski
>         Assigned To: Nick Belaevski
>             Fix For: 3.2.1
>
>
> 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