示例#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());
 }
示例#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());
 }
示例#3
0
 @Test
 public void paintWithNullData() throws IOException {
   mediaBean.setRequestParameter(null);
   StreamedContent streamedContent = mediaBean.getImage();
   Assert.assertNull(streamedContent);
 }