Author: amarkhel
Date: 2008-06-03 06:39:29 -0400 (Tue, 03 Jun 2008)
New Revision: 8877
Modified:
trunk/ui/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java
Log:
Modified:
trunk/ui/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java
===================================================================
---
trunk/ui/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java 2008-06-03
00:53:59 UTC (rev 8876)
+++
trunk/ui/separator/src/test/java/org/richfaces/component/SeparatorComponentTest.java 2008-06-03
10:39:29 UTC (rev 8877)
@@ -114,36 +114,71 @@
}
public void testRenderImage() throws Exception {
-
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+
ui.setLineType(SeparatorRendererBase.LINE_TYPE_BEVEL);
renderView();
- ImageInfo info =
getImageResource("org.richfaces.renderkit.html.images.BevelSeparatorImage");
- assertNotNull(info);
+ InternetResource resource =
builder.getResource("org.richfaces.renderkit.html.images.BevelSeparatorImage");
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, ui);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
ui.setLineType(SeparatorRendererBase.LINE_TYPE_SOLID);
renderView();
- info =
getImageResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
- assertNotNull(info);
+ resource =
builder.getResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
+ assertNotNull(resource);
+ uri = "http:" + resource.getUri(facesContext, ui);
+ page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
-
ui.setLineType(SeparatorRendererBase.LINE_TYPE_DOTTED);
renderView();
- info =
getImageResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
- assertNotNull(info);
+ resource =
builder.getResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
+ assertNotNull(resource);
+ uri = "http:" + resource.getUri(facesContext, ui);
+ page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
ui.setLineType(SeparatorRendererBase.LINE_TYPE_DASHED);
renderView();
- info =
getImageResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
- assertNotNull(info);
+ resource =
builder.getResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
+ assertNotNull(resource);
+ uri = "http:" + resource.getUri(facesContext, ui);
+ page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
ui.setLineType(SeparatorRendererBase.LINE_TYPE_DOUBLE);
renderView();
- info =
getImageResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
- assertNotNull(info);
+ resource =
builder.getResource("org.richfaces.renderkit.html.images.SimpleSeparatorImage");
+ assertNotNull(resource);
+ uri = "http:" + resource.getUri(facesContext, ui);
+ page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
}
}
Show replies by date