Exemplo n.º 1
0
 @Test
 public void getImageInRenderPhase() throws IOException {
   mediaBean.setRequestParameter("email");
   mediaBean.setRenderPhase(true);
   StreamedContent streamedContent = mediaBean.getImage();
   Assert.assertNotNull(streamedContent);
   Assert.assertNull(streamedContent.getStream());
 }
Exemplo n.º 2
0
 @Test
 public void getImage() throws IOException {
   mediaBean.setRequestParameter("email");
   StreamedContent streamedContent = mediaBean.getImage();
   Assert.assertNotNull(streamedContent);
   Assert.assertNotNull(streamedContent.getStream());
   Assert.assertEquals("png", streamedContent.getContentType());
   Assert.assertEquals("email", streamedContent.getName());
 }
Exemplo n.º 3
0
 @Test
 public void paintWithNullData() throws IOException {
   mediaBean.setRequestParameter(null);
   StreamedContent streamedContent = mediaBean.getImage();
   Assert.assertNull(streamedContent);
 }