struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yasserzam...@apache.org
Subject [struts] branch support-2-3 updated: not fail if OS or JDK doesn't support jpeg
Date Thu, 26 Apr 2018 16:15:32 GMT
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a commit to branch support-2-3
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/support-2-3 by this push:
     new 4db5cdc  not fail if OS or JDK doesn't support jpeg
4db5cdc is described below

commit 4db5cdc47385fa493d223fd1eee213870b555297
Author: Yasser Zamani <yasserzamani@apache.org>
AuthorDate: Thu Apr 26 20:44:50 2018 +0430

    not fail if OS or JDK doesn't support jpeg
---
 .../src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
b/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
index b4a09a0..dd760a0 100644
--- a/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
+++ b/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
@@ -33,6 +33,7 @@ import org.jfree.chart.ChartFactory;
 import org.jfree.chart.JFreeChart;
 import org.jfree.data.general.DefaultPieDataset;
 
+import javax.imageio.ImageIO;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -97,7 +98,9 @@ public class ChartResultTest extends StrutsTestCase {
         result.execute(actionInvocation);
 
         EasyMock.verify(responseMock);
-        assertTrue(os.isWritten());
+
+        boolean envSupportsJpeg = ImageIO.getImageWritersByFormatName("jpeg").hasNext();
+        assertTrue(envSupportsJpeg ^ !os.isWritten());
     }
 
 

-- 
To stop receiving notification emails like this one, please contact
yasserzamani@apache.org.

Mime
View raw message