String styleAttr = div2.getAttributeValue("style");
assertTrue(styleAttr.contains("org.richfaces.renderkit.html.images.BevelSeparatorImage"));
}
public void testRenderImage() throws Exception {
InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
ui.setLineType(SeparatorRendererBase.LINE_TYPE_BEVEL);
renderView();
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();
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();
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();
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();
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();