Add reproducer for bug 57074

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1650059 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2015-01-07 14:13:34 +00:00
parent c7d0c19328
commit 3f6f9da0ce
2 changed files with 22 additions and 0 deletions

View File

@ -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 extends TestCase {
}
}
}
@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);
}
}

Binary file not shown.