Implement resource checking functions in org.ajax4jsf.tests.AbstractAjax4JsfTestCase
------------------------------------------------------------------------------------
Key: RF-3534
URL:
http://jira.jboss.com/jira/browse/RF-3534
Project: RichFaces
Issue Type: Sub-task
Reporter: Nick Belaevski
1. Function to check script/style resource, returns resource context or throws IOException
if error
2. Function to check image resource, returns org.ajax4jsf.resource.image.ImageInfo (invoke
check() method before returning it), null if resource check is false or throws IOException
if resource isn't available
3. Refactor all unit tests to use that functions
Appendix - sample resource function code:
private void checkResource(String path) throws IOException {
InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
builder.createResource(null, path);
InternetResource resource = builder.getResource(path);
assertNotNull(resource);
String uri = "http:" + resource.getUri(facesContext, null);
Page page = webClient.getPage(uri);
assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
ImageInfo info = new ImageInfo();
info.setInput(page.getWebResponse().getContentAsStream());
assertTrue(info.check());
}
--
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