Sonar fixes

JUnit5 test classes and methods should have default package visibility

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885340 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2021-01-10 21:16:04 +00:00
parent cc7cd1caf3
commit 1041a876cb
371 changed files with 463 additions and 472 deletions

View File

@ -23,7 +23,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TestExcelAntPrecision {
class TestExcelAntPrecision {
private ExcelAntPrecision fixture ;

View File

@ -25,7 +25,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TestExcelAntSet {
class TestExcelAntSet {
// This is abstract in nature, so we'll use a

View File

@ -25,7 +25,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TestExcelAntSetDoubleCell {
class TestExcelAntSetDoubleCell {
private ExcelAntSetDoubleCell fixture ;

View File

@ -22,7 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TestExcelAntUserDefinedFunction {
class TestExcelAntUserDefinedFunction {
private ExcelAntUserDefinedFunctionTestHelper fixture ;

View File

@ -23,7 +23,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TestExcelAntEvaluationResult {
class TestExcelAntEvaluationResult {
private ExcelAntEvaluationResult fixture;
private boolean completedWithError;

View File

@ -40,7 +40,7 @@ import org.apache.tools.ant.BuildException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
public class TestExcelAntWorkbookUtil {
class TestExcelAntWorkbookUtil {
private static final String mortgageCalculatorFileName =
TestBuildFile.getDataDir() + "/spreadsheet/excelant.xls" ;

View File

@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for the ExcelAntWorbookUtilFactory.
*/
public class TestExcelAntWorkbookUtilFactory {
class TestExcelAntWorkbookUtilFactory {
private static final String mortgageCalculatorWorkbookFile =
TestBuildFile.getDataDir() + "/spreadsheet/mortgage-calculation.xls" ;

View File

@ -29,6 +29,7 @@ import java.util.zip.ZipException;
import org.apache.poi.EncryptedDocumentException;
import org.apache.poi.OldFileFormatException;
import org.apache.poi.poifs.filesystem.OfficeXmlFileException;
import org.junit.jupiter.api.Test;
/**
* This class is used for mass-regression testing via a
@ -37,7 +38,7 @@ import org.apache.poi.poifs.filesystem.OfficeXmlFileException;
* types of files/exceptions, e.g. old file formats.
*
*/
public class BaseIntegrationTest {
class BaseIntegrationTest {
private final File rootDir;
private final String file;
private FileHandler handler;
@ -48,7 +49,8 @@ public class BaseIntegrationTest {
this.handler = handler;
}
public void test() throws Exception {
@Test
void test() throws Exception {
assertNotNull( handler, "Unknown file extension for file: " + file + ": " + TestAllFiles.getExtension(file) );
testOneFile(new File(rootDir, file));
}

View File

@ -31,7 +31,7 @@ import org.apache.poi.hdgf.streams.TrailerStream;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.junit.jupiter.api.Test;
public class HDGFFileHandler extends POIFSFileHandler {
class HDGFFileHandler extends POIFSFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws IOException {
POIFSFileSystem poifs = new POIFSFileSystem(stream);
@ -54,7 +54,7 @@ public class HDGFFileHandler extends POIFSFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Override
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/diagram/44501.vsd");
InputStream stream = new FileInputStream(file);

View File

@ -32,7 +32,7 @@ import org.apache.poi.poifs.filesystem.FileMagic;
import org.apache.poi.util.LittleEndian;
import org.junit.jupiter.api.Test;
public class HMEFFileHandler extends AbstractFileHandler {
class HMEFFileHandler extends AbstractFileHandler {
@Override
public void handleExtracting(File file) throws Exception {
@ -64,7 +64,7 @@ public class HMEFFileHandler extends AbstractFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
void test() throws Exception {
String path = "test-data/hmef/quick-winmail.dat";
try (InputStream stream = new FileInputStream(path)) {
handleFile(stream, path);

View File

@ -27,7 +27,7 @@ import org.apache.poi.hpbf.extractor.PublisherTextExtractor;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.junit.jupiter.api.Test;
public class HPBFFileHandler extends POIFSFileHandler {
class HPBFFileHandler extends POIFSFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
HPBFDocument pub = new HPBFDocument(new POIFSFileSystem(stream));
@ -42,7 +42,7 @@ public class HPBFFileHandler extends POIFSFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Override
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/publisher/SampleBrochure.pub");
InputStream stream = new FileInputStream(file);

View File

@ -43,7 +43,7 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.TempFile;
import org.junit.jupiter.api.Test;
public class HPSFFileHandler extends POIFSFileHandler {
class HPSFFileHandler extends POIFSFileHandler {
private static final String NL = System.getProperty("line.separator");
private static File copyOutput;
@ -120,7 +120,7 @@ public class HPSFFileHandler extends POIFSFileHandler {
@Override
@Test
@SuppressWarnings("java:S2699")
public void test() throws Exception {
void test() throws Exception {
String path = "test-data/diagram/44501.vsd";
try (InputStream stream = new FileInputStream(path)) {
handleFile(stream, path);
@ -129,7 +129,7 @@ public class HPSFFileHandler extends POIFSFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void testExtractor() {
void testExtractor() {
File file = new File("test-data/hpsf/TestBug44375.xls");
assertDoesNotThrow(() -> handleExtracting(file));
}

View File

@ -29,7 +29,7 @@ import org.apache.poi.util.POILogger;
import org.apache.poi.util.SystemOutLogger;
import org.junit.jupiter.api.Test;
public class HSLFFileHandler extends SlideShowHandler {
class HSLFFileHandler extends SlideShowHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
HSLFSlideShowImpl slide = new HSLFSlideShowImpl(stream);
@ -51,14 +51,14 @@ public class HSLFFileHandler extends SlideShowHandler {
}
@Test
public void testOne() throws Exception {
void testOne() throws Exception {
testOneFile(new File("test-data/slideshow/54880_chinese.ppt"));
}
// a test-case to test all .ppt files without executing the full TestAllFiles
@Override
@Test
public void test() throws Exception {
void test() throws Exception {
File[] files = new File("test-data/slideshow/").listFiles((dir, name) -> name.endsWith(".ppt"));
assertNotNull(files);

View File

@ -27,7 +27,7 @@ import org.apache.poi.hsmf.datatypes.AttachmentChunks;
import org.apache.poi.hsmf.datatypes.DirectoryChunk;
import org.junit.jupiter.api.Test;
public class HSMFFileHandler extends POIFSFileHandler {
class HSMFFileHandler extends POIFSFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
MAPIMessage mapi = new MAPIMessage(stream);
@ -77,7 +77,7 @@ public class HSMFFileHandler extends POIFSFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Override
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/hsmf/logsat.com_signatures_valid.msg");
try (InputStream stream = new FileInputStream(file)) {
handleFile(stream, file.getPath());

View File

@ -36,7 +36,7 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.util.NullPrintStream;
import org.junit.jupiter.api.Test;
public class HSSFFileHandler extends SpreadsheetHandler {
class HSSFFileHandler extends SpreadsheetHandler {
private final POIFSFileHandler delegate = new POIFSFileHandler();
@Override
public void handleFile(InputStream stream, String path) throws Exception {
@ -106,7 +106,7 @@ public class HSSFFileHandler extends SpreadsheetHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/spreadsheet/49219.xls");
try (InputStream stream = new FileInputStream(file)) {
@ -121,7 +121,7 @@ public class HSSFFileHandler extends SpreadsheetHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
@SuppressWarnings("java:S2699")
public void testExtractor() throws Exception {
void testExtractor() throws Exception {
handleExtracting(new File("test-data/spreadsheet/BOOK_in_capitals.xls"));
}
}

View File

@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
* Needs to be implemented in this package to have access to
* HSSFWorkbook.getWorkbook()
*/
public class HSSFRecordsStresser {
class HSSFRecordsStresser {
public static void handleWorkbook(HSSFWorkbook wb) {
List<org.apache.poi.hssf.record.Record> records = wb.getWorkbook().getRecords();
for(org.apache.poi.hssf.record.Record record : records) {
@ -65,7 +65,7 @@ public class HSSFRecordsStresser {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
void test() throws Exception {
try (InputStream stream = new FileInputStream(HSSFTestDataSamples.getSampleFile("15556.xls"))) {
HSSFWorkbook wb = new HSSFWorkbook(stream);
handleWorkbook(wb);

View File

@ -30,7 +30,7 @@ import org.apache.poi.hwpf.model.PicturesTable;
import org.apache.poi.hwpf.usermodel.Picture;
import org.junit.jupiter.api.Test;
public class HWPFFileHandler extends POIFSFileHandler {
class HWPFFileHandler extends POIFSFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
HWPFDocument doc = new HWPFDocument(stream);
@ -49,7 +49,7 @@ public class HWPFFileHandler extends POIFSFileHandler {
@Override
@Test
@SuppressWarnings("java:S2699")
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/document/52117.doc");
try (InputStream stream = new FileInputStream(file)) {
@ -65,7 +65,7 @@ public class HWPFFileHandler extends POIFSFileHandler {
}
@Test
public void testExtractingOld() {
void testExtractingOld() {
File file = new File("test-data/document/52117.doc");
assertDoesNotThrow(() -> handleExtracting(file));
}

View File

@ -30,7 +30,7 @@ import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.xwpf.usermodel.XWPFRelation;
import org.junit.jupiter.api.Test;
public class OPCFileHandler extends AbstractFileHandler {
class OPCFileHandler extends AbstractFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
// ignore password protected files
@ -61,7 +61,7 @@ public class OPCFileHandler extends AbstractFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/diagram/test.vsdx");
try (InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000)) {

View File

@ -30,7 +30,7 @@ import org.apache.poi.hpsf.extractor.HPSFPropertiesExtractor;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.junit.jupiter.api.Test;
public class POIFSFileHandler extends AbstractFileHandler {
class POIFSFileHandler extends AbstractFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
@ -69,7 +69,7 @@ public class POIFSFileHandler extends AbstractFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/poifs/Notes.ole2");
try (InputStream stream = new FileInputStream(file)) {

View File

@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test;
*
* Can also be used to get the appropriate FileHandler for a single file.
*/
public class POIFileScanner {
class POIFileScanner {
private final static File ROOT_DIR;
static {
// when running in Gradle, current directory might be "build/integrationtest"
@ -195,7 +195,7 @@ public class POIFileScanner {
@Disabled
@Test
@SuppressForbidden("Just an ignored test")
public void testInvalidFile() throws IOException, InterruptedException {
void testInvalidFile() throws IOException, InterruptedException {
FileHandler fileHandler = POIFileScanner.getFileHandler(new File("/usbc/CommonCrawl"),
"www.bgs.ac.uk_downloads_directdownload.cfm_id=2362&noexcl=true&t=west_20sussex_20-_20building_20stone_20quarries");
@ -210,13 +210,13 @@ public class POIFileScanner {
}
@Test
public void testDetectUnnamedFile() throws IOException {
void testDetectUnnamedFile() throws IOException {
File root = new File(ROOT_DIR, "spreadsheet");
assertDoesNotThrow(() -> POIFileScanner.detectUnnamedFile(root, "49156.xlsx"));
}
@Test
public void test() throws IOException {
void test() throws IOException {
assertDoesNotThrow(() -> POIFileScanner.scan(ROOT_DIR));
}
}

View File

@ -68,7 +68,7 @@ import org.opentest4j.TestAbortedException;
* here as well! This is to ensure that files that should not work really do not work, e.g.
* that we do not remove expected sanity checks.
*/
public class TestAllFiles {
class TestAllFiles {
private static final File ROOT_DIR = new File("test-data");
private static final boolean IGNORE_SCRATCHPAD = Boolean.getBoolean("scratchpad.ignore");
@ -384,7 +384,7 @@ public class TestAllFiles {
// ... even when using a custom display name generator
@ParameterizedTest(name = "#{index} {0}" )
@MethodSource("files")
public void testAllFiles(String file, FileHandler handler) throws Exception {
void testAllFiles(String file, FileHandler handler) throws Exception {
assertNotNull(handler, "Did not find a handler for file " + file);
// this also removes the password for non encrypted files

View File

@ -23,7 +23,7 @@ import org.apache.poi.openxml4j.opc.PackageAccess;
import org.apache.poi.xdgf.usermodel.XmlVisioDocument;
import org.junit.jupiter.api.Test;
public class XDGFFileHandler extends AbstractFileHandler {
class XDGFFileHandler extends AbstractFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
// ignore password protected files
@ -36,7 +36,7 @@ public class XDGFFileHandler extends AbstractFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
@SuppressWarnings("java:S2699")
public void test() throws Exception {
void test() throws Exception {
try (OPCPackage pkg = OPCPackage.open("test-data/diagram/test.vsdx", PackageAccess.READ)) {
XmlVisioDocument doc = new XmlVisioDocument(pkg);
new POIXMLDocumentHandler().handlePOIXMLDocument(doc);

View File

@ -29,7 +29,7 @@ import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFSlideShow;
import org.junit.jupiter.api.Test;
public class XSLFFileHandler extends SlideShowHandler {
class XSLFFileHandler extends SlideShowHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
XMLSlideShow slide = new XMLSlideShow(stream);
@ -71,7 +71,7 @@ public class XSLFFileHandler extends SlideShowHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Override
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/slideshow/ca.ubc.cs.people_~emhill_presentations_HowWeRefactor.pptx");
try (InputStream stream = new FileInputStream(file)) {
handleFile(stream, file.getPath());

View File

@ -16,7 +16,12 @@
==================================================================== */
package org.apache.poi.stress;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackageAccess;
@ -26,7 +31,7 @@ import org.apache.poi.xssf.extractor.XSSFBEventBasedExcelExtractor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.jupiter.api.Test;
public class XSSFBFileHandler extends AbstractFileHandler {
class XSSFBFileHandler extends AbstractFileHandler {
static {
//add expected failures here:
@ -81,7 +86,7 @@ public class XSSFBFileHandler extends AbstractFileHandler {
}
@Test
public void testLocal() throws Exception {
void testLocal() throws Exception {
File file = new File("test-data/spreadsheet/Simple.xlsb");
try (FileInputStream stream = new FileInputStream(file)) {
handleFile(stream, file.getPath());

View File

@ -57,7 +57,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.jupiter.api.Test;
import org.xml.sax.SAXException;
public class XSSFFileHandler extends SpreadsheetHandler {
class XSSFFileHandler extends SpreadsheetHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
// ignore password protected files if password is unknown
@ -205,7 +205,7 @@ public class XSSFFileHandler extends SpreadsheetHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/spreadsheet/ref-56737.xlsx");
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
@ -216,7 +216,7 @@ public class XSSFFileHandler extends SpreadsheetHandler {
}
@Test
public void testAdditional() throws Exception {
void testAdditional() throws Exception {
handleAdditional(new File("test-data/spreadsheet/poc-xmlbomb.xlsx"));
}
}

View File

@ -24,7 +24,7 @@ import java.io.InputStream;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.junit.jupiter.api.Test;
public class XWPFFileHandler extends AbstractFileHandler {
class XWPFFileHandler extends AbstractFileHandler {
@Override
public void handleFile(InputStream stream, String path) throws Exception {
// ignore password protected files
@ -38,7 +38,7 @@ public class XWPFFileHandler extends AbstractFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
@SuppressWarnings("java:S2699")
public void test() throws Exception {
void test() throws Exception {
File file = new File("test-data/document/51921-Word-Crash067.docx");
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {

View File

@ -24,4 +24,6 @@ module org.apache.poi.stress {
requires org.apache.poi.examples;
exports org.apache.poi.stress;
opens org.apache.poi.stress to org.junit.platform.commons;
}

View File

@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
/**
* Test the COUNTIFS() function
*/
public class CountifsTests {
class TestCountifs {
private Workbook workbook;

View File

@ -40,7 +40,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class ConditionalFormattingEvalTest {
class TestConditionalFormattingEval {
private XSSFWorkbook wb;
private Sheet sheet;

View File

@ -27,7 +27,7 @@ import java.util.TreeMap;
import org.junit.jupiter.api.Test;
public class CombinedIteratorTest {
class TestCombinedIterator {
void testIteration(CombinedIterable<String> iterable, String... expected) {

View File

@ -46,7 +46,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
*
* E.g. verifies that objects are freed when stuff is removed from sheets or rows
*/
public class XSSFMemoryLeakTests {
public class TestXSSFMemoryLeak {
private final MemoryLeakVerifier verifier = new MemoryLeakVerifier();
// keep some items in memory, so checks in tearDown() actually

View File

@ -20,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
public class XWPFAbstractNumTest {
public class TestXWPFAbstractNum {
@Test
void getXmlObject() {

View File

@ -42,7 +42,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
public abstract class BasePPTIteratingTest {
public abstract class BaseTestPPTIterating {
protected static final Set<String> OLD_FILES = new HashSet<>();
static {
OLD_FILES.add("PPT95.ppt");

View File

@ -16,16 +16,15 @@
==================================================================== */
package org.apache.poi.hslf.dev;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
public class TestPPDrawingTextListing extends BasePPTIteratingTest {
public class TestPPDrawingTextListing extends BaseTestPPTIterating {
@Test
void testMain() throws IOException {
// calls System.exit(): PPDrawingTextListing.main(new String[0]);

View File

@ -26,7 +26,7 @@ import org.apache.poi.EmptyFileException;
import org.apache.poi.hslf.HSLFTestDataSamples;
import org.junit.jupiter.api.Test;
public class TestPPTXMLDump extends BasePPTIteratingTest {
public class TestPPTXMLDump extends BaseTestPPTIterating {
@Test
void testMain() throws Exception {
PPTXMLDump.main(new String[0]);

View File

@ -17,7 +17,6 @@
package org.apache.poi.hslf.dev;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.File;
import java.io.IOException;
@ -29,7 +28,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class TestSLWTListing extends BasePPTIteratingTest {
public class TestSLWTListing extends BaseTestPPTIterating {
private static PrintStream oldStdErr;
@BeforeAll

View File

@ -16,16 +16,15 @@
==================================================================== */
package org.apache.poi.hslf.dev;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
public class TestSLWTTextListing extends BasePPTIteratingTest {
public class TestSLWTTextListing extends BaseTestPPTIterating {
@Test
void testMain() throws IOException {
// calls System.exit(): SLWTTextListing.main(new String[0]);

View File

@ -16,17 +16,16 @@
==================================================================== */
package org.apache.poi.hslf.dev;
import org.apache.poi.EmptyFileException;
import org.apache.poi.hslf.HSLFTestDataSamples;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.poi.EmptyFileException;
import org.apache.poi.hslf.HSLFTestDataSamples;
import org.junit.jupiter.api.Test;
public class TestSlideAndNotesAtomListing extends BasePPTIteratingTest {
public class TestSlideAndNotesAtomListing extends BaseTestPPTIterating {
@Test
void testMain() throws IOException {
// calls System.exit(): SlideAndNotesAtomListing.main(new String[0]);

View File

@ -16,17 +16,16 @@
==================================================================== */
package org.apache.poi.hslf.dev;
import org.apache.poi.EmptyFileException;
import org.apache.poi.hslf.HSLFTestDataSamples;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.poi.EmptyFileException;
import org.apache.poi.hslf.HSLFTestDataSamples;
import org.junit.jupiter.api.Test;
public class TestSlideIdListing extends BasePPTIteratingTest {
public class TestSlideIdListing extends BaseTestPPTIterating {
@Test
void testMain() throws IOException {
// calls System.exit(): SlideIdListing.main(new String[0]);

View File

@ -17,7 +17,6 @@
package org.apache.poi.hslf.dev;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.File;
import java.io.FileNotFoundException;
@ -31,7 +30,7 @@ import org.apache.poi.hslf.HSLFTestDataSamples;
import org.apache.poi.util.IOUtils;
import org.junit.jupiter.api.Test;
public class TestSlideShowDumper extends BasePPTIteratingTest {
public class TestSlideShowDumper extends BaseTestPPTIterating {
private static final Set<String> FAILING = new HashSet<>();
static {
FAILING.add("cryptoapi-proc2356.ppt");

View File

@ -17,7 +17,6 @@
package org.apache.poi.hslf.dev;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.File;
import java.io.IOException;
@ -26,7 +25,7 @@ import org.apache.poi.EmptyFileException;
import org.apache.poi.hslf.HSLFTestDataSamples;
import org.junit.jupiter.api.Test;
public class TestSlideShowRecordDumper extends BasePPTIteratingTest {
public class TestSlideShowRecordDumper extends BaseTestPPTIterating {
@Test
void testMain() throws IOException {
SlideShowRecordDumper.main(new String[] {

View File

@ -16,18 +16,17 @@
==================================================================== */
package org.apache.poi.hslf.dev;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
public class TestTextStyleListing extends BasePPTIteratingTest {
public class TestTextStyleListing extends BaseTestPPTIterating {
private static Set<String> FAILING = new HashSet<>();
static {
FAILING.add("empty_textbox.ppt");

View File

@ -16,16 +16,15 @@
==================================================================== */
package org.apache.poi.hslf.dev;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.poi.EmptyFileException;
import org.junit.jupiter.api.Test;
public class TestUserEditAndPersistListing extends BasePPTIteratingTest {
public class TestUserEditAndPersistListing extends BaseTestPPTIterating {
@Test
void testMain() throws IOException {
// calls System.exit(): UserEditAndPersistListing.main(new String[0]);

View File

@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
/**
* Test cases for {@link AbstractWordUtils}
*/
public class AbstractWordUtilsTest {
public class TestAbstractWordUtils {
/**
* Test case for {@link AbstractWordUtils#buildTableCellEdgesArray(Table)}
*/

View File

@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;
public class PlfLfoTest {
public class TestPlfLfo {
@Test
void testAdd() {
PlfLfo p = new PlfLfo(new byte[] {0, 0, 0, 0}, 0, 0);

View File

@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
/**
* Test cases for {@link LFOLVLBaseAbstractType}
*/
public class LFOLVLBaseAbstractTypeTest {
class TestLFOLVLBaseAbstractType {
@Test
void testGetSize() {
assertEquals( 8, LFOLVLBaseAbstractType.getSize() );

View File

@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
/**
* Test cases for {@link LVLFAbstractType}
*/
public class LVLFAbstractTypeTest {
class TestLVLFAbstractType {
@Test
void testGetSize() {
assertEquals( 28, LVLFAbstractType.getSize() );

View File

@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test;
* This is part 1 of 2 of the tests - it only does the POIDocuments
* which are part of the Main (not scratchpad)
*/
public final class TestPOIDocumentMain {
final class TestPOIDocumentMain {
// The POI Documents to work on
private POIDocument doc;
private POIDocument doc2;

View File

@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
/**
* A class for testing the POI Junit TestCase utility class
*/
public final class TestPOITestCase {
final class TestPOITestCase {
@Test
void assertStartsWith() {
POITestCase.assertStartsWith("Apache POI", "");

View File

@ -28,7 +28,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestEscherBSERecord {
final class TestEscherBSERecord {
@Test
void testFillFields() {
String data = "01 00 00 00 24 00 00 00 05 05 01 02 03 04 " +

View File

@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
/**
* Test read/serialize of escher blip records
*/
public final class TestEscherBlipRecord {
final class TestEscherBlipRecord {
private static final POIDataSamples _samples = POIDataSamples.getDDFInstance();
//test reading/serializing of a PNG blip

View File

@ -21,7 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public final class TestEscherBoolProperty {
final class TestEscherBoolProperty {
@Test
void testToString() {
EscherBoolProperty p = new EscherBoolProperty(EscherPropertyTypes.GEOMETRY__FILLOK, 1);

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestEscherChildAnchorRecord {
final class TestEscherChildAnchorRecord {
@Test
void testSerialize() {
EscherChildAnchorRecord r = createRecord();

View File

@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for {@link EscherContainerRecord}
*/
public final class TestEscherContainerRecord {
final class TestEscherContainerRecord {
private static final POIDataSamples _samples = POIDataSamples.getDDFInstance();
@Test

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestEscherDgRecord {
final class TestEscherDgRecord {
@Test
void testSerialize() {
EscherDgRecord r = createRecord();

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestEscherDggRecord {
final class TestEscherDggRecord {
@Test
void testSerialize() {
EscherDggRecord r = createRecord();

View File

@ -27,7 +27,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestEscherOptRecord {
final class TestEscherOptRecord {
@Test
void testFillFields() {

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestEscherSpgrRecord {
final class TestEscherSpgrRecord {
@Test
void testSerialize() {
EscherSpgrRecord r = createRecord();

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestEscherSplitMenuColorsRecord {
final class TestEscherSplitMenuColorsRecord {
@Test
void testSerialize() {
EscherSplitMenuColorsRecord r = createRecord();

View File

@ -25,7 +25,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestUnknownEscherRecord {
final class TestUnknownEscherRecord {
@Test
void testFillFields() {
String testData =

View File

@ -48,7 +48,7 @@ import org.junit.jupiter.api.Test;
/**
* <p>Tests the basic HPSF functionality.</p>
*/
public final class TestBasic {
final class TestBasic {
private static final POIDataSamples samples = POIDataSamples.getHPSFInstance();

View File

@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests ClassID structure.
*/
public final class TestClassID {
final class TestClassID {
private static final byte[] BUF16 = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};

View File

@ -45,7 +45,7 @@ import org.junit.jupiter.api.Test;
* Test case for OLE2 files with empty properties.
* An empty property's type is {@link Variant#VT_EMPTY}.
*/
public final class TestEmptyProperties {
final class TestEmptyProperties {
private static final POIDataSamples samples = POIDataSamples.getHPSFInstance();

View File

@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests various bugs have been fixed
*/
public final class TestHPSFBugs {
final class TestHPSFBugs {
private static final POIDataSamples _samples = POIDataSamples.getHPSFInstance();
/**

View File

@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test;
* This class tests reading and writing of meta data. No actual document is created. All information
* is stored in a virtual document in a ByteArrayOutputStream
*/
public final class TestMetaDataIPI {
final class TestMetaDataIPI {
private POIFSFileSystem poifs ;
private DocumentSummaryInformation dsi;

View File

@ -32,7 +32,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.junit.jupiter.api.Test;
public final class TestHPSFPropertiesExtractor {
final class TestHPSFPropertiesExtractor {
private static final POIDataSamples _samples = POIDataSamples.getHPSFInstance();
@Test

View File

@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for {@link AbortableHSSFListener}
*/
public final class TestAbortableListener {
final class TestAbortableListener {
private POIFSFileSystem openSample() throws IOException {
ByteArrayInputStream is = new ByteArrayInputStream(HSSFITestDataProvider.instance

View File

@ -39,14 +39,13 @@ import org.apache.poi.hssf.record.RecordFactory;
import org.apache.poi.hssf.record.StandardRecord;
import org.apache.poi.hssf.record.TestcaseRecordInputStream;
import org.apache.poi.hssf.record.UnknownRecord;
import org.apache.poi.util.NotImplemented;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* enclosing_type describe the purpose here
*/
public final class TestEventRecordFactory {
final class TestEventRecordFactory {
private static final byte[][] CONTINUE_DATA = {
// an unknown record with 0 length
{0, -1, 0, 0,},

View File

@ -42,7 +42,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for {@link EventWorkbookBuilder}
*/
public final class TestEventWorkbookBuilder {
final class TestEventWorkbookBuilder {
private final List<FormulaRecord> fRecs = new ArrayList<>();
private SheetRecordCollectingListener listener;

View File

@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for FormatTrackingHSSFListener
*/
public final class TestFormatTrackingHSSFListener {
final class TestFormatTrackingHSSFListener {
private FormatTrackingHSSFListener listener;
private MockHSSFListener mockListen;

View File

@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test;
/**
* Testing for {@link HSSFEventFactory}
*/
public final class TestHSSFEventFactory {
final class TestHSSFEventFactory {
private final List<org.apache.poi.hssf.record.Record> records = new ArrayList<>();
private void openSample(String sampleFileName) throws IOException {

View File

@ -45,7 +45,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for MissingRecordAwareHSSFListener
*/
public final class TestMissingRecordAwareHSSFListener {
final class TestMissingRecordAwareHSSFListener {
private final List<org.apache.poi.hssf.record.Record> _records = new ArrayList<>();

View File

@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
/**
*
*/
public final class TestExcelExtractor {
final class TestExcelExtractor {
private static ExcelExtractor createExtractor(String sampleFileName) throws IOException {
File file = HSSFTestDataSamples.getSampleFile(sampleFileName);
POIFSFileSystem fs = new POIFSFileSystem(file);

View File

@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test;
* Unit tests for the Excel 5/95 and Excel 4 (and older) text
* extractor
*/
public final class TestOldExcelExtractor {
final class TestOldExcelExtractor {
private static OldExcelExtractor createExtractor(String sampleFileName) throws IOException {
File file = HSSFTestDataSamples.getSampleFile(sampleFileName);
return new OldExcelExtractor(file);

View File

@ -24,7 +24,7 @@ import org.apache.poi.ddf.EscherDggRecord;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public final class TestDrawingManager2 {
final class TestDrawingManager2 {
private DrawingManager2 drawingManager2;
private EscherDggRecord dgg;

View File

@ -57,7 +57,7 @@ import org.junit.jupiter.api.Test;
* Test the low level formula parser functionality. High level tests are to
* be done via usermodel/HSSFCell.setFormulaValue().
*/
public final class TestFormulaParser {
final class TestFormulaParser {
/**
* @return parsed token array already confirmed not <code>null</code>

View File

@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
* but using parts which need to use
* HSSFFormulaEvaluator.
*/
public final class TestFormulaParserEval {
final class TestFormulaParserEval {
@Test
void testWithNamedRange() {

View File

@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests <tt>FormulaParser</tt> specifically with respect to IF() functions
*/
public final class TestFormulaParserIf {
final class TestFormulaParserIf {
private static Ptg[] parseFormula(String formula) {
return TestFormulaParser.parseFormula(formula);
}

View File

@ -49,7 +49,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for {@link LinkTable}
*/
public final class TestLinkTable {
final class TestLinkTable {
/**
* The example file attached to bugzilla 45046 is a clear example of Name records being present

View File

@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests specific formula examples in <tt>OperandClassTransformer</tt>.
*/
public final class TestOperandClassTransformer {
final class TestOperandClassTransformer {
private static Ptg[] parseFormula(String formula) {
Ptg[] result = HSSFFormulaParser.parse(formula, null);

View File

@ -19,7 +19,6 @@ package org.apache.poi.hssf.model;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import java.util.ArrayList;
import java.util.List;
@ -45,7 +44,7 @@ import org.junit.jupiter.params.provider.MethodSource;
* <tt>OperandClassTransformer</tt> by comparing its results with those
* directly produced by Excel (in a sample spreadsheet).
*/
public final class TestRVA {
final class TestRVA {
private static final String NEW_LINE = System.getProperty("line.separator");
private static POIFSFileSystem poifs;

View File

@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import java.util.Arrays;
@ -39,7 +38,7 @@ import org.junit.jupiter.api.Test;
*
* @author Josh Micich
*/
public final class TestRowBlocksReader {
final class TestRowBlocksReader {
@Test
void testAbnormalPivotTableRecords_bug46280() {
int SXVIEW_SID = ViewDefinitionRecord.sid;

View File

@ -50,7 +50,7 @@ import org.junit.jupiter.api.Test;
/**
* Unit test for the {@link InternalSheet} class.
*/
public final class TestSheet {
final class TestSheet {
private static InternalSheet createSheet(List<org.apache.poi.hssf.record.Record> inRecs) {
return InternalSheet.createSheet(new RecordStream(inRecs, 0));
}

View File

@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.poi.hssf.record.ColumnInfoRecord;
import org.junit.jupiter.api.Test;
public final class TestSheetAdditional {
final class TestSheetAdditional {
@Test
void testGetCellWidth() {
InternalSheet sheet = InternalSheet.createSheet();

View File

@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test;
/**
* Unit test for the Workbook class.
*/
public final class TestWorkbook {
final class TestWorkbook {
@Test
void testFontStuff() throws IOException {
HSSFWorkbook hwb = new HSSFWorkbook();

View File

@ -33,7 +33,7 @@ import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.jupiter.api.Test;
public final class TestArrayRecord {
final class TestArrayRecord {
@Test
void testRead() {

View File

@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests the AutoFilterInfoRecord class.
*/
public final class TestAutoFilterInfoRecord {
final class TestAutoFilterInfoRecord {
private final byte[] data = new byte[] {
0x05, 0x00
};

View File

@ -26,7 +26,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Sheet;
import org.junit.jupiter.api.Test;
public final class TestBOFRecord {
final class TestBOFRecord {
@Test
void testBOFRecord() throws IOException {
// This used to throw an error before - #42794

View File

@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for {@link BoolErrRecord}
*/
public final class TestBoolErrRecord {
final class TestBoolErrRecord {
@Test
void testError() {

View File

@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests BoundSheetRecord.
*/
public final class TestBoundSheetRecord {
final class TestBoundSheetRecord {
@Test
void testRecordLength() {

View File

@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
* Tests the serialization and deserialization of the {@link CFHeaderRecord}
* and {@link CFHeader12Record} classes works correctly.
*/
public final class TestCFHeaderRecord {
final class TestCFHeaderRecord {
@Test
void testCreateCFHeaderRecord () {
CFHeaderRecord record = new CFHeaderRecord();

View File

@ -48,7 +48,7 @@ import org.junit.jupiter.api.Test;
* Tests the serialization and deserialization of the TestCFRuleRecord
* class works correctly.
*/
public final class TestCFRuleRecord {
final class TestCFRuleRecord {
@Test
void testConstructors () throws IOException {
try (HSSFWorkbook workbook = new HSSFWorkbook()) {

View File

@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests for {@link ColumnInfoRecord}
*/
public final class TestColumnInfoRecord {
final class TestColumnInfoRecord {
@Test
void testBasic() {

View File

@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
* class works correctly. Test data taken directly from a real
* Excel file.
*/
public final class TestCommonObjectDataSubRecord {
final class TestCommonObjectDataSubRecord {
byte[] data = new byte[] {
(byte)0x12,(byte)0x00,(byte)0x01,(byte)0x00,
(byte)0x01,(byte)0x00,(byte)0x11,(byte)0x60,

View File

@ -25,7 +25,7 @@ import java.io.ByteArrayInputStream;
import org.apache.poi.util.LittleEndian;
import org.junit.jupiter.api.Test;
public final class TestDVALRecord {
final class TestDVALRecord {
@Test
void testRead() {
byte[] data = new byte[22];

View File

@ -25,7 +25,7 @@ import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.util.HexDump;
import org.junit.jupiter.api.Test;
public final class TestDrawingGroupRecord {
final class TestDrawingGroupRecord {
private static final int MAX_RECORD_SIZE = 8228;
private static final int MAX_DATA_SIZE = MAX_RECORD_SIZE - 4;

View File

@ -29,7 +29,7 @@ import java.util.List;
import org.junit.jupiter.api.Test;
public final class TestDrawingRecord {
final class TestDrawingRecord {
/**
* Check that RecordFactoryInputStream properly handles continued DrawingRecords

View File

@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
* Tests the serialization and deserialization of the TestEmbeddedObjectRefSubRecord
* class works correctly. Test data taken directly from a real Excel file.
*/
public final class TestEmbeddedObjectRefSubRecord {
final class TestEmbeddedObjectRefSubRecord {
private static final short EORSR_SID = EmbeddedObjectRefSubRecord.sid;

View File

@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
* Tests the serialization and deserialization of the EndSubRecord
* class works correctly. Test data taken directly from a real Excel file.
*/
public final class TestEndSubRecord {
final class TestEndSubRecord {
private static final byte[] data = { };
@Test

View File

@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests the EscherAggregate class.
*/
public final class TestEscherAggregate {
final class TestEscherAggregate {
/**
* Tests that the create aggregate method correctly rejoins escher records together.
*/

Some files were not shown because too many files have changed in this diff Show More