poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1650059 - in /poi/trunk: src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java test-data/spreadsheet/57074.xls
Date Wed, 07 Jan 2015 14:13:35 GMT
Author: centic
Date: Wed Jan  7 14:13:34 2015
New Revision: 1650059

URL: http://svn.apache.org/r1650059
Log:
Add reproducer for bug 57074

Added:
    poi/trunk/test-data/spreadsheet/57074.xls   (with props)
Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java?rev=1650059&r1=1650058&r2=1650059&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java Wed Jan  7
14:13:34 2015
@@ -17,6 +17,8 @@
 
 package org.apache.poi.hssf.usermodel;
 
+import static org.junit.Assert.assertEquals;
+
 import java.io.IOException;
 
 import junit.framework.AssertionFailedError;
@@ -24,10 +26,12 @@ import junit.framework.TestCase;
 
 import org.apache.poi.hssf.HSSFTestDataSamples;
 import org.apache.poi.hssf.record.RecordFormatException;
+import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
+import org.junit.Test;
 
 /**
  * @author aviks
@@ -122,4 +126,22 @@ public final class TestUnfixedBugs exten
             }
         }
     }
+
+    @Test
+    public void testBug57074() {
+        Workbook wb = HSSFTestDataSamples.openSampleWorkbook("57074.xls");
+        Sheet sheet = wb.getSheet("Sheet1");
+        Row row = sheet.getRow(0);
+        Cell cell = row.getCell(0);
+        
+        HSSFColor bgColor = (HSSFColor) cell.getCellStyle().getFillBackgroundColorColor();
+        String bgColorStr = bgColor.getTriplet()[0]+", "+bgColor.getTriplet()[1]+", "+bgColor.getTriplet()[2];
+        //System.out.println(bgColorStr);
+        assertEquals("215, 228, 188", bgColorStr);
+
+        HSSFColor fontColor = (HSSFColor) cell.getCellStyle().getFillForegroundColorColor();
+        String fontColorStr = fontColor.getTriplet()[0]+", "+fontColor.getTriplet()[1]+",
"+fontColor.getTriplet()[2];
+        //System.out.println(fontColorStr);
+        assertEquals("0, 128, 128", fontColorStr);
+    }
 }

Added: poi/trunk/test-data/spreadsheet/57074.xls
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/57074.xls?rev=1650059&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/spreadsheet/57074.xls
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message