mirror of https://github.com/apache/poi.git
Adjust tests, comments, JavaDoc, IDE suggestions
Add more output for a flaky test which sometimes fails on very slow hardware Shutdown in tests gracefully Otherwise an NPE may "hide" a test-failure git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1905273 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a0abaf205a
commit
56d47448ce
|
@ -39,7 +39,7 @@ public class XWPFPictureData extends POIXMLDocumentPart {
|
|||
private static int MAX_IMAGE_SIZE = DEFAULT_MAX_IMAGE_SIZE;
|
||||
|
||||
/**
|
||||
* @param length the max image size allowed for XSSF pictures
|
||||
* @param length the max image size allowed for XWPF pictures
|
||||
*/
|
||||
public static void setMaxImageSize(int length) {
|
||||
MAX_IMAGE_SIZE = length;
|
||||
|
|
|
@ -36,6 +36,7 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
@ -3312,7 +3313,9 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||
}
|
||||
LOG.atInfo().log(between(start, now()));
|
||||
|
||||
assertTrue(between(start, now()).getSeconds() < 25);
|
||||
assertTrue(between(start, now()).getSeconds() < 25,
|
||||
"Had start: " + start + ", now: " + now() +
|
||||
", diff: " + Duration.between(start, now()).getSeconds());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,8 +53,12 @@ final class TestRVA {
|
|||
|
||||
@AfterAll
|
||||
public static void closeResource() throws Exception {
|
||||
workbook.close();
|
||||
poifs.close();
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
if (poifs != null) {
|
||||
poifs.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static Stream<Arguments> data() throws Exception {
|
||||
|
|
|
@ -101,7 +101,9 @@ final class TestMatrixFormulasFromBinarySpreadsheet {
|
|||
@AfterAll
|
||||
public static void closeResource() throws Exception {
|
||||
LocaleUtil.setUserLocale(userLocale);
|
||||
workbook.close();
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
}
|
||||
|
||||
/* generating parameter instances */
|
||||
|
|
|
@ -100,7 +100,9 @@ public final class TestFormulasFromSpreadsheet {
|
|||
@AfterAll
|
||||
public static void closeResource() throws Exception {
|
||||
LocaleUtil.setUserLocale(userLocale);
|
||||
workbook.close();
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static Stream<Arguments> data() {
|
||||
|
|
Loading…
Reference in New Issue