aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases/org/apache/poi/xssf
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-08-16 20:51:40 +0000
committerDominik Stadler <centic@apache.org>2015-08-16 20:51:40 +0000
commitb49c01c35595a4b51af8e70fbd57d0b78167f61a (patch)
tree5d118662f55a82fae6c50409cbe454a4ac75db5b /src/ooxml/testcases/org/apache/poi/xssf
parentf39dc1387ffc611aac0f093bdbf212e77baa9661 (diff)
downloadpoi-b49c01c35595a4b51af8e70fbd57d0b78167f61a.tar.gz
poi-b49c01c35595a4b51af8e70fbd57d0b78167f61a.zip
Try to make Sonar builds run again: add missing dependency, add ooxml-schema-security, don't depend on dir test-data and build-directory directly, don't override a POILogger that is set via System Properties
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1696165 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xssf')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java7
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java14
2 files changed, 10 insertions, 11 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
index 2a7752c525..1409d42274 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
@@ -1923,6 +1923,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
@Test
public void test57196_WorkbookEvaluator() {
+ String previousLogger = System.getProperty("org.apache.poi.util.POILogger");
//System.setProperty("org.apache.poi.util.POILogger", "org.apache.poi.util.SystemOutLogger");
//System.setProperty("poi.log.level", "3");
try {
@@ -1990,7 +1991,11 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
workbookEvaluator.setDebugEvaluationOutputForNextEval(true);
workbookEvaluator.evaluate(new XSSFEvaluationCell(cell));
} finally {
- System.clearProperty("org.apache.poi.util.POILogger");
+ if(previousLogger == null) {
+ System.clearProperty("org.apache.poi.util.POILogger");
+ } else {
+ System.setProperty("org.apache.poi.util.POILogger", previousLogger);
+ }
System.clearProperty("poi.log.level");
}
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java
index fbec25c670..6f8c3f087c 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java
@@ -17,6 +17,8 @@
package org.apache.poi.xssf.usermodel;
+import java.io.IOException;
+
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
import org.apache.poi.ss.usermodel.BaseTestHyperlink;
@@ -32,15 +34,6 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink {
super(XSSFITestDataProvider.instance);
}
- @Override
- protected void setUp() {
- // Use system out logger
- System.setProperty(
- "org.apache.poi.util.POILogger",
- "org.apache.poi.util.SystemOutLogger"
- );
- }
-
public void testLoadExisting() {
XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook("WithMoreVariousData.xlsx");
assertEquals(3, workbook.getNumberOfSheets());
@@ -94,7 +87,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink {
}
}
- public void testInvalidURLs() {
+ public void testInvalidURLs() throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFCreationHelper createHelper = workbook.getCreationHelper();
@@ -111,6 +104,7 @@ public final class TestXSSFHyperlink extends BaseTestHyperlink {
}
}
+ workbook.close();
}
public void testLoadSave() {