package org.apache.poi.xssf;
import org.apache.poi.ss.format.TestCellFormatPart;
-import org.apache.poi.ss.util.TestCellReference;
import org.apache.poi.xssf.eventusermodel.TestXSSFReader;
import org.apache.poi.xssf.extractor.TestXSSFExcelExtractor;
import org.apache.poi.xssf.io.TestLoadSaveXSSF;
import org.apache.poi.xssf.model.TestCommentsTable;
import org.apache.poi.xssf.model.TestSharedStringsTable;
-import org.apache.poi.xssf.model.TestStylesTable;
import org.apache.poi.xssf.usermodel.AllXSSFUsermodelTests;
import org.apache.poi.xssf.util.TestCTColComparator;
import org.apache.poi.xssf.util.TestNumericRanges;
TestLoadSaveXSSF.class,
TestCommentsTable.class,
TestSharedStringsTable.class,
- TestStylesTable.class,
+ //TestStylesTable.class, //converted to junit4
//TestCellReference.class, //converted to junit4
TestCTColComparator.class,
TestNumericRanges.class,
package org.apache.poi.xssf.model;
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-public final class TestStylesTable extends TestCase {
- private String testFile = "Formatting.xlsx";
+public final class TestStylesTable {
+ private static final String testFile = "Formatting.xlsx";
+ @Test
public void testCreateNew() {
StylesTable st = new StylesTable();
assertEquals(0, st._getNumberFormatSize());
}
+ @Test
public void testCreateSaveLoad() {
XSSFWorkbook wb = new XSSFWorkbook();
StylesTable st = wb.getStylesSource();
assertNotNull(XSSFTestDataSamples.writeOutAndReadBack(wb));
}
+ @Test
public void testLoadExisting() {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile);
assertNotNull(workbook.getStylesSource());
assertNotNull(XSSFTestDataSamples.writeOutAndReadBack(workbook));
}
+ @Test
public void testLoadSaveLoad() {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile);
assertNotNull(workbook.getStylesSource());
assertEquals("yyyy/mm/dd", st.getStyleAt(3).getDataFormatString());
}
- public void testPopulateNew() {
+ @Test
+ public void populateNew() {
XSSFWorkbook wb = new XSSFWorkbook();
StylesTable st = wb.getStylesSource();
assertNotNull(XSSFTestDataSamples.writeOutAndReadBack(wb));
}
- public void testPopulateExisting() {
+ @Test
+ public void populateExisting() {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile);
assertNotNull(workbook.getStylesSource());