From f9fd11b856042b5dce7343f99bf841f46ae751af Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Sun, 17 Apr 2016 03:35:58 +0000 Subject: [PATCH] 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 --- .../apache/poi/xssf/usermodel/TestXSSFSheet.java | 16 ++++++++++++++++ .../poi/xssf/usermodel/TestXSSFWorkbook.java | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java index 844e591bc8..7bcd67835a 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java @@ -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(); + } + } } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java index 41cb7e5fec..b0266ee4e6 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java @@ -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(); -- 2.39.5