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:
parent
4e33c06871
commit
48bba39dcf
@ -49,6 +49,7 @@ import org.apache.poi.ss.usermodel.CellCopyPolicy;
|
|||||||
import org.apache.poi.ss.usermodel.ClientAnchor;
|
import org.apache.poi.ss.usermodel.ClientAnchor;
|
||||||
import org.apache.poi.ss.usermodel.FormulaError;
|
import org.apache.poi.ss.usermodel.FormulaError;
|
||||||
import org.apache.poi.ss.usermodel.IgnoredErrorType;
|
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.Row;
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
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());
|
assertEquals("B2:D4", ignoredErrors.get(IgnoredErrorType.EVALUATION_ERROR).iterator().next().formatAsString());
|
||||||
workbook.close();
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ import org.apache.poi.ss.usermodel.BaseTestWorkbook;
|
|||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
import org.apache.poi.ss.usermodel.Font;
|
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.RichTextString;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
@ -543,21 +542,6 @@ public final class TestXSSFWorkbook extends BaseTestWorkbook {
|
|||||||
changeSheetNameWithSharedFormulas("shared_formulas.xlsx");
|
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
|
@Test
|
||||||
public void columnWidthPOI52233() throws Exception {
|
public void columnWidthPOI52233() throws Exception {
|
||||||
XSSFWorkbook workbook = new XSSFWorkbook();
|
XSSFWorkbook workbook = new XSSFWorkbook();
|
||||||
|
Loading…
Reference in New Issue
Block a user