Sonar fixes

JUnit5 test classes and methods should have default package visibility

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885318 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2021-01-09 20:19:07 +00:00
parent b4133f5e23
commit b0870699e3
110 changed files with 465 additions and 466 deletions

View File

@ -429,7 +429,7 @@ public class TestExtractorFactory {
* "No supported documents found in the OLE2 stream"
*/
@Test
public void bug59074() throws Exception {
void bug59074() throws Exception {
try (POITextExtractor extractor = ex("59074.xls")) {
String text = extractor.getText();
assertContains(text, "Exotic warrant");

View File

@ -74,7 +74,7 @@ public final class TestPOIXMLDocument {
throw new RuntimeException("not supported");
}
public void parse(POIXMLFactory factory) throws IOException{
void parse(POIXMLFactory factory) throws IOException{
load(factory);
}
}
@ -285,7 +285,7 @@ public final class TestPOIXMLDocument {
}
@Test
public void dontParseEmbeddedDocuments() throws IOException {
void dontParseEmbeddedDocuments() throws IOException {
// bug #62513
POIDataSamples pds = POIDataSamples.getSlideShowInstance();
try (InputStream is = pds.openResourceAsStream("bug62513.pptx");

View File

@ -55,7 +55,7 @@ public final class TestPOIXMLProperties {
private CoreProperties _coreProperties;
@BeforeEach
public void setUp() throws IOException {
void setUp() throws IOException {
sampleDoc = XWPFTestDataSamples.openSampleDocument("documentProperties.docx");
sampleNoThumb = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx");
assertNotNull(sampleDoc);
@ -66,7 +66,7 @@ public final class TestPOIXMLProperties {
}
@AfterEach
public void closeResources() throws Exception {
void closeResources() throws Exception {
sampleDoc.close();
sampleNoThumb.close();
}

View File

@ -105,11 +105,11 @@ public class OOXMLLiteAgent {
Pattern includes;
final Set<Integer> hashes = new HashSet<>();
public void setPattern(String regex) {
void setPattern(String regex) {
includes = Pattern.compile(regex);
}
public void load(String path) throws IOException {
void load(String path) throws IOException {
this.logPath = Paths.get(path);
if (Files.exists(this.logPath)) {
try (Stream<String> stream = Files.lines(this.logPath)) {

View File

@ -39,7 +39,7 @@ public final class TestListParts {
private TreeMap<PackagePartName, String> values;
@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
values = new TreeMap<>();
// Expected values

View File

@ -107,7 +107,7 @@ public final class TestPackage {
* Test that just opening and closing the file doesn't alter the document.
*/
@Test
public void openSave() throws IOException, InvalidFormatException {
void openSave() throws IOException, InvalidFormatException {
String originalFile = getSampleFileName("TestPackageCommon.docx");
File targetFile = getOutputFile("TestPackageOpenSaveTMP.docx");
@ -131,7 +131,7 @@ public final class TestPackage {
* the correct default content types
*/
@Test
public void createGetsContentTypes()
void createGetsContentTypes()
throws IOException, InvalidFormatException, SecurityException, IllegalArgumentException {
File targetFile = getOutputFile("TestCreatePackageTMP.docx");
@ -157,7 +157,7 @@ public final class TestPackage {
* Test package creation.
*/
@Test
public void createPackageAddPart() throws IOException, InvalidFormatException {
void createPackageAddPart() throws IOException, InvalidFormatException {
File targetFile = getOutputFile("TestCreatePackageTMP.docx");
File expectedFile = getSampleFile("TestCreatePackageOUTPUT.docx");
@ -202,7 +202,7 @@ public final class TestPackage {
* have everything setup as expected
*/
@Test
public void createPackageWithCoreDocument() throws IOException, InvalidFormatException, URISyntaxException, SAXException {
void createPackageWithCoreDocument() throws IOException, InvalidFormatException, URISyntaxException, SAXException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (OPCPackage pkg = OPCPackage.create(baos)) {
@ -296,7 +296,7 @@ public final class TestPackage {
* Test package opening.
*/
@Test
public void openPackage() throws IOException, InvalidFormatException {
void openPackage() throws IOException, InvalidFormatException {
File targetFile = getOutputFile("TestOpenPackageTMP.docx");
File inputFile = getSampleFile("TestOpenPackageINPUT.docx");
@ -351,7 +351,7 @@ public final class TestPackage {
* to a file
*/
@Test
public void saveToOutputStream() throws IOException, InvalidFormatException {
void saveToOutputStream() throws IOException, InvalidFormatException {
String originalFile = getSampleFileName("TestPackageCommon.docx");
File targetFile = getOutputFile("TestPackageOpenSaveTMP.docx");
@ -378,7 +378,7 @@ public final class TestPackage {
* reading from a file
*/
@Test
public void openFromInputStream() throws IOException, InvalidFormatException {
void openFromInputStream() throws IOException, InvalidFormatException {
String originalFile = getSampleFileName("TestPackageCommon.docx");
try (FileInputStream finp = new FileInputStream(originalFile);
@ -402,7 +402,7 @@ public final class TestPackage {
*/
@Test
@Disabled
public void removePartRecursive() throws IOException, InvalidFormatException, URISyntaxException {
void removePartRecursive() throws IOException, InvalidFormatException, URISyntaxException {
String originalFile = getSampleFileName("TestPackageCommon.docx");
File targetFile = getOutputFile("TestPackageRemovePartRecursiveOUTPUT.docx");
File tempFile = getOutputFile("TestPackageRemovePartRecursiveTMP.docx");
@ -420,7 +420,7 @@ public final class TestPackage {
}
@Test
public void deletePart() throws InvalidFormatException, IOException {
void deletePart() throws InvalidFormatException, IOException {
final TreeMap<PackagePartName, String> expectedValues = new TreeMap<>();
final TreeMap<PackagePartName, String> values = new TreeMap<>();
@ -460,7 +460,7 @@ public final class TestPackage {
}
@Test
public void deletePartRecursive() throws InvalidFormatException, IOException {
void deletePartRecursive() throws InvalidFormatException, IOException {
final TreeMap<PackagePartName, String> expectedValues = new TreeMap<>();
final TreeMap<PackagePartName, String> values = new TreeMap<>();
@ -498,7 +498,7 @@ public final class TestPackage {
* write changes to it.
*/
@Test
public void openFileThenOverwrite() throws IOException, InvalidFormatException {
void openFileThenOverwrite() throws IOException, InvalidFormatException {
File tempFile = TempFile.createTempFile("poiTesting","tmp");
File origFile = getSampleFile("TestPackageCommon.docx");
FileHelper.copyFile(origFile, tempFile);
@ -534,7 +534,7 @@ public final class TestPackage {
* to another file, then delete both
*/
@Test
public void openFileThenSaveDelete() throws IOException, InvalidFormatException {
void openFileThenSaveDelete() throws IOException, InvalidFormatException {
File tempFile = TempFile.createTempFile("poiTesting","tmp");
File tempFile2 = TempFile.createTempFile("poiTesting","tmp");
File origFile = getSampleFile("TestPackageCommon.docx");
@ -556,7 +556,7 @@ public final class TestPackage {
}
@Test
public void getPartsByName() throws InvalidFormatException, IOException {
void getPartsByName() throws InvalidFormatException, IOException {
String filepath = getSampleFileName("sample.docx");
try (OPCPackage pkg = OPCPackage.open(filepath, PackageAccess.READ_WRITE)) {
@ -582,7 +582,7 @@ public final class TestPackage {
}
@Test
public void getPartSize() throws IOException, InvalidFormatException {
void getPartSize() throws IOException, InvalidFormatException {
String filepath = getSampleFileName("sample.docx");
try (OPCPackage pkg = OPCPackage.open(filepath, PackageAccess.READ)) {
int checked = 0;
@ -612,7 +612,7 @@ public final class TestPackage {
}
@Test
public void replaceContentType() throws IOException, InvalidFormatException {
void replaceContentType() throws IOException, InvalidFormatException {
try (InputStream is = openSampleStream("sample.xlsx");
OPCPackage p = OPCPackage.open(is)) {
try {
@ -638,7 +638,7 @@ public final class TestPackage {
"SampleSS.ods, org.apache.poi.openxml4j.exceptions.ODFNotOfficeXmlFileException, The supplied data appears to be in ODF, Formats like these (eg ODS",
"SampleSS.txt, org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException, No valid entries or contents found, not a valid OOXML"
})
public void NonOOXML_File(String file, String exClazzStr, String msg1, String msg2) throws Exception {
void NonOOXML_File(String file, String exClazzStr, String msg1, String msg2) throws Exception {
Class<? extends Exception> exClazz = (Class<? extends Exception>)Class.forName(exClazzStr);
try (InputStream stream = xlsSamples.openResourceAsStream(file)) {
@ -659,7 +659,7 @@ public final class TestPackage {
* see bug #50090 / #56865
*/
@Test
public void zipBombCreateAndHandle()
void zipBombCreateAndHandle()
throws IOException, EncryptedDocumentException {
ByteArrayOutputStream bos = new ByteArrayOutputStream(2500000);
@ -777,7 +777,7 @@ public final class TestPackage {
}
@Test
public void zipBombCheckSizesWithinLimits() throws IOException, EncryptedDocumentException {
void zipBombCheckSizesWithinLimits() throws IOException, EncryptedDocumentException {
getZipStatsAndConsume((max_size, min_ratio) -> {
// use values close to, but within the limits
ZipSecureFile.setMinInflateRatio(min_ratio - 0.002);
@ -788,7 +788,7 @@ public final class TestPackage {
}
@Test
public void zipBombCheckSizesRatioTooSmall() {
void zipBombCheckSizesRatioTooSmall() {
POIXMLException ex = assertThrows(
POIXMLException.class,
() -> getZipStatsAndConsume((max_size, min_ratio) -> {
@ -800,7 +800,7 @@ public final class TestPackage {
}
@Test
public void zipBombCheckSizesSizeTooBig() throws EncryptedDocumentException {
void zipBombCheckSizesSizeTooBig() throws EncryptedDocumentException {
POIXMLException ex = assertThrows(
POIXMLException.class,
() -> getZipStatsAndConsume((max_size, min_ratio) -> {
@ -924,7 +924,7 @@ public final class TestPackage {
}
@Test
public void unparseableCentralDirectory() throws IOException {
void unparseableCentralDirectory() throws IOException {
File f = getSampleFile("at.pzp.www_uploads_media_PP_Scheinecker-jdk6error.pptx");
try (SlideShow<?,?> ppt = SlideShowFactory.create(f, null, true)) {
assertNotNull(ppt);

View File

@ -54,7 +54,7 @@ public class TestOPCCompliancePackageModel {
}
@BeforeEach
public void tearDown() {
void tearDown() {
if (TESTFILE.exists()) {
assertTrue(TESTFILE.delete());
}

View File

@ -142,7 +142,7 @@ public final class TestContentTypeManager {
}
@Test
public void bug62629CombinePictures() throws Exception {
void bug62629CombinePictures() throws Exception {
// this file has incorrect default content-types which caused problems in Apache POI
// we now handle this broken file more gracefully
XSSFWorkbook book = XSSFTestDataSamples.openSampleWorkbook("62629_target.xlsm");

View File

@ -49,18 +49,18 @@ public class TestZipPackagePropertiesMarshaller {
@Test
public void nonZipOutputStream() {
void nonZipOutputStream() {
OutputStream notAZipOutputStream = new ByteArrayOutputStream(0);
assertThrows(IllegalArgumentException.class, () -> marshall(notAZipOutputStream));
}
@Test
public void withZipOutputStream() throws Exception {
void withZipOutputStream() throws Exception {
assertTrue(marshall());
}
@Test
public void ioException() throws Exception {
void ioException() {
ZipArchiveOutputStream zos = new ZipArchiveOutputStream(new ByteArrayOutputStream()) {
@Override
public void putArchiveEntry(final ArchiveEntry archiveEntry) throws IOException {

View File

@ -200,7 +200,7 @@ public class TestSignatureInfo {
@Disabled("This test is very sensitive, it breaks with every little change to the produced XML")
@Test
public void bug61182() throws Exception {
void bug61182() throws Exception {
final String pfxInput =
"H4sIAAAAAAAAAFXTfzzTeRwH8P2uGRmG6hKSmJh9a2HsuPy60VnHCEU6v86sieZH2Jr2qFl+s+ZHJ5tfUcfKb4uho/OjiFq1qTv5ceFyp0PqEK"+
"fH4+66++Pz+Dwer9fj8f7r9cRzEd4QMBTPRWxDIM14ZN47NfAWsJgL34Bx4at4Lvwdngvd9b8KqgbjQpGbMXzzgRGovytVFTBEzIXU47kQCd4U"+
@ -287,7 +287,7 @@ public class TestSignatureInfo {
}
@Test
public void office2007prettyPrintedRels() throws Exception {
void office2007prettyPrintedRels() throws Exception {
try (OPCPackage pkg = OPCPackage.open(testdata.getFile("office2007prettyPrintedRels.docx"), PackageAccess.READ)) {
SignatureConfig sic = new SignatureConfig();
SignatureInfo si = new SignatureInfo();
@ -299,7 +299,7 @@ public class TestSignatureInfo {
}
@Test
public void getSignerUnsigned() throws Exception {
void getSignerUnsigned() throws Exception {
String[] testFiles = {
"hello-world-unsigned.docx",
"hello-world-unsigned.pptx",
@ -327,7 +327,7 @@ public class TestSignatureInfo {
}
@Test
public void getSigner() throws Exception {
void getSigner() throws Exception {
String[] testFiles = {
"hyperlink-example-signed.docx",
"hello-world-signed.docx",
@ -367,7 +367,7 @@ public class TestSignatureInfo {
}
@Test
public void getMultiSigners() throws Exception {
void getMultiSigners() throws Exception {
String testFile = "hello-world-signed-twice.docx";
try (OPCPackage pkg = OPCPackage.open(testdata.getFile(testFile), PackageAccess.READ)) {
SignatureConfig sic = new SignatureConfig();
@ -739,7 +739,7 @@ public class TestSignatureInfo {
}
@Test
public void bug58630() throws Exception {
void bug58630() throws Exception {
// test deletion of sheet 0 and signing
File tpl = copy(testdata.getFile("bug58630.xlsx"));
try (SXSSFWorkbook wb1 = new SXSSFWorkbook((XSSFWorkbook)WorkbookFactory.create(tpl), 10)) {

View File

@ -44,7 +44,7 @@ public class TestDecryptor {
private static final POIDataSamples samples = POIDataSamples.getPOIFSInstance();
@Test
public void passwordVerification() throws IOException, GeneralSecurityException {
void passwordVerification() throws IOException, GeneralSecurityException {
try (InputStream is = samples.openResourceAsStream("protect.xlsx");
POIFSFileSystem fs = new POIFSFileSystem(is)) {
EncryptionInfo info = new EncryptionInfo(fs);
@ -54,7 +54,7 @@ public class TestDecryptor {
}
@Test
public void decrypt() throws IOException, GeneralSecurityException {
void decrypt() throws IOException, GeneralSecurityException {
try (InputStream is = samples.openResourceAsStream("protect.xlsx");
POIFSFileSystem fs = new POIFSFileSystem(is)) {
EncryptionInfo info = new EncryptionInfo(fs);
@ -65,7 +65,7 @@ public class TestDecryptor {
}
@Test
public void agile() throws IOException, GeneralSecurityException {
void agile() throws IOException, GeneralSecurityException {
try (InputStream is = samples.openResourceAsStream("protected_agile.docx");
POIFSFileSystem fs = new POIFSFileSystem(is)) {
EncryptionInfo info = new EncryptionInfo(fs);
@ -98,7 +98,7 @@ public class TestDecryptor {
}
@Test
public void dataLength() throws Exception {
void dataLength() throws Exception {
try (InputStream fsIs = samples.openResourceAsStream("protected_agile.docx");
POIFSFileSystem fs = new POIFSFileSystem(fsIs)) {
EncryptionInfo info = new EncryptionInfo(fs);
@ -128,7 +128,7 @@ public class TestDecryptor {
}
@Test
public void bug57080() throws Exception {
void bug57080() throws Exception {
// the test file contains a wrong ole entry size, produced by extenxls
// the fix limits the available size and tries to read all entries
File f = samples.getFile("extenxls_pwd123.xlsx");
@ -163,7 +163,7 @@ public class TestDecryptor {
}
@Test
public void bug60320() throws IOException, GeneralSecurityException {
void bug60320() throws IOException, GeneralSecurityException {
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
assumeTrue(maxKeyLen == 0x7FFFFFFF, "Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256");

View File

@ -68,7 +68,7 @@ import org.junit.jupiter.api.Test;
public class TestEncryptor {
@Test
public void binaryRC4Encryption() throws Exception {
void binaryRC4Encryption() throws Exception {
// please contribute a real sample file, which is binary rc4 encrypted
// ... at least the output can be opened in Excel Viewer
String password = "pass";
@ -107,7 +107,7 @@ public class TestEncryptor {
}
@Test
public void tempFileAgileEncryption() throws Exception {
void tempFileAgileEncryption() throws Exception {
String password = "pass";
final byte[] payloadExpected;
@ -144,7 +144,7 @@ public class TestEncryptor {
}
@Test
public void agileEncryption() throws Exception {
void agileEncryption() throws Exception {
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
assumeTrue(maxKeyLen == 0x7FFFFFFF, "Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256");
@ -243,7 +243,7 @@ public class TestEncryptor {
}
@Test
public void standardEncryption() throws Exception {
void standardEncryption() throws Exception {
File file = POIDataSamples.getDocumentInstance().getFile("bug53475-password-is-solrcell.docx");
final String pass = "solrcell";
@ -334,7 +334,7 @@ public class TestEncryptor {
* http://stackoverflow.com/questions/28593223
*/
@Test
public void encryptPackageWithoutCoreProperties() throws Exception {
void encryptPackageWithoutCoreProperties() throws Exception {
// Open our file without core properties
final byte[] encBytes;
try (InputStream is = POIDataSamples.getOpenXML4JInstance().openResourceAsStream("OPCCompliance_NoCoreProperties.xlsx");
@ -384,7 +384,7 @@ public class TestEncryptor {
@Test
@Disabled
public void inPlaceRewrite() throws Exception {
void inPlaceRewrite() throws Exception {
File f = TempFile.createTempFile("protected_agile", ".docx");
try (FileOutputStream fos = new FileOutputStream(f);
@ -460,7 +460,7 @@ public class TestEncryptor {
* the default way of defining the encryption settings is via the EncryptionInfo class
*/
@Test
public void bug60320CustomEncrypt() throws Exception {
void bug60320CustomEncrypt() throws Exception {
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
assumeTrue(maxKeyLen == 0x7FFFFFFF, "Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256");
@ -594,7 +594,7 @@ public class TestEncryptor {
}
@Test
public void smallFile() throws IOException, GeneralSecurityException {
void smallFile() throws IOException, GeneralSecurityException {
// see https://stackoverflow.com/questions/61463301
final int tinyFileSize = 80_000_000;
final String pass = "s3cr3t";

View File

@ -73,7 +73,7 @@ public class TestHxxFEncryption {
@ParameterizedTest
@MethodSource("data")
public void extract(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
void extract(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
File f = sampleDir.getFile(file);
Biff8EncryptionKey.setCurrentUserPassword(password);
try (POITextExtractor te = ExtractorFactory.createExtractor(f)) {
@ -86,13 +86,13 @@ public class TestHxxFEncryption {
@ParameterizedTest
@MethodSource("data")
public void changePassword(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
void changePassword(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
newPassword("test", sampleDir, file, password, expected);
}
@ParameterizedTest
@MethodSource("data")
public void removePassword(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
void removePassword(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
newPassword(null, sampleDir, file, password, expected);
}
@ -118,7 +118,7 @@ public class TestHxxFEncryption {
/** changing the encryption mode and key size in poor mans style - see comments below */
@ParameterizedTest
@MethodSource("data")
public void changeEncryption(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
void changeEncryption(POIDataSamples sampleDir, String file, String password, String expected) throws IOException {
File f = sampleDir.getFile(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Biff8EncryptionKey.setCurrentUserPassword(password);

View File

@ -50,7 +50,7 @@ public class TestSecureTempZip {
* which are streamed into POI opposed to having everything in memory
*/
@Test
public void protectedTempZip() throws IOException, GeneralSecurityException, XmlException, OpenXML4JException {
void protectedTempZip() throws IOException, GeneralSecurityException, XmlException, OpenXML4JException {
File tikaProt = XSSFTestDataSamples.getSampleFile("protected_passtika.xlsx");
FileInputStream fis = new FileInputStream(tikaProt);
POIFSFileSystem poifs = new POIFSFileSystem(fis);
@ -91,7 +91,7 @@ public class TestSecureTempZip {
* Now try with xlsb.
*/
@Test
public void protectedXLSBZip() throws IOException, GeneralSecurityException, XmlException, OpenXML4JException {
void protectedXLSBZip() throws IOException, GeneralSecurityException, XmlException, OpenXML4JException {
//The test file requires that JCE unlimited be installed.
//If it isn't installed, skip this test.
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");

View File

@ -79,7 +79,7 @@ public class TestFonts {
}
@Test
public void resizeToFitTextHSLF() throws IOException {
void resizeToFitTextHSLF() throws IOException {
assumeFalse(xslfOnly());
SlideShow<?,?> ppt = SlideShowFactory.create(false);
resizeToFitText(ppt);
@ -87,7 +87,7 @@ public class TestFonts {
}
@Test
public void resizeToFitTextXSLF() throws IOException {
void resizeToFitTextXSLF() throws IOException {
SlideShow<?,?> ppt = new XMLSlideShow();
resizeToFitText(ppt);
ppt.close();

View File

@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
public class TestHeadersFooters {
@Test
public void bug58144c() throws IOException {
void bug58144c() throws IOException {
SlideShow<?,?> ppt = openSampleSlideshow("bug58144-headers-footers-2007.pptx");
testSlideShow(ppt);
ppt.close();

View File

@ -113,7 +113,7 @@ public class TestOleShape {
@ParameterizedTest
@MethodSource("data")
public void embedData(Api api, ObjectMetaData.Application app) throws IOException, ReflectiveOperationException {
void embedData(Api api, ObjectMetaData.Application app) throws IOException, ReflectiveOperationException {
final ByteArrayInputStream pptBytes;
try (SlideShow<?,?> ppt = createSlideShow(api)) {
final PictureData picData = ppt.addPicture(pictureFile, PictureType.EMF);

View File

@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
public class TestSlide {
@Test
public void hideHSLF() throws IOException {
void hideHSLF() throws IOException {
assumeFalse(xslfOnly());
try (SlideShow<?,?> ppt1 = SlideShowFactory.create(false)) {
hideSlide(ppt1);
@ -46,7 +46,7 @@ public class TestSlide {
}
@Test
public void hideXSLF() throws IOException {
void hideXSLF() throws IOException {
try (SlideShow<?,?> ppt1 = new XMLSlideShow()) {
hideSlide(ppt1);
}

View File

@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test;
public class TestTable {
@Test
public void colWidthRowHeight() throws IOException {
void colWidthRowHeight() throws IOException {
assumeFalse(xslfOnly());
// Test of table dimensions of same slideshow saved as ppt/x
@ -93,7 +93,7 @@ public class TestTable {
}
@Test
public void directionHSLF() throws IOException {
void directionHSLF() throws IOException {
assumeFalse(xslfOnly());
SlideShow<?,?> ppt1 = SlideShowFactory.create(false);
testTextDirection(ppt1);
@ -101,7 +101,7 @@ public class TestTable {
}
@Test
public void directionXSLF() throws IOException {
void directionXSLF() throws IOException {
SlideShow<?,?> ppt1 = new XMLSlideShow();
testTextDirection(ppt1);
ppt1.close();
@ -145,7 +145,7 @@ public class TestTable {
}
@Test
public void tableSpan() throws IOException {
void tableSpan() throws IOException {
String[] files = (xslfOnly()) ? new String[]{"bug60993.pptx"} : new String[]{"bug60993.pptx", "bug60993.ppt"};
for (String f : files) {
SlideShow<?,?> ppt = openSampleSlideshow(f);

View File

@ -44,7 +44,7 @@ public class TestEmbeddedExtractor {
private static final POIDataSamples samples = POIDataSamples.getSpreadSheetInstance();
@Test
public void extractPDFfromEMF() throws Exception {
void extractPDFfromEMF() throws Exception {
InputStream fis = samples.openResourceAsStream("Basic_Expense_Template_2011.xls");
Workbook wb = WorkbookFactory.create(fis);
fis.close();
@ -72,7 +72,7 @@ public class TestEmbeddedExtractor {
}
@Test
public void extractFromXSSF() throws IOException, EncryptedDocumentException, InvalidFormatException {
void extractFromXSSF() throws IOException, EncryptedDocumentException, InvalidFormatException {
InputStream fis = samples.openResourceAsStream("58325_db.xlsx");
Workbook wb = WorkbookFactory.create(fis);
fis.close();

View File

@ -47,7 +47,7 @@ public class CountifsTests {
* initialize a workbook
*/
@BeforeEach
public void before() {
void before() {
// not sure why we allow this, COUNTIFS() is only available
// in OOXML, it was introduced with Office 2007
workbook = new HSSFWorkbook();
@ -57,7 +57,7 @@ public class CountifsTests {
* Close the workbook if needed
*/
@AfterEach
public void after() {
void after() {
IOUtils.closeQuietly(workbook);
}

View File

@ -52,7 +52,7 @@ public class TestVlookup {
}
@Test
public void bug62275_true() throws IOException {
void bug62275_true() throws IOException {
try (Workbook wb = new XSSFWorkbook()) {
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);
@ -69,7 +69,7 @@ public class TestVlookup {
}
@Test
public void bug62275_false() throws IOException {
void bug62275_false() throws IOException {
try (Workbook wb = new XSSFWorkbook()) {
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);
@ -86,7 +86,7 @@ public class TestVlookup {
}
@Test
public void bug62275_empty_3args() throws IOException {
void bug62275_empty_3args() throws IOException {
try (Workbook wb = new XSSFWorkbook()) {
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);
@ -103,7 +103,7 @@ public class TestVlookup {
}
@Test
public void bug62275_empty_2args() throws IOException {
void bug62275_empty_2args() throws IOException {
try (Workbook wb = new XSSFWorkbook()) {
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);
@ -120,7 +120,7 @@ public class TestVlookup {
}
@Test
public void bug62275_empty_1arg() throws IOException {
void bug62275_empty_1arg() throws IOException {
try (Workbook wb = new XSSFWorkbook()) {
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);

View File

@ -50,14 +50,14 @@ public class ConditionalFormattingEvalTest {
private List<EvaluationConditionalFormatRule> rules;
@BeforeEach
public void openWB() {
void openWB() {
wb = XSSFTestDataSamples.openSampleWorkbook("ConditionalFormattingSamples.xlsx");
formulaEval = new XSSFFormulaEvaluator(wb);
cfe = new ConditionalFormattingEvaluator(wb, formulaEval);
}
@AfterEach
public void closeWB() {
void closeWB() {
formulaEval = null;
cfe = null;
ref = null;

View File

@ -78,7 +78,7 @@ public class TestEmbedOLEPackage {
}
@Test
public void embedPDF() throws IOException {
void embedPDF() throws IOException {
try (InputStream is = ssamples.openResourceAsStream("bug64512_embed.xlsx");
XSSFWorkbook wb = new XSSFWorkbook(is)) {
List<XSSFObjectData> oleShapes = new ArrayList<>();
@ -146,7 +146,7 @@ public class TestEmbedOLEPackage {
}
@Test
public void embedXSSF() throws IOException {
void embedXSSF() throws IOException {
Workbook wb1 = new XSSFWorkbook();
addEmbeddedObjects(wb1);
@ -158,7 +158,7 @@ public class TestEmbedOLEPackage {
}
@Test
public void embedHSSF() throws IOException {
void embedHSSF() throws IOException {
assumeFalse(xslfOnly());
HSSFWorkbook wb1 = new HSSFWorkbook();

View File

@ -43,7 +43,7 @@ public class TestXSSFRangeCopier extends BaseTestRangeCopier {
}
@BeforeEach
public void init() {
void init() {
workbook = XSSFTestDataSamples.openSampleWorkbook("tile-range-test.xlsx");
initSheets();
rangeCopier = new XSSFRangeCopier(sheet1, sheet1);
@ -51,12 +51,12 @@ public class TestXSSFRangeCopier extends BaseTestRangeCopier {
}
@AfterEach
public void shutdown() throws IOException {
void shutdown() throws IOException {
workbook.close();
}
@Test // XSSF only. HSSF version wouldn't be so simple. And also this test is contained in following, more complex tests, so it's not really important.
public void copyRow() {
void copyRow() {
Row existingRow = sheet1.getRow(4);
XSSFRow newRow = (XSSFRow)sheet1.getRow(5);
CellCopyPolicy policy = new CellCopyPolicy();

View File

@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
public class TestXSSFPropertyTemplate {
@Test
public void applyBorders() throws IOException {
void applyBorders() throws IOException {
CellRangeAddress a1c3 = new CellRangeAddress(0, 2, 0, 2);
CellRangeAddress b2 = new CellRangeAddress(1, 1, 1, 1);
PropertyTemplate pt = new PropertyTemplate();
@ -99,7 +99,7 @@ public class TestXSSFPropertyTemplate {
}
@Test
public void clonePropertyTemplate() throws IOException {
void clonePropertyTemplate() throws IOException {
CellRangeAddress a1c3 = new CellRangeAddress(0, 2, 0, 2);
PropertyTemplate pt = new PropertyTemplate();
pt.drawBorders(a1c3, BorderStyle.MEDIUM, IndexedColors.RED.getIndex(), BorderExtent.ALL);

View File

@ -83,13 +83,13 @@ public class TestTempFileThreaded {
}
@BeforeEach
public void setUp() {
void setUp() {
// Initialize array to allow to summarize afterwards
executions = new int[NUMBER_OF_THREADS];
}
@Test
public void runTest() throws Throwable {
void runTest() throws Throwable {
List<Thread> threads = new LinkedList<>();
// start all threads
@ -124,7 +124,7 @@ public class TestTempFileThreaded {
}
}
public void doEnd(int threadNum) {
void doEnd(int threadNum) {
for (File file : files.get(threadNum)) {
if (!file.exists()) {
throw new IllegalStateException("File " + file + " does not exist");
@ -135,7 +135,7 @@ public class TestTempFileThreaded {
}
}
public void run(int threadNum, int iter) throws Exception {
void run(int threadNum, int iter) throws Exception {
try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
SXSSFSheet sheet = wb.createSheet("test");

View File

@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
public class TestXDDFChartExtensionList {
@Test
public void getXmlObject() {
void getXmlObject() {
// minimal test to include generated classes in poi-ooxml-lite
XDDFChartExtensionList list = new XDDFChartExtensionList();
assertNotNull(list.getXmlObject());

View File

@ -54,7 +54,7 @@ public class TestXDDFChartRemoveSeries {
* scatter chart.
*/
@BeforeEach
public void setup() {
void setup() {
final boolean bDebug = false;
workbook = new XSSFWorkbook();
sheet = workbook.createSheet();
@ -99,7 +99,7 @@ public class TestXDDFChartRemoveSeries {
* This method writes the workbook to resultDir/fileName.
*/
@AfterEach
public void cleanup() {
void cleanup() {
if (workbook == null) {
System.out.println(String.format(Locale.ROOT, "%s: workbook==null", procName));
return;

View File

@ -36,13 +36,13 @@ public class TestXDGFVisioExtractor {
private XmlVisioDocument xml;
@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
pkg = OPCPackage.open(SAMPLES.openResourceAsStream("test_text_extraction.vsdx"));
xml = new XmlVisioDocument(pkg);
}
@AfterEach
public void closeResources() throws IOException {
void closeResources() throws IOException {
if(xml != null) {
xml.close();
}

View File

@ -127,7 +127,7 @@ public class TestXSLFBugs {
}
@Test
public void bug62929() throws Exception {
void bug62929() throws Exception {
try (XMLSlideShow ss1 = openSampleDocument("missing-blip-fill.pptx")) {
assertEquals(1, ss1.getSlides().size());
@ -146,7 +146,7 @@ public class TestXSLFBugs {
}
@Test
public void bug62736() throws Exception {
void bug62736() throws Exception {
XMLSlideShow ss1 = openSampleDocument("bug62736.pptx");
assertEquals(1, ss1.getSlides().size());
@ -228,7 +228,7 @@ public class TestXSLFBugs {
}
@Test
public void bug61589() throws IOException {
void bug61589() throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (XMLSlideShow src = new XMLSlideShow();
XMLSlideShow dest = new XMLSlideShow()) {
@ -275,7 +275,7 @@ public class TestXSLFBugs {
}
@Test
public void bug62587() throws IOException {
void bug62587() throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (XMLSlideShow ppt = new XMLSlideShow()) {
Slide<?, ?> slide = ppt.createSlide();
@ -326,7 +326,7 @@ public class TestXSLFBugs {
@Test
public void bug60499() throws IOException, InvalidFormatException {
void bug60499() throws IOException, InvalidFormatException {
InputStream is = slTests.openResourceAsStream("bug60499.pptx");
byte[] buf = IOUtils.toByteArray(is);
is.close();
@ -370,7 +370,7 @@ public class TestXSLFBugs {
}
@Test
public void bug51187() throws Exception {
void bug51187() throws Exception {
XMLSlideShow ss1 = openSampleDocument("51187.pptx");
assertEquals(1, ss1.getSlides().size());
@ -411,7 +411,7 @@ public class TestXSLFBugs {
* Slide relations with anchors in them
*/
@Test
public void tika705() throws Exception {
void tika705() throws Exception {
XMLSlideShow ss = openSampleDocument("with_japanese.pptx");
// Should have one slide
@ -455,7 +455,7 @@ public class TestXSLFBugs {
* rID2 -> slide3.xml
*/
@Test
public void bug54916() throws IOException {
void bug54916() throws IOException {
try (XMLSlideShow ss = openSampleDocument("OverlappingRelations.pptx")) {
XSLFSlide slide;
@ -484,7 +484,7 @@ public class TestXSLFBugs {
* gives a NPE, see bug #56812
*/
@Test
public void bug56812() throws Exception {
void bug56812() throws Exception {
XMLSlideShow ppt = openSampleDocument("56812.pptx");
int internalPictures = 0;
@ -527,7 +527,7 @@ public class TestXSLFBugs {
}
@Test
public void bug57250() throws Exception {
void bug57250() throws Exception {
XMLSlideShow ss = new XMLSlideShow();
for (String s : new String[]{"Slide1", "Slide2"}) {
ss.createSlide().createTextBox().setText(s);
@ -677,7 +677,7 @@ public class TestXSLFBugs {
}
@Test
public void bug58205() throws IOException {
void bug58205() throws IOException {
XMLSlideShow ss = openSampleDocument("themes.pptx");
int i = 1;
@ -689,14 +689,14 @@ public class TestXSLFBugs {
}
@Test
public void bug55791a() throws IOException {
void bug55791a() throws IOException {
XMLSlideShow ppt = openSampleDocument("45541_Footer.pptx");
removeAndCreateSlide(ppt);
ppt.close();
}
@Test
public void bug55791b() throws IOException {
void bug55791b() throws IOException {
XMLSlideShow ppt = openSampleDocument("SampleShow.pptx");
removeAndCreateSlide(ppt);
ppt.close();
@ -709,7 +709,7 @@ public class TestXSLFBugs {
}
@Test
public void blibFillAlternateContent() throws IOException {
void blibFillAlternateContent() throws IOException {
XMLSlideShow ppt = openSampleDocument("2411-Performance_Up.pptx");
XSLFPictureShape ps = (XSLFPictureShape) ppt.getSlides().get(4).getShapes().get(0);
assertNotNull(ps.getPictureData());
@ -717,7 +717,7 @@ public class TestXSLFBugs {
}
@Test
public void bug59434() throws IOException {
void bug59434() throws IOException {
String url1 = "https://poi.apache.org/changes.html";
String url2 = "https://poi.apache.org/faq.html";
XMLSlideShow ppt1 = new XMLSlideShow();
@ -744,7 +744,7 @@ public class TestXSLFBugs {
}
@Test
public void bug58217() throws IOException {
void bug58217() throws IOException {
Color fillColor = new Color(1f, 1f, 0f, 0.1f);
Color lineColor = new Color(25.3f / 255f, 1f, 0f, 0.4f);
Color textColor = new Color(1f, 1f, 0f, 0.6f);
@ -782,7 +782,7 @@ public class TestXSLFBugs {
}
@Test
public void bug55714() throws IOException {
void bug55714() throws IOException {
XMLSlideShow srcPptx = openSampleDocument("pptx2svg.pptx");
XMLSlideShow newPptx = new XMLSlideShow();
XSLFSlide srcSlide = srcPptx.getSlides().get(0);
@ -808,7 +808,7 @@ public class TestXSLFBugs {
}
@Test
public void bug59273() throws IOException {
void bug59273() throws IOException {
XMLSlideShow ppt = openSampleDocument("bug59273.potx");
ppt.getPackage().replaceContentType(
XSLFRelation.PRESENTATIONML_TEMPLATE.getContentType(),
@ -828,7 +828,7 @@ public class TestXSLFBugs {
@Test
public void bug60373() throws IOException {
void bug60373() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide sl = ppt.createSlide();
XSLFTable t = sl.createTable();
@ -852,14 +852,14 @@ public class TestXSLFBugs {
}
@Test
public void bug60715() throws IOException {
void bug60715() throws IOException {
try (XMLSlideShow ppt = openSampleDocument("bug60715.pptx")) {
assertDoesNotThrow((ThrowingSupplier<XSLFSlide>) ppt::createSlide);
}
}
@Test
public void bug60662() throws IOException {
void bug60662() throws IOException {
XMLSlideShow src = new XMLSlideShow();
XSLFSlide sl = src.createSlide();
XSLFGroupShape gs = sl.createGroup();
@ -938,7 +938,7 @@ public class TestXSLFBugs {
}
@Test
public void bug62051() throws IOException {
void bug62051() throws IOException {
final Function<List<XSLFShape>, int[]> ids = (shapes) ->
shapes.stream().mapToInt(Shape::getShapeId).toArray();
@ -966,7 +966,7 @@ public class TestXSLFBugs {
}
@Test
public void bug63200() throws Exception {
void bug63200() throws Exception {
try (XMLSlideShow ss1 = openSampleDocument("63200.pptx")) {
assertEquals(1, ss1.getSlides().size());
@ -983,7 +983,7 @@ public class TestXSLFBugs {
}
@Test
public void alternateContent() throws Exception {
void alternateContent() throws Exception {
try (XMLSlideShow ppt = openSampleDocument("alterman_security.pptx")) {
XSLFSlideMaster slide = ppt.getSlideMasters().get(0);
XSLFObjectShape os = (XSLFObjectShape) slide.getShapes().get(0);
@ -1005,7 +1005,7 @@ public class TestXSLFBugs {
@Test
public void bug57796() throws IOException {
void bug57796() throws IOException {
assumeFalse(xslfOnly);
try (SlideShow<?, ?> ppt = SlideShowFactory.create(slTests.getFile("WithLinks.ppt"))) {

View File

@ -47,12 +47,12 @@ public class TestXSLFSlideShow {
private OPCPackage pack;
@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
pack = OPCPackage.open(slTests.openResourceAsStream("sample.pptx"));
}
@AfterEach
public void tearDown() throws IOException {
void tearDown() throws IOException {
pack.close();
}

View File

@ -299,7 +299,7 @@ public class TestXSLFPowerPointExtractor {
@Test
public void bug54570() throws IOException {
void bug54570() throws IOException {
try (XMLSlideShow xml = openPPTX("bug54570.pptx");
SlideShowExtractor<XSLFShape, XSLFTextParagraph> extractor = new SlideShowExtractor<>(xml)) {
String text = extractor.getText();
@ -314,7 +314,7 @@ public class TestXSLFPowerPointExtractor {
}
@Test
public void setSlTests() throws IOException {
void setSlTests() throws IOException {
try (XMLSlideShow xml = openPPTX("aascu.org_hbcu_leadershipsummit_cooper_.pptx")) {
SlideShowExtractor<XSLFShape, XSLFTextParagraph> extractor = new SlideShowExtractor<>(xml);
assertNotNull(extractor);

View File

@ -78,7 +78,7 @@ public class TestPPTX2PNG {
// use filename instead of File object to omit full pathname in test name
@ParameterizedTest
@MethodSource("data")
public void render(String pptFile) throws Exception {
void render(String pptFile) throws Exception {
assumeFalse(xslfOnly && pptFile.matches(".*\\.(ppt|emf|wmf)$"), "ignore HSLF (.ppt) / HEMF (.emf) / HWMF (.wmf) files in no-scratchpad run");
PPTX2PNG.main(getArgs(pptFile, "null"));
if (svgFiles.contains(pptFile)) {

View File

@ -46,12 +46,12 @@ public class TestXMLSlideShow extends BaseTestSlideShow<XSLFShape, XSLFTextParag
}
@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
pack = OPCPackage.open(slTests.openResourceAsStream("sample.pptx"));
}
@AfterEach
public void tearDown() {
void tearDown() {
pack.revert();
}

View File

@ -57,7 +57,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeType;
*/
public class TestXSLFExamples {
@Test
public void LinkVideoToPptx() throws IOException, URISyntaxException {
void LinkVideoToPptx() throws IOException, URISyntaxException {
String videoFileName = "file_example_MP4_640_3MG.mp4";
File previewJpg = POIDataSamples.getDocumentInstance().getFile("abstract1.jpg");

View File

@ -105,7 +105,7 @@ public class TestXSLFHyperlink {
@Test
public void bug47291() throws IOException {
void bug47291() throws IOException {
Rectangle2D anchor = new Rectangle2D.Double(100,100,100,100);
XMLSlideShow ppt1 = new XMLSlideShow();
XSLFSlide slide1 = ppt1.createSlide();

View File

@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
public class TestXSLFNotes {
@Test
public void createNewNote() throws IOException {
void createNewNote() throws IOException {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide1 = ppt.createSlide();
@ -56,7 +56,7 @@ public class TestXSLFNotes {
}
@Test
public void addNote() throws IOException {
void addNote() throws IOException {
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("sample.pptx");
@ -79,7 +79,7 @@ public class TestXSLFNotes {
}
@Test
public void replaceNotes() throws IOException {
void replaceNotes() throws IOException {
XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("sample.pptx");

View File

@ -222,7 +222,7 @@ public class TestXSLFPictureShape {
}
@Test
public void bug58663() throws IOException {
void bug58663() throws IOException {
InputStream is = _slTests.openResourceAsStream("shapes.pptx");
XMLSlideShow ppt = new XMLSlideShow(is);
is.close();
@ -256,7 +256,7 @@ public class TestXSLFPictureShape {
@Test
public void renderSvgImage() throws Exception {
void renderSvgImage() throws Exception {
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();

View File

@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
*/
public class TestXSLFShapeContainer {
public void verifyContainer(XSLFShapeContainer container) {
void verifyContainer(XSLFShapeContainer container) {
container.clear();
assertEquals(0, container.getShapes().size());

View File

@ -279,7 +279,7 @@ public class TestXSLFTable {
}
@Test
public void removeTable() throws IOException {
void removeTable() throws IOException {
XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("shapes.pptx");
XSLFSlide sl = ss.getSlides().get(0);
XSLFTable tab = (XSLFTable)sl.getShapes().get(4);
@ -297,7 +297,7 @@ public class TestXSLFTable {
}
@Test
public void checkTextHeight() throws IOException {
void checkTextHeight() throws IOException {
// from bug 59686
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide sl = ppt.createSlide();
@ -317,7 +317,7 @@ public class TestXSLFTable {
}
@Test
public void checkNullPointerException() throws IOException {
void checkNullPointerException() throws IOException {
String file = "au.asn.aes.www_conferences_2011_presentations_Fri_20Room4Level4_20930_20Maloney.pptx";
try (XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument(file)) {
Dimension pgsize = ss.getPageSize();

View File

@ -36,7 +36,7 @@ public class TestXSLFTableRow {
/** Copied from {@link TestXSLFTable#testRead()} */
@BeforeEach
public void setUp() throws IOException {
void setUp() throws IOException {
ppt = XSLFTestDataSamples.openSampleDocument("shapes.pptx");
XSLFSlide slide = ppt.getSlides().get(3);
@ -47,14 +47,14 @@ public class TestXSLFTableRow {
}
@AfterEach
public void tearDown() throws IOException {
void tearDown() throws IOException {
ppt.getPackage().revert();
ppt.close();
}
@Test
public void constructor() {
void constructor() {
XSLFTableRow row2 = new XSLFTableRow(row.getXmlObject(), tbl);
assertSame(row.getXmlObject(), row2.getXmlObject());
assertEquals(row.getHeight(), row2.getHeight(), 1e-16);
@ -69,7 +69,7 @@ public class TestXSLFTableRow {
/** copied from {@link TestXSLFTable#testCreate()} */
@Test
public void getCells() {
void getCells() {
List<XSLFTableCell> cells = row.getCells();
assertNotNull(cells);
assertEquals(3, cells.size());
@ -87,7 +87,7 @@ public class TestXSLFTableRow {
/** copied from {@link TestXSLFTable#testCreate()} */
@Test
public void addCell() {
void addCell() {
XSLFTableCell cell = row.addCell();
assertNotNull(cell);
@ -101,7 +101,7 @@ public class TestXSLFTableRow {
}
@Test
public void mergeCells() {
void mergeCells() {
assertThrows(IllegalArgumentException.class, () -> row.mergeCells(0, 0),
"expected IllegalArgumentException when merging fewer than 2 columns");
@ -114,14 +114,14 @@ public class TestXSLFTableRow {
}
@Test
public void getXmlObject() {
void getXmlObject() {
CTTableRow ctrow = row.getXmlObject();
assertNotNull(ctrow);
}
@Test
public void getShapeNameOfCells() throws Exception {
void getShapeNameOfCells() throws Exception {
try(XMLSlideShow ss1 = XSLFTestDataSamples.openSampleDocument("table_test.pptx")) {
for (XSLFSlide slide : ss1.getSlides()) {
for (XSLFShape shape : slide.getShapes()) {

View File

@ -950,7 +950,7 @@ public class TestXSLFTextShape {
}
@Test
public void metroBlob() throws IOException, ReflectiveOperationException {
void metroBlob() throws IOException, ReflectiveOperationException {
assumeFalse(xslfOnly);
File f = POIDataSamples.getSlideShowInstance().getFile("bug52297.ppt");
SlideShow<?,?> ppt = SlideShowFactory.create(f);

View File

@ -32,13 +32,13 @@ public class TestSheetProtection {
private XSSFSheet sheet;
@BeforeEach
public void setUp() {
void setUp() {
workbook = XSSFTestDataSamples.openSampleWorkbook("sheetProtection_not_protected.xlsx");
sheet = workbook.getSheetAt(0);
}
@AfterEach
public void tearDown() throws IOException {
void tearDown() throws IOException {
workbook.close();
}

View File

@ -47,7 +47,7 @@ import org.junit.jupiter.api.Test;
public class TestWorkbookProtection {
@Test
public void workbookAndRevisionPassword() throws Exception {
void workbookAndRevisionPassword() throws Exception {
String password = "test";
// validate password with an actual office file (Excel 2010)
@ -96,7 +96,7 @@ public class TestWorkbookProtection {
}
@Test
public void shouldReadWorkbookProtection() throws Exception {
void shouldReadWorkbookProtection() throws Exception {
try (XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx")) {
assertFalse(workbook.isStructureLocked());
assertFalse(workbook.isWindowsLocked());
@ -123,7 +123,7 @@ public class TestWorkbookProtection {
}
@Test
public void shouldWriteStructureLock() throws Exception {
void shouldWriteStructureLock() throws Exception {
try (XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx")) {
assertFalse(workbook.isStructureLocked());
@ -138,7 +138,7 @@ public class TestWorkbookProtection {
}
@Test
public void shouldWriteWindowsLock() throws Exception {
void shouldWriteWindowsLock() throws Exception {
try (XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx")) {
assertFalse(workbook.isWindowsLocked());
@ -153,7 +153,7 @@ public class TestWorkbookProtection {
}
@Test
public void shouldWriteRevisionLock() throws Exception {
void shouldWriteRevisionLock() throws Exception {
try (XSSFWorkbook workbook = openSampleWorkbook("workbookProtection_not_protected.xlsx")) {
assertFalse(workbook.isRevisionLocked());

View File

@ -43,7 +43,7 @@ public class TestXSSFCloneSheet extends BaseTestCloneSheet {
private XSSFWorkbook wb;
@BeforeEach
public void setUp() {
void setUp() {
wb = new XSSFWorkbook();
wb.createSheet(VALID_SHEET_NAME);
}

View File

@ -55,7 +55,7 @@ public class XSSFMemoryLeakTests {
private final List<Object> references = new ArrayList<>();
@AfterEach
public void tearDown() {
void tearDown() {
verifier.assertGarbageCollected();
}

View File

@ -168,7 +168,7 @@ public class TestXSSFBReader {
private class TestSheetHandler implements XSSFSheetXMLHandler.SheetContentsHandler {
private final StringBuilder sb = new StringBuilder();
public void startSheet(String sheetName) {
void startSheet(String sheetName) {
sb.append("<sheet name=\"").append(sheetName).append(">");
}

View File

@ -29,7 +29,7 @@ public class TestXSSFEventBasedExcelExtractorUsingFactory extends TestXSSFEventB
}
@AfterEach
public void tearDown() {
void tearDown() {
// reset setting to not affect other tests
ExtractorFactory.setAllThreadsPreferEventExtractors(null);
}

View File

@ -37,7 +37,7 @@ public final class TestXSSFExcelExtractorUsingFactory extends TestXSSFExcelExtra
}
@AfterEach
public void tearDown() {
void tearDown() {
// reset setting to not affect other tests
ExtractorFactory.setAllThreadsPreferEventExtractors(null);
}

View File

@ -54,7 +54,7 @@ public class TestCommentsTable {
private static final String TEST_AUTHOR = "test author";
@Test
public void findAuthor() {
void findAuthor() {
CommentsTable sheetComments = new CommentsTable();
assertEquals(1, sheetComments.getNumberOfAuthors());
assertEquals(0, sheetComments.findAuthor(""));
@ -68,7 +68,7 @@ public class TestCommentsTable {
}
@Test
public void getCellComment() {
void getCellComment() {
CommentsTable sheetComments = new CommentsTable();
CTComments comments = sheetComments.getCTComments();
@ -94,7 +94,7 @@ public class TestCommentsTable {
@Test
public void existing() throws IOException {
void existing() throws IOException {
try (Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithVariousData.xlsx")) {
Sheet sheet1 = workbook.getSheetAt(0);
Sheet sheet2 = workbook.getSheetAt(1);
@ -126,7 +126,7 @@ public class TestCommentsTable {
}
@Test
public void writeRead() throws IOException {
void writeRead() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithVariousData.xlsx")) {
XSSFSheet sheet1 = workbook.getSheetAt(0);
XSSFSheet sheet2 = workbook.getSheetAt(1);
@ -175,7 +175,7 @@ public class TestCommentsTable {
}
@Test
public void readWriteMultipleAuthors() throws IOException {
void readWriteMultipleAuthors() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithMoreVariousData.xlsx")) {
XSSFSheet sheet1 = workbook.getSheetAt(0);
XSSFSheet sheet2 = workbook.getSheetAt(1);
@ -213,7 +213,7 @@ public class TestCommentsTable {
}
@Test
public void removeComment() {
void removeComment() {
final CellAddress addrA1 = new CellAddress("A1");
final CellAddress addrA2 = new CellAddress("A2");
final CellAddress addrA3 = new CellAddress("A3");
@ -248,7 +248,7 @@ public class TestCommentsTable {
}
@Test
public void bug54920() throws IOException {
void bug54920() throws IOException {
final Workbook workbook = new XSSFWorkbook();
final Sheet sheet = workbook.createSheet("sheet01");
// create anchor

View File

@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
public final class TestExternalLinksTable {
@Test
public void none() throws IOException {
void none() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("SampleSS.xlsx")) {
assertNotNull(wb.getExternalLinksTable());
assertEquals(0, wb.getExternalLinksTable().size());
@ -38,7 +38,7 @@ public final class TestExternalLinksTable {
}
@Test
public void basicRead() throws IOException {
void basicRead() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("ref-56737.xlsx")) {
assertNotNull(wb.getExternalLinksTable());
assertEquals(1, wb.getExternalLinksTable().size());
@ -68,7 +68,7 @@ public final class TestExternalLinksTable {
}
@Test
public void basicReadWriteRead() throws IOException {
void basicReadWriteRead() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("ref-56737.xlsx")) {
Name name = wb.getExternalLinksTable().get(0).getDefinedNames().get(1);
name.setNameName("Testing");
@ -93,7 +93,7 @@ public final class TestExternalLinksTable {
}
@Test
public void readWithReferencesToTwoExternalBooks() throws IOException {
void readWithReferencesToTwoExternalBooks() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("ref2-56737.xlsx")) {
assertNotNull(wb.getExternalLinksTable());
assertEquals(2, wb.getExternalLinksTable().size());

View File

@ -104,7 +104,7 @@ public final class TestStylesTable {
}
}
public void doTestExisting(StylesTable st) {
void doTestExisting(StylesTable st) {
// Check contents
assertNotNull(st.getCTStylesheet());
assertEquals(11, st._getXfsSize());
@ -132,7 +132,7 @@ public final class TestStylesTable {
}
@Test
public void populateNew() throws IOException {
void populateNew() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
StylesTable st = wb.getStylesSource();
@ -164,7 +164,7 @@ public final class TestStylesTable {
}
@Test
public void populateExisting() throws IOException {
void populateExisting() throws IOException {
try (XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile)) {
assertNotNull(workbook.getStylesSource());
@ -192,7 +192,7 @@ public final class TestStylesTable {
}
@Test
public void exceedNumberFormatLimit() throws IOException {
void exceedNumberFormatLimit() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
StylesTable styles = wb.getStylesSource();
for (int i = 0; i < styles.getMaxNumberOfDataFormats(); i++) {
@ -216,7 +216,7 @@ public final class TestStylesTable {
}
@Test
public void removeNumberFormat() throws IOException {
void removeNumberFormat() throws IOException {
try (XSSFWorkbook wb1 = new XSSFWorkbook()) {
final String fmt = customDataFormat;
final short fmtIdx = (short) wb1.getStylesSource().putNumberFormat(fmt);
@ -269,7 +269,7 @@ public final class TestStylesTable {
}
@Test
public void maxNumberOfDataFormats() throws IOException {
void maxNumberOfDataFormats() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
StylesTable styles = wb.getStylesSource();
@ -292,7 +292,7 @@ public final class TestStylesTable {
}
@Test
public void addDataFormatsBeyondUpperLimit() throws IOException {
void addDataFormatsBeyondUpperLimit() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
StylesTable styles = wb.getStylesSource();
styles.setMaxNumberOfDataFormats(0);
@ -304,7 +304,7 @@ public final class TestStylesTable {
}
@Test
public void decreaseUpperLimitBelowCurrentNumDataFormats() throws IOException {
void decreaseUpperLimitBelowCurrentNumDataFormats() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
StylesTable styles = wb.getStylesSource();
styles.putNumberFormat(customDataFormat);

View File

@ -162,7 +162,7 @@ public class TestThemesTable {
* Note - Grey Row has an odd way of doing the styling...
*/
@Test
public void themedAndNonThemedColours() throws IOException {
void themedAndNonThemedColours() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook(testFileComplex)) {
XSSFSheet sheet = wb.getSheetAt(0);

View File

@ -63,14 +63,14 @@ public class TestAutoSizeColumnTracker {
private final static String LONG_MESSAGE = "This is a test of a long message! This is a test of a long message!";
@BeforeEach
public void setUpSheetAndWorkbook() {
void setUpSheetAndWorkbook() {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();
tracker = new AutoSizeColumnTracker(sheet);
}
@AfterEach
public void tearDownSheetAndWorkbook() throws IOException {
void tearDownSheetAndWorkbook() throws IOException {
if (sheet != null) {
sheet.dispose();
}
@ -80,7 +80,7 @@ public class TestAutoSizeColumnTracker {
}
@Test
public void trackAndUntrackColumn() {
void trackAndUntrackColumn() {
assumeTrue(tracker.getTrackedColumns().isEmpty());
tracker.trackColumn(0);
Set<Integer> expected = new HashSet<>();
@ -91,7 +91,7 @@ public class TestAutoSizeColumnTracker {
}
@Test
public void trackAndUntrackColumns() {
void trackAndUntrackColumns() {
assumeTrue(tracker.getTrackedColumns().isEmpty());
tracker.trackColumns(columns);
assertEquals(columns, tracker.getTrackedColumns());
@ -108,14 +108,14 @@ public class TestAutoSizeColumnTracker {
}
@Test
public void trackAndUntrackAllColumns() {
void trackAndUntrackAllColumns() {
createColumnsAndTrackThemAll();
tracker.untrackAllColumns();
assertTrue(tracker.getTrackedColumns().isEmpty());
}
@Test
public void isColumnTracked() {
void isColumnTracked() {
assumeFalse(tracker.isColumnTracked(0));
tracker.trackColumn(0);
assertTrue(tracker.isColumnTracked(0));
@ -124,7 +124,7 @@ public class TestAutoSizeColumnTracker {
}
@Test
public void isColumnTrackedAndTrackAllColumns() {
void isColumnTrackedAndTrackAllColumns() {
createColumnsAndTrackThemAll();
tracker.untrackColumn(0);
SortedSet<Integer> _newColumns = new TreeSet<>();
@ -136,7 +136,7 @@ public class TestAutoSizeColumnTracker {
}
@Test
public void getTrackedColumns() {
void getTrackedColumns() {
assumeTrue(tracker.getTrackedColumns().isEmpty());
for (int column : columns) {
@ -148,7 +148,7 @@ public class TestAutoSizeColumnTracker {
}
@Test
public void isAllColumnsTracked() {
void isAllColumnsTracked() {
assertFalse(tracker.isAllColumnsTracked());
tracker.trackAllColumns();
assertTrue(tracker.isAllColumnsTracked());
@ -157,7 +157,7 @@ public class TestAutoSizeColumnTracker {
}
@Test
public void updateColumnWidths_and_getBestFitColumnWidth() {
void updateColumnWidths_and_getBestFitColumnWidth() {
tracker.trackAllColumns();
Row row1 = sheet.createRow(0);
Row row2 = sheet.createRow(1);

View File

@ -49,7 +49,7 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
}
@AfterEach
public void tearDown() {
void tearDown() {
((DeferredSXSSFITestDataProvider) _testDataProvider).cleanup();
}
@ -82,14 +82,14 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
@Override
@Disabled("DeferredSXSSF code disposes rows in a way that breaks this test")
public void parentReferences() {}
protected void parentReferences() {}
@Override
@Disabled("DeferredSXSSF code disposes rows in a way that breaks this test")
public void unicodeInAll() {}
protected void unicodeInAll() {}
@Test
public void existingWorkbook() throws IOException {
void existingWorkbook() throws IOException {
XSSFWorkbook xssfWb1 = new XSSFWorkbook();
xssfWb1.createSheet("S1");
DeferredSXSSFWorkbook wb1 = new DeferredSXSSFWorkbook(xssfWb1);
@ -110,7 +110,7 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void addToExistingWorkbook() throws IOException {
void addToExistingWorkbook() throws IOException {
XSSFWorkbook xssfWb1 = new XSSFWorkbook();
xssfWb1.createSheet("S1");
Sheet sheet = xssfWb1.createSheet("S2");
@ -189,7 +189,7 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void sheetdataWriter() throws IOException {
void sheetdataWriter() throws IOException {
DeferredSXSSFWorkbook wb = new DeferredSXSSFWorkbook();
SXSSFSheet sh = wb.createSheet();
assertSame(sh.getClass(), DeferredSXSSFSheet.class);
@ -199,7 +199,7 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void removeSheet() throws IOException {
void removeSheet() throws IOException {
try (DeferredSXSSFWorkbook wb = new DeferredSXSSFWorkbook()) {
DeferredSXSSFSheet sheet1 = wb.createSheet("sheet1");
sheet1.setRowGenerator((sh) -> {
@ -224,7 +224,7 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void gzipSheetdataWriter() throws IOException {
void gzipSheetdataWriter() throws IOException {
DeferredSXSSFWorkbook wb = new DeferredSXSSFWorkbook();
final int rowNum = 1000;
@ -255,7 +255,7 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void workbookDispose() throws IOException {
void workbookDispose() throws IOException {
DeferredSXSSFWorkbook wb1 = new DeferredSXSSFWorkbook();
// the underlying writer is SheetDataWriter
assertWorkbookDispose(wb1);
@ -304,7 +304,7 @@ public final class TestDeferredSXSSFWorkbook extends BaseTestXWorkbook {
}
}
public void changeSheetNameWithSharedFormulas() {
void changeSheetNameWithSharedFormulas() {
/* not implemented */
}
}

View File

@ -95,14 +95,14 @@ public class TestSXSSFCell extends BaseTestXCell {
}
@Test
public void getCachedFormulaResultType_throwsISE_whenNotAFormulaCell() {
void getCachedFormulaResultType_throwsISE_whenNotAFormulaCell() {
SXSSFCell instance = new SXSSFCell(null, CellType.BLANK);
assertThrows(IllegalStateException.class, instance::getCachedFormulaResultType);
}
@Test
public void setCellValue_withTooLongRichTextString_throwsIAE() {
void setCellValue_withTooLongRichTextString_throwsIAE() {
Cell cell = spy(new SXSSFCell(null, CellType.BLANK));
int length = SpreadsheetVersion.EXCEL2007.getMaxTextLength() + 1;
String string = new String(new byte[length], StandardCharsets.UTF_8).replace("\0", "x");
@ -111,21 +111,21 @@ public class TestSXSSFCell extends BaseTestXCell {
}
@Test
public void getArrayFormulaRange_returnsNull() {
void getArrayFormulaRange_returnsNull() {
Cell cell = new SXSSFCell(null, CellType.BLANK);
CellRangeAddress result = cell.getArrayFormulaRange();
assertNull(result);
}
@Test
public void isPartOfArrayFormulaGroup_returnsFalse() {
void isPartOfArrayFormulaGroup_returnsFalse() {
Cell cell = new SXSSFCell(null, CellType.BLANK);
boolean result = cell.isPartOfArrayFormulaGroup();
assertFalse(result);
}
@Test
public void getErrorCellValue_returns0_onABlankCell() {
void getErrorCellValue_returns0_onABlankCell() {
Cell cell = new SXSSFCell(null, CellType.BLANK);
assertEquals(CellType.BLANK, cell.getCellType());
byte result = cell.getErrorCellValue();

View File

@ -32,7 +32,7 @@ public class TestSXSSFEvaluationSheet extends BaseTestXEvaluationSheet {
private List<Workbook> workbooksToClose = new ArrayList<>();
@AfterEach
public void closeWorkbooks() throws IOException {
void closeWorkbooks() throws IOException {
for (Workbook workbook : workbooksToClose) {
workbook.close();
}

View File

@ -39,7 +39,7 @@ public class TestSXSSFHyperlink extends BaseTestHyperlink {
@AfterEach
public void tearDown(){
void tearDown(){
SXSSFITestDataProvider.instance.cleanup();
}

View File

@ -36,7 +36,7 @@ public final class TestSXSSFRow extends BaseTestXRow {
@AfterEach
public void tearDown() {
void tearDown() {
((SXSSFITestDataProvider) _testDataProvider).cleanup();
}

View File

@ -31,6 +31,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.SXSSFITestDataProvider;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@ -42,7 +43,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
@AfterEach
public void tearDown(){
void tearDown(){
SXSSFITestDataProvider.instance.cleanup();
}
@ -99,14 +100,14 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
// properties on Cells...
}
@Disabled
@Override
@Test
public void defaultColumnStyle() {
protected void defaultColumnStyle() {
//TODO column styles are not yet supported by XSSF
}
@Test
public void overrideFlushedRows() throws IOException {
void overrideFlushedRows() throws IOException {
try (Workbook wb = new SXSSFWorkbook(3)) {
Sheet sheet = wb.createSheet();
@ -121,7 +122,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
}
@Test
public void overrideRowsInTemplate() throws IOException {
void overrideRowsInTemplate() throws IOException {
try (XSSFWorkbook template = new XSSFWorkbook()) {
template.createSheet().createRow(1);
try (Workbook wb = new SXSSFWorkbook(template);) {
@ -139,7 +140,7 @@ public final class TestSXSSFSheet extends BaseTestXSheet {
}
@Test
public void changeRowNum() throws IOException {
void changeRowNum() throws IOException {
SXSSFWorkbook wb = new SXSSFWorkbook(3);
SXSSFSheet sheet = wb.createSheet();
SXSSFRow row0 = sheet.createRow(0);

View File

@ -80,7 +80,7 @@ public class TestSXSSFSheetAutoSizeColumn {
}
@AfterEach
public void tearDownSheetAndWorkbook() throws IOException {
void tearDownSheetAndWorkbook() throws IOException {
if (sheet != null) {
sheet.dispose();
}
@ -215,7 +215,7 @@ public class TestSXSSFSheetAutoSizeColumn {
@ParameterizedTest
@MethodSource("data")
public void autoSizeColumn_trackColumnForAutoSizing(boolean useMergedCells) {
void autoSizeColumn_trackColumnForAutoSizing(boolean useMergedCells) {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();
sheet.trackColumnForAutoSizing(0);
@ -231,7 +231,7 @@ public class TestSXSSFSheetAutoSizeColumn {
@ParameterizedTest
@MethodSource("data")
public void autoSizeColumn_trackColumnsForAutoSizing(boolean useMergedCells) {
void autoSizeColumn_trackColumnsForAutoSizing(boolean useMergedCells) {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();
@ -248,7 +248,7 @@ public class TestSXSSFSheetAutoSizeColumn {
@ParameterizedTest
@MethodSource("data")
public void autoSizeColumn_untrackColumnForAutoSizing(boolean useMergedCells) {
void autoSizeColumn_untrackColumnForAutoSizing(boolean useMergedCells) {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();
@ -265,7 +265,7 @@ public class TestSXSSFSheetAutoSizeColumn {
@ParameterizedTest
@MethodSource("data")
public void autoSizeColumn_untrackColumnsForAutoSizing(boolean useMergedCells) {
void autoSizeColumn_untrackColumnsForAutoSizing(boolean useMergedCells) {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();
@ -282,7 +282,7 @@ public class TestSXSSFSheetAutoSizeColumn {
}
@Test
public void autoSizeColumn_isColumnTrackedForAutoSizing() {
void autoSizeColumn_isColumnTrackedForAutoSizing() {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();
@ -297,7 +297,7 @@ public class TestSXSSFSheetAutoSizeColumn {
@ParameterizedTest
@MethodSource("data")
public void autoSizeColumn_trackAllColumns(boolean useMergedCells) {
void autoSizeColumn_trackAllColumns(boolean useMergedCells) {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();
@ -311,7 +311,7 @@ public class TestSXSSFSheetAutoSizeColumn {
@ParameterizedTest
@MethodSource("data")
public void autoSizeColumn_trackAllColumns_explicitUntrackColumn(boolean useMergedCells) {
void autoSizeColumn_trackAllColumns_explicitUntrackColumn(boolean useMergedCells) {
workbook = new SXSSFWorkbook();
sheet = workbook.createSheet();

View File

@ -63,7 +63,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
}
@AfterEach
public void tearDown(){
void tearDown(){
((SXSSFITestDataProvider)_testDataProvider).cleanup();
}
@ -93,12 +93,11 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
*/
@Override
@Disabled("SXSSF doesn't update formulas on sheet name changes, as most cells probably aren't in memory at the time")
@Test
public void setSheetName() {
protected void setSheetName() {
}
@Test
public void existingWorkbook() throws IOException {
void existingWorkbook() throws IOException {
XSSFWorkbook xssfWb1 = new XSSFWorkbook();
xssfWb1.createSheet("S1");
SXSSFWorkbook wb1 = new SXSSFWorkbook(xssfWb1);
@ -119,7 +118,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void useSharedStringsTable() throws Exception {
void useSharedStringsTable() throws Exception {
SXSSFWorkbook wb = new SXSSFWorkbook(null, 10, false, true);
SharedStringsTable sss = wb.getSharedStringSource();
@ -157,7 +156,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void addToExistingWorkbook() throws IOException {
void addToExistingWorkbook() throws IOException {
XSSFWorkbook xssfWb1 = new XSSFWorkbook();
xssfWb1.createSheet("S1");
Sheet sheet = xssfWb1.createSheet("S2");
@ -231,7 +230,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void sheetdataWriter() throws IOException{
void sheetdataWriter() throws IOException{
SXSSFWorkbook wb = new SXSSFWorkbook();
SXSSFSheet sh = wb.createSheet();
SheetDataWriter wr = sh.getSheetDataWriter();
@ -266,7 +265,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void gzipSheetdataWriter() throws IOException {
void gzipSheetdataWriter() throws IOException {
SXSSFWorkbook wb = new SXSSFWorkbook();
wb.setCompressTempFiles(true);
@ -332,7 +331,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void workbookDispose() throws IOException {
void workbookDispose() throws IOException {
SXSSFWorkbook wb1 = new SXSSFWorkbook();
// the underlying writer is SheetDataWriter
assertWorkbookDispose(wb1);
@ -347,7 +346,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
@Disabled("currently writing the same sheet multiple times is not supported...")
@Test
public void bug53515() throws Exception {
void bug53515() throws Exception {
Workbook wb1 = new SXSSFWorkbook(10);
populateWorkbook(wb1);
saveTwice(wb1);
@ -361,7 +360,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
@Disabled("Crashes the JVM because of documented JVM behavior with concurrent writing/reading of zip-files, "
+ "see http://www.oracle.com/technetwork/java/javase/documentation/overview-156328.html")
@Test
public void bug53515a() throws Exception {
void bug53515a() throws Exception {
File out = new File("Test.xlsx");
assertTrue(!out.exists() || out.delete());
for (int i = 0; i < 2; i++) {
@ -420,7 +419,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void closeDoesNotModifyWorkbook() throws IOException {
void closeDoesNotModifyWorkbook() throws IOException {
final String filename = "SampleSS.xlsx";
final File file = POIDataSamples.getSpreadSheetInstance().getFile(filename);
@ -487,7 +486,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
*/
@Test
@Disabled
public void createFromReadOnlyWorkbook() throws Exception {
void createFromReadOnlyWorkbook() throws Exception {
String sheetName = "Test SXSSF";
File input = XSSFTestDataSamples.getSampleFile("sample.xlsx");
@ -534,7 +533,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
wb.close();
}
public void changeSheetNameWithSharedFormulas() {
void changeSheetNameWithSharedFormulas() {
/* not implemented */
}
}

View File

@ -19,10 +19,10 @@
package org.apache.poi.xssf.streaming;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -31,7 +31,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.GeneralSecurityException;
import java.util.List;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@ -58,7 +57,7 @@ public final class TestSXSSFWorkbookWithCustomZipEntrySource {
// write an unencrypted workbook to disk, but any temporary files are encrypted
@Test
public void customZipEntrySource() throws IOException {
void customZipEntrySource() throws IOException {
SXSSFWorkbookWithCustomZipEntrySource workbook = new SXSSFWorkbookWithCustomZipEntrySource();
SXSSFSheet sheet1 = workbook.createSheet(sheetName);
SXSSFRow row1 = sheet1.createRow(1);
@ -79,7 +78,7 @@ public final class TestSXSSFWorkbookWithCustomZipEntrySource {
// write an encrypted workbook to disk, and encrypt any temporary files as well
@Test
public void customZipEntrySourceForWriteAndRead() throws IOException, GeneralSecurityException, InvalidFormatException {
void customZipEntrySourceForWriteAndRead() throws IOException, InvalidFormatException {
SXSSFWorkbookWithCustomZipEntrySource workbook = new SXSSFWorkbookWithCustomZipEntrySource();
SXSSFSheet sheet1 = workbook.createSheet(sheetName);
SXSSFRow row1 = sheet1.createRow(1);
@ -106,7 +105,7 @@ public final class TestSXSSFWorkbookWithCustomZipEntrySource {
}
@Test
public void validateTempFilesAreEncrypted() throws IOException {
void validateTempFilesAreEncrypted() throws IOException {
TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource workbook = new TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource();
SXSSFSheet sheet1 = workbook.createSheet(sheetName);
SXSSFRow row1 = sheet1.createRow(1);

View File

@ -49,10 +49,10 @@ public abstract class BaseTestXSSFPivotTable {
* required to set up the test pivot tables and cell reference, either by name or reference.
*/
@BeforeEach
public abstract void setUp();
protected abstract void setUp();
@AfterEach
public void tearDown() throws IOException {
void tearDown() throws IOException {
if (wb != null) {
XSSFWorkbook wb2 = _testDataProvider.writeOutAndReadBack(wb);
wb.close();

View File

@ -168,7 +168,7 @@ public final class TestFormulaEvaluatorOnXSSF {
@ParameterizedTest
@MethodSource("data")
public void processFunctionRow(String targetFunctionName, int formulasRowIdx, int expectedValuesRowIdx) {
void processFunctionRow(String targetFunctionName, int formulasRowIdx, int expectedValuesRowIdx) {
Row formulasRow = sheet.getRow(formulasRowIdx);
Row expectedValuesRow = sheet.getRow(expectedValuesRowIdx);

View File

@ -145,7 +145,7 @@ public final class TestMatrixFormulasFromXMLSpreadsheet {
@ParameterizedTest
@MethodSource("data")
public void processFunctionRow(String targetFunctionName, int formulasRowIdx) {
void processFunctionRow(String targetFunctionName, int formulasRowIdx) {
int endColNum = Navigator.START_RESULT_COL_INDEX + Navigator.COL_OFF_EXPECTED_RESULT;

View File

@ -153,7 +153,7 @@ public final class TestMultiSheetFormulaEvaluatorOnXSSF {
@ParameterizedTest
@MethodSource("data")
public void processFunctionRow(String targetTestName, String targetFunctionName, int formulasRowIdx) {
void processFunctionRow(String targetTestName, String targetFunctionName, int formulasRowIdx) {
Row r = sheet.getRow(formulasRowIdx);
Cell expValue = r.getCell(SS.COLUMN_INDEX_EXPECTED_VALUE);

View File

@ -69,7 +69,7 @@ public final class TestSXSSFBugs extends BaseTestBugzillaIssues {
* any print settings that were there before
*/
@Test
public void bug49253() throws Exception {
void bug49253() throws Exception {
Workbook wb1 = new SXSSFWorkbook();
Workbook wb2 = new SXSSFWorkbook();
CellRangeAddress cra = CellRangeAddress.valueOf("C2:D3");
@ -122,7 +122,7 @@ public final class TestSXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug61648() throws Exception {
void bug61648() throws Exception {
// works as expected
writeWorkbook(new XSSFWorkbook(), XSSFITestDataProvider.instance);

View File

@ -310,7 +310,7 @@ public final class TestUnfixedBugs {
}
@Test
public void bug57423_shiftRowsByLargeOffset() throws IOException {
void bug57423_shiftRowsByLargeOffset() throws IOException {
try (
XSSFWorkbook wb = new XSSFWorkbook()
//OutputStream out = new FileOutputStream("/tmp/57423." + wb.getClass().getName() + ".xlsx"));

View File

@ -143,7 +143,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* the wrong sheet name
*/
@Test
public void bug45430() throws IOException {
void bug45430() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("45430.xlsx")) {
assertFalse(wb.isMacroEnabled());
assertEquals(3, wb.getNumberOfNames());
@ -175,7 +175,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* We should carry vba macros over after save
*/
@Test
public void bug45431() throws IOException, InvalidFormatException {
void bug45431() throws IOException, InvalidFormatException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("45431.xlsm");
OPCPackage pkg1 = wb1.getPackage();
assertTrue(wb1.isMacroEnabled());
@ -230,7 +230,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug47504() throws IOException {
void bug47504() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("47504.xlsx");
assertEquals(1, wb1.getNumberOfSheets());
XSSFSheet sh = wb1.getSheetAt(0);
@ -258,7 +258,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* read the file despite the naughtiness
*/
@Test
public void bug49020() throws IOException {
void bug49020() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("BrNotClosed.xlsx")) {
assertNotNull(wb);
}
@ -268,7 +268,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* ensure that CTPhoneticPr is loaded by the ooxml test suite so that it is included in poi-ooxml-lite
*/
@Test
public void bug49325() throws IOException {
void bug49325() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("49325.xlsx")) {
CTWorksheet sh = wb.getSheetAt(0).getCTWorksheet();
assertNotNull(sh.getPhoneticPr());
@ -280,7 +280,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* should return that sheet index properly
*/
@Test
public void bug48923() throws IOException {
void bug48923() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48923.xlsx")) {
assertEquals(4, wb.getNumberOfNames());
@ -324,7 +324,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* TODO: delete this test case when MROUND and VAR are implemented
*/
@Test
public void bug48539() throws IOException {
void bug48539() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48539.xlsx")) {
assertEquals(3, wb.getNumberOfSheets());
assertEquals(0, wb.getNumberOfNames());
@ -361,7 +361,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* a theme is used
*/
@Test
public void bug48779() throws IOException {
void bug48779() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48779.xlsx")) {
XSSFCell cell = wb.getSheetAt(0).getRow(0).getCell(0);
XSSFCellStyle cs = cell.getCellStyle();
@ -399,7 +399,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* for integers
*/
@Test
public void bug47490() throws IOException {
void bug47490() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("GeneralFormatTests.xlsx")) {
Sheet s = wb.getSheetAt(1);
Row r;
@ -437,7 +437,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* The OPC spec tolerates both of these peculiarities, so does POI
*/
@Test
public void bug49609() throws IOException {
void bug49609() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("49609.xlsx")) {
assertEquals("FAM", wb.getSheetName(0));
assertEquals("Cycle", wb.getSheetAt(0).getRow(0).getCell(1).getStringCellValue());
@ -446,7 +446,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug49783() throws IOException {
void bug49783() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("49783.xlsx")) {
Sheet sheet = wb.getSheetAt(0);
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
@ -479,7 +479,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* with something like "helloworld" !
*/
@Test
public void bug49941() throws IOException {
void bug49941() throws IOException {
XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFSheet s = wb1.createSheet();
XSSFRow r = s.createRow(0);
@ -558,7 +558,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Repeatedly writing the same file which has styles
*/
@Test
public void bug49940() throws IOException {
void bug49940() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("styles.xlsx")) {
assertEquals(3, wb.getNumberOfSheets());
assertEquals(10, wb.getStylesSource().getNumCellStyles());
@ -587,7 +587,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* entry.
*/
@Test
public void bug49966() throws IOException {
void bug49966() throws IOException {
try (XSSFWorkbook wb1 = XSSFTestDataSamples
.openSampleWorkbook("shared_formulas.xlsx")) {
XSSFSheet sheet = wb1.getSheetAt(0);
@ -644,7 +644,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug49966Row() throws IOException {
void bug49966Row() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples
.openSampleWorkbook("shared_formulas.xlsx")) {
XSSFSheet sheet = wb.getSheetAt(0);
@ -663,7 +663,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug49156() throws IOException {
void bug49156() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("49156.xlsx")) {
FormulaEvaluator formulaEvaluator = wb.getCreationHelper().createFormulaEvaluator();
@ -682,7 +682,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Newlines are valid characters in a formula
*/
@Test
public void bug50440And51875() throws IOException {
void bug50440And51875() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("NewlineInFormulas.xlsx")) {
Sheet s = wb.getSheetAt(0);
Cell c = s.getRow(0).getCell(0);
@ -708,7 +708,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Moving a cell comment from one cell to another
*/
@Test
public void bug50795() throws IOException {
void bug50795() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("50795.xlsx");
XSSFSheet sheet = wb1.getSheetAt(0);
XSSFRow row = sheet.getRow(0);
@ -770,7 +770,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* For those cases, ensure we don't break on reading the colour
*/
@Test
public void bug50299() throws IOException {
void bug50299() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("50299.xlsx")) {
// Check all the colours
@ -801,7 +801,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Excel .xls style indexed colours in a .xlsx file
*/
@Test
public void bug50786() throws IOException {
void bug50786() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50786-indexed_colours.xlsx")) {
XSSFSheet s = wb.getSheetAt(0);
XSSFRow r = s.getRow(2);
@ -824,7 +824,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* should still be able to get colours
*/
@Test
public void bug50846() throws IOException {
void bug50846() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50846-border_colours.xlsx")) {
XSSFSheet sheet = wb.getSheetAt(0);
@ -854,7 +854,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* fetching of the RGB.
*/
@Test
public void bug50784() throws IOException {
void bug50784() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50784-font_theme_colours.xlsx")) {
XSSFSheet s = wb.getSheetAt(0);
XSSFRow r = s.getRow(0);
@ -885,7 +885,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* a rich text string
*/
@Test
public void bug48877() throws IOException {
void bug48877() throws IOException {
String text = "Use \n with word wrap on to create a new line.\n" +
"This line finishes with two trailing spaces. ";
@ -958,7 +958,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Adding sheets when one has a table, then re-ordering
*/
@Test
public void bug50867() throws IOException {
void bug50867() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("50867_with_table.xlsx");
assertEquals(3, wb1.getNumberOfSheets());
@ -1079,7 +1079,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* any print settings that were there before
*/
@Test
public void bug49253() throws IOException {
void bug49253() throws IOException {
XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFWorkbook wb2 = new XSSFWorkbook();
CellRangeAddress cra = CellRangeAddress.valueOf("C2:D3");
@ -1125,7 +1125,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Default Column style
*/
@Test
public void bug51037() throws IOException {
void bug51037() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet s = wb.createSheet();
@ -1204,7 +1204,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Something with the SharedStringsTable currently breaks...
*/
@Test
public void bug46662() throws IOException {
void bug46662() throws IOException {
// New file
XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFTestDataSamples.writeOutAndReadBack(wb1).close();
@ -1227,7 +1227,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Colours and styles when the list has gaps in it
*/
@Test
public void bug51222() throws IOException {
void bug51222() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("51222.xlsx")) {
XSSFSheet s = wb.getSheetAt(0);
@ -1267,7 +1267,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug51470() throws IOException {
void bug51470() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("51470.xlsx")) {
XSSFSheet sh0 = wb.getSheetAt(0);
XSSFSheet sh1 = wb.cloneSheet(0);
@ -1293,7 +1293,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* comments (so /xl/comments1.xml is taken)
*/
@Test
public void bug51850() throws IOException {
void bug51850() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("51850.xlsx");
XSSFSheet sh1 = wb1.getSheetAt(0);
XSSFSheet sh2 = wb1.getSheetAt(1);
@ -1358,7 +1358,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Sheet names with a , in them
*/
@Test
public void bug51963() throws IOException {
void bug51963() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("51963.xlsx")) {
Sheet sheet = wb.getSheetAt(0);
assertEquals("Abc,1", sheet.getSheetName());
@ -1379,7 +1379,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* eg =SUM($Sheet1.C1:$Sheet4.C1)
*/
@Test
public void bug48703() throws IOException {
void bug48703() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48703.xlsx")) {
XSSFSheet sheet = wb.getSheetAt(0);
@ -1409,7 +1409,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Bugzilla 51710: problems reading shared formuals from .xlsx
*/
@Test
public void bug51710() throws IOException {
void bug51710() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("51710.xlsx")) {
final String[] columns = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N"};
@ -1441,7 +1441,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Bug 53101:
*/
@Test
public void bug5301() throws IOException {
void bug5301() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("53101.xlsx")) {
FormulaEvaluator evaluator =
wb.getCreationHelper().createFormulaEvaluator();
@ -1462,7 +1462,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug54436() throws IOException {
void bug54436() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("54436.xlsx")) {
if (!WorkbookEvaluator.getSupportedFunctionNames().contains("GETPIVOTDATA")) {
Function func = (args, srcRowIndex, srcColumnIndex) -> ErrorEval.NA;
@ -1478,7 +1478,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* when opened via WorkbookFactory, so there's no EncryptedDocumentException thrown anymore
*/
@Test
public void bug55692_poifs() throws IOException {
void bug55692_poifs() throws IOException {
// Via a POIFSFileSystem
try (POIFSFileSystem fsP = new POIFSFileSystem(
POIDataSamples.getPOIFSInstance().openResourceAsStream("protect.xlsx"))) {
@ -1487,7 +1487,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug55692_stream() throws IOException {
void bug55692_stream() throws IOException {
// Directly on a Stream, will go via POIFS and spot it's
// actually a .xlsx file encrypted with the default password, and open
try (Workbook wb = WorkbookFactory.create(
@ -1498,7 +1498,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug55692_poifs2() throws IOException {
void bug55692_poifs2() throws IOException {
// Via a POIFSFileSystem, will spot it's actually a .xlsx file
// encrypted with the default password, and open
try (POIFSFileSystem fsNP = new POIFSFileSystem(
@ -1511,7 +1511,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug53282() throws IOException {
void bug53282() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("53282b.xlsx")) {
Cell c = wb.getSheetAt(0).getRow(1).getCell(0);
assertEquals("#@_#", c.getStringCellValue());
@ -1525,7 +1525,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* due to a lack of Styles Table
*/
@Test
public void bug56278() throws IOException {
void bug56278() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56278.xlsx")) {
assertEquals(0, wb.getSheetIndex("Market Rates"));
@ -1537,7 +1537,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug56315() throws IOException {
void bug56315() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56315.xlsx")) {
Cell c = wb.getSheetAt(0).getRow(1).getCell(0);
CellValue cv = wb.getCreationHelper().createFormulaEvaluator().evaluate(c);
@ -1547,7 +1547,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug56468() throws IOException, InterruptedException {
void bug56468() throws IOException, InterruptedException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sheet = wb.createSheet();
XSSFRow row = sheet.createRow(0);
@ -1580,7 +1580,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* cell format of "yyyy-MM-ddTHH:mm:ss"
*/
@Test
public void bug54034() throws IOException {
void bug54034() throws IOException {
TimeZone tz = LocaleUtil.getUserTimeZone();
LocaleUtil.setUserTimeZone(TimeZone.getTimeZone("CET"));
try {
@ -1693,7 +1693,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* with DataFormatter
*/
@Test
public void bug56702() throws IOException {
void bug56702() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56702.xlsx")) {
Sheet sheet = wb.getSheetAt(0);
@ -1722,7 +1722,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* org.apache.poi.ss.formula.FormulaParseException: Parse error near char 0 '[' in specified formula '[0]!NR_Global_B2'. Expected number, string, or defined name
*/
@Test
public void bug56737() throws IOException {
void bug56737() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56737.xlsx")) {
// Check the named range definitions
@ -1866,7 +1866,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* function in another file
*/
@Test
public void bug56502() throws IOException {
void bug56502() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56502.xlsx")) {
Sheet sheet = wb.getSheetAt(0);
@ -1887,7 +1887,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug54764() throws IOException, OpenXML4JException, XmlException {
void bug54764() throws IOException, OpenXML4JException, XmlException {
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("54764.xlsx")) {
// Check the core properties - will be found but empty, due
// to the expansion being too much to be considered valid
@ -1940,7 +1940,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* poi-ooxml-lite jar
*/
@Test
public void bug57176() throws IOException {
void bug57176() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57176.xlsx")) {
CTDefinedNames definedNames = wb.getCTWorkbook().getDefinedNames();
List<CTDefinedName> definedNameList = definedNames.getDefinedNameList();
@ -1957,7 +1957,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* error message if given one
*/
@Test
public void bug56800_xlsb() throws IOException {
void bug56800_xlsb() throws IOException {
// Can be opened at the OPC level
try (OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("Simple.xlsb")) {
// XSSF Workbook gives helpful error
@ -2110,7 +2110,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
*/
@ParameterizedTest
@EnumSource(value = PackageAccess.class, names = {"READ_WRITE", "READ"})
public void bug57482(PackageAccess access) throws IOException, InvalidFormatException {
void bug57482(PackageAccess access) throws IOException, InvalidFormatException {
File file = HSSFTestDataSamples.getSampleFile("57482-OnlyNumeric.xlsx");
try (OPCPackage pkg = OPCPackage.open(file, access);
XSSFWorkbook wb1 = new XSSFWorkbook(pkg)) {
@ -2159,7 +2159,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* "Unknown error type: -60" fetching formula error value
*/
@Test
public void bug57535() throws IOException {
void bug57535() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57535.xlsx")) {
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
evaluator.clearAllCachedResultValues();
@ -2410,7 +2410,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug57642() throws IOException {
void bug57642() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet s = wb.createSheet("TestSheet");
XSSFCell c = s.createRow(0).createCell(0);
@ -2432,7 +2432,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* 32,767 must not be -32,768, then -32,767, -32,766
*/
@Test
public void bug57880() throws IOException {
void bug57880() throws IOException {
int numStyles = 33000;
XSSFWorkbook wb = new XSSFWorkbook();
for (int i = 1; i < numStyles; i++) {
@ -2549,14 +2549,14 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* Excel 2007 generated Macro-Enabled .xlsm file
*/
@Test
public void bug57181() throws IOException {
void bug57181() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("57181.xlsm")) {
assertEquals(9, wb.getNumberOfSheets());
}
}
@Test
public void bug52111() throws IOException {
void bug52111() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("Intersection-52111-xssf.xlsx")) {
Sheet s = wb.getSheetAt(0);
assertFormula(wb, s.getRow(2).getCell(0), "(C2:D3 D3:E4)", "4.0");
@ -2991,7 +2991,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* to include the row number on the row tags
*/
@Test
public void noRowNumbers59746() throws IOException {
void noRowNumbers59746() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("59746_NoRowNums.xlsx")) {
Sheet sheet = wb.getSheetAt(0);
assertTrue(sheet.getLastRowNum() > 20, "Last row num: " + sheet.getLastRowNum());
@ -3064,7 +3064,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* part with a part number)
*/
@Test
public void drawingNumbersAlreadyTaken_60255() throws IOException {
void drawingNumbersAlreadyTaken_60255() throws IOException {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("60255_extra_drawingparts.xlsx")) {
assertEquals(4, wb.getNumberOfSheets());
@ -3148,7 +3148,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug61063() throws Exception {
void bug61063() throws Exception {
try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("61063.xlsx")) {
FormulaEvaluator eval = wb.getCreationHelper().createFormulaEvaluator();
@ -3165,7 +3165,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug61516() throws IOException {
void bug61516() throws IOException {
final String initialFormula = "A1";
final String expectedFormula = "#REF!"; // from ms excel
@ -3367,7 +3367,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
@Test
public void bug63371() throws IOException {
void bug63371() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sheet = wb.createSheet();
@ -3398,7 +3398,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
}
@Test
public void bug60397() throws IOException {
void bug60397() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sheet = wb.createSheet();

View File

@ -750,7 +750,7 @@ public final class TestXSSFCell extends BaseTestXCell {
}
@Test
public void getErrorCellValue_returns0_onABlankCell() {
void getErrorCellValue_returns0_onABlankCell() {
Cell cell = new XSSFWorkbook().createSheet().createRow(0).createCell(0);
assertThrows(IllegalStateException.class, cell::getErrorCellValue);
}

View File

@ -64,7 +64,7 @@ public class TestXSSFCellStyle {
private XSSFCellStyle cellStyle;
@BeforeEach
public void setUp() {
void setUp() {
stylesTable = new StylesTable();
CTStylesheet ctStylesheet = stylesTable.getCTStylesheet();
@ -1068,7 +1068,7 @@ public class TestXSSFCellStyle {
}
@Test
public void bug58996_UsedToWorkIn3_11_ButNotIn3_13() throws IOException {
void bug58996_UsedToWorkIn3_11_ButNotIn3_13() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFCellStyle cellStyle = workbook.createCellStyle();

View File

@ -69,7 +69,7 @@ public final class TestXSSFComment extends BaseTestCellComment {
* test properties of a newly constructed comment
*/
@Test
public void constructor() {
void constructor() {
CommentsTable sheetComments = new CommentsTable();
assertNotNull(sheetComments.getCTComments().getCommentList());
assertNotNull(sheetComments.getCTComments().getAuthors());
@ -88,7 +88,7 @@ public final class TestXSSFComment extends BaseTestCellComment {
}
@Test
public void getSetCol() {
void getSetCol() {
CommentsTable sheetComments = new CommentsTable();
XSSFVMLDrawing vml = new XSSFVMLDrawing();
CTComment ctComment = sheetComments.newComment(CellAddress.A1);
@ -107,7 +107,7 @@ public final class TestXSSFComment extends BaseTestCellComment {
}
@Test
public void getSetRow() {
void getSetRow() {
CommentsTable sheetComments = new CommentsTable();
XSSFVMLDrawing vml = new XSSFVMLDrawing();
CTComment ctComment = sheetComments.newComment(CellAddress.A1);
@ -126,7 +126,7 @@ public final class TestXSSFComment extends BaseTestCellComment {
}
@Test
public void setString() {
void setString() {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sh = wb.createSheet();
XSSFComment comment = sh.createDrawingPatriarch().createCellComment(new XSSFClientAnchor());
@ -177,7 +177,7 @@ public final class TestXSSFComment extends BaseTestCellComment {
}
@Test
public void author() {
void author() {
CommentsTable sheetComments = new CommentsTable();
CTComment ctComment = sheetComments.newComment(CellAddress.A1);
@ -338,7 +338,7 @@ public final class TestXSSFComment extends BaseTestCellComment {
}
@Test
public void bug57838DeleteRowsWthCommentsBug() throws IOException {
void bug57838DeleteRowsWthCommentsBug() throws IOException {
Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57838.xlsx");
Sheet sheet=wb.getSheetAt(0);
Comment comment1 = sheet.getCellComment(new CellAddress(2, 1));

View File

@ -35,7 +35,7 @@ public class TestXSSFDataValidationConstraint {
// See bug 59719
@Test
public void listLiteralsQuotesAreStripped_formulaConstructor() {
void listLiteralsQuotesAreStripped_formulaConstructor() {
// literal list, using formula constructor
String literal = "\"one, two, three\"";
String[] expected = new String[] { "one", "two", "three" };
@ -47,7 +47,7 @@ public class TestXSSFDataValidationConstraint {
}
@Test
public void listLiteralsQuotesAreStripped_arrayConstructor() {
void listLiteralsQuotesAreStripped_arrayConstructor() {
// literal list, using array constructor
String literal = "\"one, two, three\"";
String[] expected = new String[] { "one", "two", "three" };
@ -58,13 +58,13 @@ public class TestXSSFDataValidationConstraint {
}
@Test
public void listLiteralsGreaterThan255CharactersThrows() {
void listLiteralsGreaterThan255CharactersThrows() {
String[] literal = IntStream.range(0, 129).mapToObj(i -> "a").toArray(String[]::new);
assertThrows(IllegalArgumentException.class, () -> new XSSFDataValidationConstraint(literal));
}
@Test
public void dataValidationListLiteralTooLongFromFile() throws IOException {
void dataValidationListLiteralTooLongFromFile() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("DataValidationListTooLong.xlsx")) {
XSSFFormulaEvaluator fEval = wb.getCreationHelper().createFormulaEvaluator();
DataValidationEvaluator dvEval = new DataValidationEvaluator(wb, fEval);
@ -73,7 +73,7 @@ public class TestXSSFDataValidationConstraint {
}
@Test
public void rangeReference() {
void rangeReference() {
// (unnamed range) reference list
String reference = "A1:A5";
DataValidationConstraint constraint = new XSSFDataValidationConstraint(listType, ignoredType, reference, null);
@ -82,7 +82,7 @@ public class TestXSSFDataValidationConstraint {
}
@Test
public void namedRangeReference() {
void namedRangeReference() {
// named range list
String namedRange = "MyNamedRange";
DataValidationConstraint constraint = new XSSFDataValidationConstraint(listType, ignoredType, namedRange, null);

View File

@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.*;
public class TestXSSFDrawing {
@Test
public void bug54803() throws Exception {
void bug54803() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("bug54803.xlsx")) {
XSSFSheet sheet = wb.getSheetAt(0);
sheet.createDrawingPatriarch();

View File

@ -29,13 +29,13 @@ public class TestXSSFEvenFooter {
private XSSFSheet sheet;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -29,13 +29,13 @@ public class TestXSSFEvenHeader {
private XSSFSheet sheet;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -29,13 +29,13 @@ public class TestXSSFFirstFooter {
private XSSFSheet sheet;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -29,13 +29,13 @@ public class TestXSSFFirstHeader {
private XSSFSheet sheet;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -357,7 +357,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
// Takes over a minute to evaluate all formulas in this large workbook. Run this test when profiling for formula evaluation speed.
// , "StructuredRefs-lots-with-lookups.xlsx"
})
public void verifyAllFormulasInWorkbookCanBeEvaluated(String sampleWorkbook) throws IOException {
void verifyAllFormulasInWorkbookCanBeEvaluated(String sampleWorkbook) throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook(sampleWorkbook)) {
assertDoesNotThrow(() -> XSSFFormulaEvaluator.evaluateAllFormulaCells(wb));
}
@ -381,7 +381,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
}
@Test
public void evaluateInCellReturnsSameDataType() throws IOException {
void evaluateInCellReturnsSameDataType() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
wb.createSheet().createRow(0).createCell(0);
XSSFFormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();

View File

@ -74,7 +74,7 @@ public final class TestXSSFFormulaParser {
}
@Test
public void basicParsing() throws IOException {
void basicParsing() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);
Ptg[] ptgs;
@ -144,7 +144,7 @@ public final class TestXSSFFormulaParser {
}
@Test
public void builtInFormulas() throws IOException {
void builtInFormulas() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);
Ptg[] ptgs;
@ -162,7 +162,7 @@ public final class TestXSSFFormulaParser {
}
@Test
public void formulaReferencesSameWorkbook() throws IOException {
void formulaReferencesSameWorkbook() throws IOException {
// Use a test file with "other workbook" style references
// to itself
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56737.xlsx");
@ -183,7 +183,7 @@ public final class TestXSSFFormulaParser {
}
@Test
public void formulaReferencesOtherSheets() throws IOException {
void formulaReferencesOtherSheets() throws IOException {
// Use a test file with the named ranges in place
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56737.xlsx");
XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);
@ -225,7 +225,7 @@ public final class TestXSSFFormulaParser {
}
@Test
public void formulaReferencesOtherWorkbook() throws IOException {
void formulaReferencesOtherWorkbook() throws IOException {
// Use a test file with the external linked table in place
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("ref-56737.xlsx");
XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);
@ -272,7 +272,7 @@ public final class TestXSSFFormulaParser {
* (but not evaluate - that's elsewhere in the test suite)
*/
@Test
public void multiSheetReferencesHSSFandXSSF() throws IOException {
void multiSheetReferencesHSSFandXSSF() throws IOException {
Workbook[] wbs = new Workbook[] {
HSSFTestDataSamples.openSampleWorkbook("55906-MultiSheetRefs.xls"),
XSSFTestDataSamples.openSampleWorkbook("55906-MultiSheetRefs.xlsx")
@ -560,7 +560,7 @@ public final class TestXSSFFormulaParser {
}
@Test
public void parseStructuredReferences() throws IOException {
void parseStructuredReferences() throws IOException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx");
XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);

View File

@ -31,14 +31,14 @@ public class TestXSSFHeaderFooterProperties {
private XSSFHeaderFooterProperties hfProp;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
hfProp = sheet.getHeaderFooterProperties();
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -29,13 +29,13 @@ public class TestXSSFOddFooter {
private XSSFSheet sheet;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -29,13 +29,13 @@ public class TestXSSFOddHeader {
private XSSFSheet sheet;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -46,7 +46,7 @@ public final class TestXSSFPicture extends BaseTestPicture {
}
@Test
public void create() throws IOException {
void create() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sheet = wb.createSheet();
XSSFDrawing drawing = sheet.createDrawingPatriarch();
@ -83,7 +83,7 @@ public final class TestXSSFPicture extends BaseTestPicture {
* See Bugzilla 50458
*/
@Test
public void incrementShapeId() throws IOException {
void incrementShapeId() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sheet = wb.createSheet();
XSSFDrawing drawing = sheet.createDrawingPatriarch();
@ -106,7 +106,7 @@ public final class TestXSSFPicture extends BaseTestPicture {
* same image refrerred by mulitple sheets
*/
@Test
public void multiRelationShips() throws IOException {
void multiRelationShips() throws IOException {
try (XSSFWorkbook wb1 = new XSSFWorkbook()) {
byte[] pic1Data = "test jpeg data".getBytes(LocaleUtil.CHARSET_1252);
byte[] pic2Data = "test png data".getBytes(LocaleUtil.CHARSET_1252);

View File

@ -29,7 +29,7 @@ public class TestXSSFPivotTableName extends BaseTestXSSFPivotTable {
@Override
@BeforeEach
public void setUp(){
protected void setUp(){
wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();

View File

@ -30,7 +30,7 @@ public class TestXSSFPivotTableRef extends BaseTestXSSFPivotTable {
@Override
@BeforeEach
public void setUp(){
protected void setUp(){
wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();

View File

@ -101,7 +101,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void existingHeaderFooter() throws IOException {
void existingHeaderFooter() throws IOException {
try (XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("45540_classic_Header.xlsx")) {
XSSFOddHeader hdr;
XSSFOddFooter ftr;
@ -159,7 +159,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void getAllHeadersFooters() throws IOException {
void getAllHeadersFooters() throws IOException {
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
XSSFSheet sheet = workbook.createSheet("Sheet 1");
assertNotNull(sheet.getOddFooter());
@ -200,7 +200,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void autoSizeColumn() throws IOException {
void autoSizeColumn() throws IOException {
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
XSSFSheet sheet = workbook.createSheet("Sheet 1");
sheet.createRow(0).createCell(13).setCellValue("test");
@ -215,7 +215,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
@Test
public void setCellComment() throws IOException {
void setCellComment() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
@ -234,7 +234,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void getActiveCell() throws IOException {
void getActiveCell() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
CellAddress R5 = new CellAddress("R5");
@ -245,7 +245,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void createFreezePane_XSSF() throws IOException {
void createFreezePane_XSSF() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
CTWorksheet ctWorksheet = sheet.getCTWorksheet();
@ -265,7 +265,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void removeMergedRegion_lowlevel() throws IOException {
void removeMergedRegion_lowlevel() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
CTWorksheet ctWorksheet = sheet.getCTWorksheet();
@ -301,7 +301,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void setDefaultColumnStyle() throws IOException {
void setDefaultColumnStyle() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
CTWorksheet ctWorksheet = sheet.getCTWorksheet();
@ -328,7 +328,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
@Test
public void groupUngroupColumn() throws IOException {
void groupUngroupColumn() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
@ -374,7 +374,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void groupUngroupRow() throws IOException {
void groupUngroupRow() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
@ -411,7 +411,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void setZoom() throws IOException {
void setZoom() throws IOException {
try (XSSFWorkbook workBook = new XSSFWorkbook()) {
XSSFSheet sheet1 = workBook.createSheet("new sheet");
sheet1.setZoom(75); // 75 percent magnification
@ -434,7 +434,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* better should really review this!
*/
@Test
public void setColumnGroupCollapsed() throws IOException {
void setColumnGroupCollapsed() throws IOException {
try (XSSFWorkbook wb1 = new XSSFWorkbook()) {
XSSFSheet sheet1 = wb1.createSheet();
@ -619,7 +619,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* better should really review this!
*/
@Test
public void setRowGroupCollapsed() throws IOException {
void setRowGroupCollapsed() throws IOException {
XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFSheet sheet1 = wb1.createSheet();
@ -699,7 +699,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* Get / Set column width and check the actual values of the underlying XML beans
*/
@Test
public void columnWidth_lowlevel() throws IOException {
void columnWidth_lowlevel() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet("Sheet 1");
sheet.setColumnWidth(1, 22 * 256);
@ -746,7 +746,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* Setting width of a column included in a column span
*/
@Test
public void bug47862() throws IOException {
void bug47862() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("47862.xlsx");
XSSFSheet sheet = wb1.getSheetAt(0);
CTCols cols = sheet.getCTWorksheet().getColsArray(0);
@ -806,7 +806,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* Hiding a column included in a column span
*/
@Test
public void bug47804() throws IOException {
void bug47804() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("47804.xlsx");
XSSFSheet sheet = wb1.getSheetAt(0);
CTCols cols = sheet.getCTWorksheet().getColsArray(0);
@ -877,7 +877,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void commentsTable() throws IOException {
void commentsTable() throws IOException {
XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFSheet sheet1 = wb1.createSheet();
CommentsTable comment1 = sheet1.getCommentsTable(false);
@ -1002,7 +1002,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void setAutoFilter() throws IOException {
void setAutoFilter() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet("new sheet");
sheet.setAutoFilter(CellRangeAddress.valueOf("A1:D100"));
@ -1022,7 +1022,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void protectSheet_lowlevel() throws IOException {
void protectSheet_lowlevel() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
CTSheetProtection pr = sheet.getCTWorksheet().getSheetProtection();
@ -1045,7 +1045,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void protectSheet_emptyPassword() throws IOException {
void protectSheet_emptyPassword() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
CTSheetProtection pr = sheet.getCTWorksheet().getSheetProtection();
@ -1069,7 +1069,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void protectSheet_lowlevel_2013() throws IOException {
void protectSheet_lowlevel_2013() throws IOException {
String password = "test";
XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFSheet xs = wb1.createSheet();
@ -1086,7 +1086,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
@Test
public void bug49966() throws IOException {
void bug49966() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("49966.xlsx");
CalculationChain calcChain = wb1.getCalculationChain();
assertNotNull(wb1.getCalculationChain());
@ -1109,7 +1109,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* See bug #50829 test data tables
*/
@Test
public void tables() throws IOException {
void tables() throws IOException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithTable.xlsx");
assertEquals(3, wb.getNumberOfSheets());
@ -1138,7 +1138,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* Test to trigger OOXML-LITE generating to include org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetCalcPr
*/
@Test
public void setForceFormulaRecalculation() throws IOException {
void setForceFormulaRecalculation() throws IOException {
XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFSheet sheet = wb1.createSheet("Sheet 1");
@ -1168,7 +1168,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void bug54607() throws IOException {
void bug54607() throws IOException {
// run with the file provided in the Bug-Report
runGetTopRow("54607.xlsx", true, 1, 0, 0);
runGetLeftCol("54607.xlsx", true, 0, 0, 0);
@ -1233,7 +1233,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void bug55745() throws Exception {
void bug55745() throws Exception {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55745.xlsx")) {
XSSFSheet sheet = wb.getSheetAt(0);
List<XSSFTable> tables = sheet.getTables();
@ -1243,7 +1243,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void bug55723b() throws IOException {
void bug55723b() throws IOException {
XSSFWorkbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet();
@ -1273,7 +1273,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
@Timeout(value = 180, unit = SECONDS)
@Test
public void bug51585() throws IOException {
void bug51585() throws IOException {
XSSFTestDataSamples.openSampleWorkbook("51585.xlsx").close();
}
@ -1838,7 +1838,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void setTabColor() throws IOException {
void setTabColor() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sh = wb.createSheet();
assertTrue(sh.getCTWorksheet().getSheetPr() == null || !sh.getCTWorksheet().getSheetPr().isSetTabColor());
@ -1850,7 +1850,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
}
@Test
public void getTabColor() throws IOException {
void getTabColor() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sh = wb.createSheet();
assertTrue(sh.getCTWorksheet().getSheetPr() == null || !sh.getCTWorksheet().getSheetPr().isSetTabColor());
@ -1863,7 +1863,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
// Test using an existing workbook saved by Excel
@Test
public void tabColor() throws IOException {
void tabColor() throws IOException {
try (XSSFWorkbook wb = openSampleWorkbook("SheetTabColors.xlsx")) {
// non-colored sheets do not have a color
assertNull(wb.getSheet("default").getTabColor());

View File

@ -361,7 +361,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows {
}
@Test
public void bug59733() throws IOException {
void bug59733() throws IOException {
Workbook workbook = new XSSFWorkbook();
Sheet sheet = workbook.createSheet();
for (int r=0; r<4; r++) {
@ -440,7 +440,7 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows {
// bug 60260: shift rows or rename a sheet containing a named range
// that refers to formula with a unicode (non-ASCII) sheet name formula
@Test
public void shiftRowsWithUnicodeNamedRange() {
void shiftRowsWithUnicodeNamedRange() {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("unicodeSheetName.xlsx");
XSSFSheet sheet = wb.getSheetAt(0);
sheet.shiftRows(1, 2, 3);

View File

@ -60,7 +60,7 @@ public class TestXSSFSheetShiftRowsAndColumns {
* 0 to numCols-1.
*/
@BeforeEach
public void setup() throws IOException {
void setup() throws IOException {
final String procName = "TestXSSFSheetShiftRowsAndColumns.setup";
fileName = procName+".xlsx";
@ -88,7 +88,7 @@ public class TestXSSFSheetShiftRowsAndColumns {
* This method writes the workbook to resultDir/fileName.
*/
@AfterEach
public void cleanup() throws IOException {
void cleanup() throws IOException {
final String procName = "TestXSSFSheetRemoveTable.cleanup";
if (workbook == null) {
return;

View File

@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public final class TestXSSFTable {
@Test
public void bug56274() throws IOException {
void bug56274() throws IOException {
// read sample file
try (XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("56274.xlsx")) {
@ -117,7 +117,7 @@ public final class TestXSSFTable {
}
@Test
public void findColumnIndex() throws IOException {
void findColumnIndex() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
@ -136,7 +136,7 @@ public final class TestXSSFTable {
}
@Test
public void findColumnIndexIsRelativeToTableNotSheet() throws IOException {
void findColumnIndexIsRelativeToTableNotSheet() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("DataTableCities.xlsx")) {
XSSFTable table = wb.getTable("SmallCity");
@ -150,7 +150,7 @@ public final class TestXSSFTable {
}
@Test
public void getSheetName() throws IOException {
void getSheetName() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals("Table", table.getSheetName());
@ -158,7 +158,7 @@ public final class TestXSSFTable {
}
@Test
public void isHasTotalsRow() throws IOException {
void isHasTotalsRow() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertFalse(table.getTotalsRowCount() > 0);
@ -166,7 +166,7 @@ public final class TestXSSFTable {
}
@Test
public void getStartColIndex() throws IOException {
void getStartColIndex() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals(0, table.getStartColIndex());
@ -174,7 +174,7 @@ public final class TestXSSFTable {
}
@Test
public void getEndColIndex() throws IOException {
void getEndColIndex() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals(2, table.getEndColIndex());
@ -182,7 +182,7 @@ public final class TestXSSFTable {
}
@Test
public void getStartRowIndex() throws IOException {
void getStartRowIndex() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals(0, table.getStartRowIndex());
@ -190,7 +190,7 @@ public final class TestXSSFTable {
}
@Test
public void getEndRowIndex() throws IOException {
void getEndRowIndex() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals(6, table.getEndRowIndex());
@ -198,7 +198,7 @@ public final class TestXSSFTable {
}
@Test
public void getStartCellReference() throws IOException {
void getStartCellReference() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals(new CellReference("A1"), table.getStartCellReference());
@ -206,7 +206,7 @@ public final class TestXSSFTable {
}
@Test
public void getEndCellReference() throws IOException {
void getEndCellReference() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals(new CellReference("C7"), table.getEndCellReference());
@ -214,7 +214,7 @@ public final class TestXSSFTable {
}
@Test
public void getEndCellReferenceFromSingleCellTable() throws IOException {
void getEndCellReferenceFromSingleCellTable() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("SingleCellTable.xlsx")) {
XSSFTable table = wb.getTable("Table3");
assertEquals(new CellReference("A2"), table.getEndCellReference());
@ -222,7 +222,7 @@ public final class TestXSSFTable {
}
@Test
public void getColumnCount() throws IOException {
void getColumnCount() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals(3, table.getColumnCount());
@ -230,7 +230,7 @@ public final class TestXSSFTable {
}
@Test
public void getAndSetDisplayName() throws IOException {
void getAndSetDisplayName() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
assertEquals("\\_Prime.1", table.getDisplayName());
@ -242,7 +242,7 @@ public final class TestXSSFTable {
}
@Test
public void getCellReferences() throws IOException {
void getCellReferences() throws IOException {
// make sure that cached start and end cell references
// can be synchronized with the underlying CTTable
try (XSSFWorkbook wb = new XSSFWorkbook()) {
@ -275,7 +275,7 @@ public final class TestXSSFTable {
}
@Test
public void getRowCount() throws IOException {
void getRowCount() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sh = wb.createSheet();
XSSFTable table = sh.createTable(null);

View File

@ -186,7 +186,7 @@ public class TestXSSFVMLDrawing {
}
@Test
public void bug65061_InvalidXmlns() throws IOException, XmlException {
void bug65061_InvalidXmlns() throws IOException, XmlException {
// input hasn't no <?xml... declaration - as in the sample file
String input =
"<xml xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\">\n" +

View File

@ -91,7 +91,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
* Tests that we can save, and then re-load a new document
*/
@Test
public void saveLoadNew() throws IOException, InvalidFormatException {
void saveLoadNew() throws IOException, InvalidFormatException {
XSSFWorkbook wb1 = new XSSFWorkbook();
//check that the default date system is set to 1900
@ -163,7 +163,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void existing() throws Exception {
void existing() throws Exception {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("Formatting.xlsx");
assertNotNull(workbook.getSharedStringSource());
@ -183,7 +183,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void getCellStyleAt() throws IOException{
void getCellStyleAt() throws IOException{
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
short i = 0;
//get default style
@ -203,7 +203,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void getFontAt() throws IOException{
void getFontAt() throws IOException{
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
StylesTable styleSource = workbook.getStylesSource();
short i = 0;
@ -221,7 +221,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void getNumCellStyles() throws IOException{
void getNumCellStyles() throws IOException{
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
//get default cellStyles
assertEquals(1, workbook.getNumCellStyles());
@ -229,7 +229,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void loadSave() throws IOException {
void loadSave() throws IOException {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("Formatting.xlsx");
assertEquals(3, workbook.getNumberOfSheets());
assertEquals("dd/mm/yyyy", workbook.getSheetAt(0).getRow(1).getCell(0).getRichStringCellValue().getString());
@ -256,7 +256,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void styles() throws IOException {
void styles() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("Formatting.xlsx");
StylesTable ss = wb1.getStylesSource();
@ -297,7 +297,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void incrementSheetId() throws IOException {
void incrementSheetId() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
int sheetId = (int) wb.createSheet().sheet.getSheetId();
assertEquals(1, sheetId);
@ -317,7 +317,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
* Test setting of core properties such as Title and Author
*/
@Test
public void workbookProperties() throws IOException {
void workbookProperties() throws IOException {
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
POIXMLProperties props = workbook.getProperties();
assertNotNull(props);
@ -345,7 +345,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
* fails, the test data is not working properly.
*/
@Test
public void bug47668() throws Exception {
void bug47668() throws Exception {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("47668.xlsx");
List<XSSFPictureData> allPictures = workbook.getAllPictures();
assertEquals(1, allPictures.size());
@ -383,7 +383,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
*/
@SuppressWarnings("deprecation")
@Test
public void bug47737() throws IOException {
void bug47737() throws IOException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("47737.xlsx");
assertEquals(2, wb.getNumberOfNames());
assertNotNull(wb.getCalculationChain());
@ -411,7 +411,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
* Problems with XSSFWorkbook.removeSheetAt when workbook contains charts
*/
@Test
public void bug47813() throws IOException {
void bug47813() throws IOException {
XSSFWorkbook wb1 = XSSFTestDataSamples.openSampleWorkbook("47813.xlsx");
assertEquals(3, wb1.getNumberOfSheets());
assertNotNull(wb1.getCalculationChain());
@ -441,7 +441,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
* coming out wrong
*/
@Test
public void bug49702() throws IOException {
void bug49702() throws IOException {
// First try with a new file
try (XSSFWorkbook wb1 = new XSSFWorkbook()) {
@ -480,7 +480,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void recalcId() throws IOException {
void recalcId() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
assertFalse(wb.getForceFormulaRecalculation());
CTWorkbook ctWorkbook = wb.getCTWorkbook();
@ -513,7 +513,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void columnWidthPOI52233() throws Exception {
void columnWidthPOI52233() throws Exception {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet();
XSSFRow row = sheet.createRow(0);
@ -545,7 +545,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug48495() throws IOException {
void bug48495() throws IOException {
Workbook wb = XSSFTestDataSamples.openSampleWorkbook("48495.xlsx");
assertSheetOrder(wb, "Sheet1");
@ -576,7 +576,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug47090a() throws IOException {
void bug47090a() throws IOException {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.removeSheetAt(0);
@ -590,7 +590,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug47090b() throws IOException {
void bug47090b() throws IOException {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.removeSheetAt(1);
@ -604,7 +604,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug47090c() throws IOException {
void bug47090c() throws IOException {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.removeSheetAt(0);
@ -618,7 +618,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug47090d() throws IOException {
void bug47090d() throws IOException {
Workbook workbook = XSSFTestDataSamples.openSampleWorkbook("47090.xlsx");
assertSheetOrder(workbook, "Sheet1", "Sheet2");
workbook.createSheet();
@ -634,7 +634,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug51158() throws IOException {
void bug51158() throws IOException {
// create a workbook
final XSSFWorkbook wb1 = new XSSFWorkbook();
XSSFSheet sheet = wb1.createSheet("Test Sheet");
@ -679,7 +679,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug51158a() throws IOException {
void bug51158a() throws IOException {
// create a workbook
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
workbook.createSheet("Test Sheet");
@ -703,7 +703,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void bug60509() throws Exception {
void bug60509() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("60509.xlsx");
assertSheetOrder(wb, "Sheet1", "Sheet2", "Sheet3");
int sheetIndex = wb.getSheetIndex("Sheet1");
@ -934,7 +934,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
*/
@SuppressWarnings("unchecked")
@Test
public void bug58245_XSSFSheetIterator() throws IOException {
void bug58245_XSSFSheetIterator() throws IOException {
final XSSFWorkbook wb = new XSSFWorkbook();
wb.createSheet();
@ -1023,7 +1023,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
public void closeDoesNotModifyWorkbook() throws IOException {
void closeDoesNotModifyWorkbook() throws IOException {
final String filename = "SampleSS.xlsx";
final File file = POIDataSamples.getSpreadSheetInstance().getFile(filename);
Workbook wb;
@ -1072,7 +1072,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
* See bug #57840 test data tables
*/
@Test
public void getTable() throws IOException {
void getTable() throws IOException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("WithTable.xlsx");
XSSFTable table1 = wb.getTable("Tabella1");
assertNotNull(table1, "Tabella1 was not found in workbook");

View File

@ -40,7 +40,7 @@ public final class TestXDDFManualLayout {
private XDDFManualLayout layout;
@BeforeEach
public void createEmptyLayout() {
void createEmptyLayout() {
wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
XSSFDrawing drawing = sheet.createDrawingPatriarch();
@ -51,7 +51,7 @@ public final class TestXDDFManualLayout {
}
@AfterEach
public void closeWB() throws IOException {
void closeWB() throws IOException {
wb.close();
}

View File

@ -45,7 +45,7 @@ public final class TestXSSFChartAxis {
private XDDFChartAxis axis;
@BeforeEach
public void setup() {
void setup() {
wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
XSSFDrawing drawing = sheet.createDrawingPatriarch();
@ -55,7 +55,7 @@ public final class TestXSSFChartAxis {
}
@AfterEach
public void teardown() throws IOException {
void teardown() throws IOException {
wb.close();
wb = null;
axis = null;

View File

@ -44,7 +44,7 @@ public class TestXSSFHeaderFooter {
private XSSFHeaderFooter fF;
@BeforeEach
public void before() {
void before() {
wb = new XSSFWorkbook();
sheet = wb.createSheet();
hO = (XSSFHeaderFooter) sheet.getOddHeader();
@ -56,7 +56,7 @@ public class TestXSSFHeaderFooter {
}
@AfterEach
public void after() throws Exception {
void after() throws Exception {
wb.close();
}

View File

@ -40,7 +40,7 @@ public class XSSFCellBorderTest {
private final XSSFCellBorder empty = new XSSFCellBorder();
@BeforeEach
public void setUp() {
void setUp() {
assertNotNull(stylesSource);
assertEquals(1, stylesSource.getBorders().size());
}

View File

@ -172,7 +172,7 @@ public class TestDocumentProtection {
}
@Test
public void bug56076_read() throws IOException {
void bug56076_read() throws IOException {
// test legacy xored-hashed password
assertEquals("64CEED7E", CryptoFunctions.xorHashPassword("Example"));
// check leading 0
@ -186,7 +186,7 @@ public class TestDocumentProtection {
}
@Test
public void bug56076_write() throws IOException {
void bug56076_write() throws IOException {
// test document write protection with password
XWPFDocument doc1 = new XWPFDocument();
doc1.enforceCommentsProtection("Example", HashAlgorithm.sha512);

View File

@ -46,7 +46,7 @@ public class TestXWPFBugs {
private static final POIDataSamples samples = POIDataSamples.getDocumentInstance();
@Test
public void truncatedDocx() throws Exception {
void truncatedDocx() throws Exception {
try (InputStream fis = samples.openResourceAsStream("truncated62886.docx");
OPCPackage opc = OPCPackage.open(fis);
XWPFWordExtractor ext = new XWPFWordExtractor(opc)) {
@ -59,7 +59,7 @@ public class TestXWPFBugs {
* Encryption options, and no cspname section. See bug 53475
*/
@Test
public void bug53475NoCSPName() throws Exception {
void bug53475NoCSPName() throws Exception {
File file = samples.getFile("bug53475-password-is-solrcell.docx");
POIFSFileSystem filesystem = new POIFSFileSystem(file, true);
@ -91,7 +91,7 @@ public class TestXWPFBugs {
* but the key can be 128/192/256 bits
*/
@Test
public void bug53475_aes256() throws Exception {
void bug53475_aes256() throws Exception {
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
assumeTrue(maxKeyLen == 0x7FFFFFFF, "Please install JCE Unlimited Strength Jurisdiction Policy files for AES 256");
@ -125,7 +125,7 @@ public class TestXWPFBugs {
@Test
public void bug59058() throws IOException, XmlException {
void bug59058() throws IOException, XmlException {
String[] files = {"bug57031.docx", "bug59058.docx"};
for (String f : files) {
ZipFile zf = new ZipFile(samples.getFile(f));

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