move unit test for XSSFSheet.setTabColor from TestXSSFWorkbook to TestXSSFSheet

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1739538 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-04-17 03:35:58 +00:00
parent 4e33c06871
commit 48bba39dcf
2 changed files with 16 additions and 16 deletions

View File

@ -49,6 +49,7 @@ import org.apache.poi.ss.usermodel.CellCopyPolicy;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.FormulaError;
import org.apache.poi.ss.usermodel.IgnoredErrorType;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
@ -1903,4 +1904,19 @@ public final class TestXSSFSheet extends BaseTestSheet {
assertEquals("B2:D4", ignoredErrors.get(IgnoredErrorType.EVALUATION_ERROR).iterator().next().formatAsString());
workbook.close();
}
@Test
public void setTabColor() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
try {
XSSFSheet sh = wb.createSheet();
assertTrue(sh.getCTWorksheet().getSheetPr() == null || !sh.getCTWorksheet().getSheetPr().isSetTabColor());
sh.setTabColor(IndexedColors.RED);
assertTrue(sh.getCTWorksheet().getSheetPr().isSetTabColor());
assertEquals(IndexedColors.RED.index,
sh.getCTWorksheet().getSheetPr().getTabColor().getIndexed());
} finally {
wb.close();
}
}
}

View File

@ -57,7 +57,6 @@ import org.apache.poi.ss.usermodel.BaseTestWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
@ -543,21 +542,6 @@ public final class TestXSSFWorkbook extends BaseTestWorkbook {
changeSheetNameWithSharedFormulas("shared_formulas.xlsx");
}
@Test
public void setTabColor() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
try {
XSSFSheet sh = wb.createSheet();
assertTrue(sh.getCTWorksheet().getSheetPr() == null || !sh.getCTWorksheet().getSheetPr().isSetTabColor());
sh.setTabColor(IndexedColors.RED.index);
assertTrue(sh.getCTWorksheet().getSheetPr().isSetTabColor());
assertEquals(IndexedColors.RED.index,
sh.getCTWorksheet().getSheetPr().getTabColor().getIndexed());
} finally {
wb.close();
}
}
@Test
public void columnWidthPOI52233() throws Exception {
XSSFWorkbook workbook = new XSSFWorkbook();