--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import org.apache.poi.ss.ITestDataProvider;
+import org.apache.poi.xssf.streaming.SXSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+
+/**
+ * Class for combined testing of XML-specific functionality of
+ * {@link XSSFRow} and {@link SXSSFRow}.
+ *
+ * Any test that is applicable for {@link org.apache.poi.hssf.usermodel.HSSFRow} as well should go into
+ * the common base class {@link BaseTestRow}.
+ */
+public abstract class BaseTestXRow extends BaseTestRow {
+ protected BaseTestXRow(ITestDataProvider testDataProvider) {
+ super(testDataProvider);
+ }
+}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import org.apache.poi.ss.ITestDataProvider;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+
+/**
+ * Class for combined testing of XML-specific functionality of
+ * {@link XSSFSheet} and {@link SXSSFSheet}.
+ *
+ * Any test that is applicable for {@link org.apache.poi.hssf.usermodel.HSSFSheet} as well should go into
+ * the common base class {@link BaseTestSheet}.
+ */
+public abstract class BaseTestXSheet extends BaseTestSheet {
+ protected BaseTestXSheet(ITestDataProvider testDataProvider) {
+ super(testDataProvider);
+ }
+}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import org.apache.poi.ss.ITestDataProvider;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+/**
+ * Class for combined testing of XML-specific functionality of
+ * {@link XSSFWorkbook} and {@link SXSSFWorkbook}.
+ *
+ * Any test that is applicable for {@link org.apache.poi.hssf.usermodel.HSSFWorkbook} as well should go into
+ * the common base class {@link BaseTestWorkbook}.
+ */
+public abstract class BaseTestXWorkbook extends BaseTestWorkbook {
+ protected BaseTestXWorkbook(ITestDataProvider testDataProvider) {
+ super(testDataProvider);
+ }
+}
import java.io.IOException;
import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.ss.usermodel.BaseTestRow;
+import org.apache.poi.ss.usermodel.BaseTestXRow;
import org.apache.poi.xssf.SXSSFITestDataProvider;
import org.junit.After;
import org.junit.Test;
/**
* Tests for XSSFRow
*/
-public final class TestSXSSFRow extends BaseTestRow {
+public final class TestSXSSFRow extends BaseTestXRow {
public TestSXSSFRow() {
super(SXSSFITestDataProvider.instance);
@After
public void tearDown() {
- SXSSFITestDataProvider.instance.cleanup();
+ ((SXSSFITestDataProvider) _testDataProvider).cleanup();
}
@Test
import static org.junit.Assert.fail;
import java.io.IOException;
-import java.util.SortedSet;
-import java.util.TreeSet;
import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.ss.usermodel.BaseTestSheet;
+import org.apache.poi.ss.usermodel.BaseTestXSheet;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.SXSSFITestDataProvider;
import org.junit.Test;
-public class TestSXSSFSheet extends BaseTestSheet {
+public final class TestSXSSFSheet extends BaseTestXSheet {
public TestSXSSFSheet() {
super(SXSSFITestDataProvider.instance);
import org.apache.poi.POIDataSamples;
import org.apache.poi.POITestCase;
-import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.ss.usermodel.BaseTestWorkbook;
+import org.apache.poi.ss.usermodel.BaseTestXWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.junit.Ignore;
import org.junit.Test;
-public final class TestSXSSFWorkbook extends BaseTestWorkbook {
- private static final SXSSFITestDataProvider _testDataProvider = SXSSFITestDataProvider.instance;
+public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
public TestSXSSFWorkbook() {
- super(_testDataProvider);
- }
+ super(SXSSFITestDataProvider.instance);
+ }
@After
public void tearDown(){
- _testDataProvider.cleanup();
+ ((SXSSFITestDataProvider)_testDataProvider).cleanup();
}
/**
import java.io.IOException;
import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.ss.usermodel.BaseTestRow;
+import org.apache.poi.ss.usermodel.BaseTestXRow;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellCopyPolicy;
import org.apache.poi.ss.usermodel.Row;
/**
* Tests for XSSFRow
*/
-public final class TestXSSFRow extends BaseTestRow {
+public final class TestXSSFRow extends BaseTestXRow {
public TestXSSFRow() {
super(XSSFITestDataProvider.instance);
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import java.io.IOException;
import java.util.Arrays;
import org.apache.poi.poifs.crypt.HashAlgorithm;
import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.usermodel.AutoFilter;
-import org.apache.poi.ss.usermodel.BaseTestSheet;
+import org.apache.poi.ss.usermodel.BaseTestXSheet;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellCopyPolicy;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STPane;
-public final class TestXSSFSheet extends BaseTestSheet {
+public final class TestXSSFSheet extends BaseTestXSheet {
public TestXSSFSheet() {
super(XSSFITestDataProvider.instance);
import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart;
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart;
import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.ss.usermodel.BaseTestWorkbook;
+import org.apache.poi.ss.usermodel.BaseTestXWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbookPr;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCalcMode;
-public final class TestXSSFWorkbook extends BaseTestWorkbook {
- private static final XSSFITestDataProvider _testDataProvider = XSSFITestDataProvider.instance;
+public final class TestXSSFWorkbook extends BaseTestXWorkbook {
public TestXSSFWorkbook() {
- super(_testDataProvider);
+ super(XSSFITestDataProvider.instance);
}
/**
*/
public abstract class BaseTestRow {
- private final ITestDataProvider _testDataProvider;
+ protected final ITestDataProvider _testDataProvider;
protected BaseTestRow(ITestDataProvider testDataProvider) {
_testDataProvider = testDataProvider;
@Rule
public ExpectedException thrown = ExpectedException.none();
- private final ITestDataProvider _testDataProvider;
+ protected final ITestDataProvider _testDataProvider;
protected BaseTestSheet(ITestDataProvider testDataProvider) {
- _testDataProvider = testDataProvider;
+ _testDataProvider = testDataProvider;
}
protected void trackColumnsForAutoSizingIfSXSSF(Sheet sheet) {
public abstract class BaseTestWorkbook {
- private final ITestDataProvider _testDataProvider;
+ protected final ITestDataProvider _testDataProvider;
protected BaseTestWorkbook(ITestDataProvider testDataProvider) {
- _testDataProvider = testDataProvider;
+ _testDataProvider = testDataProvider;
}
@Test