aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases/org/apache
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2020-12-13 13:10:53 +0000
committerAndreas Beeker <kiwiwings@apache.org>2020-12-13 13:10:53 +0000
commit83c6910dbd5501baf7330f6284e7527b0e7d0e37 (patch)
tree0d49e9f81771a296c8e065352a7cc20fb6ae1fa2 /src/ooxml/testcases/org/apache
parentc5f6dfa68e04c5a42b64b3f862756b9c990665dc (diff)
downloadpoi-83c6910dbd5501baf7330f6284e7527b0e7d0e37.tar.gz
poi-83c6910dbd5501baf7330f6284e7527b0e7d0e37.zip
mute talkative tests, which spam to StdOut/StdErr
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884379 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache')
-rw-r--r--src/ooxml/testcases/org/apache/poi/util/tests/TestTempFileThreaded.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java10
-rw-r--r--src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java9
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java35
4 files changed, 27 insertions, 29 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/util/tests/TestTempFileThreaded.java b/src/ooxml/testcases/org/apache/poi/util/tests/TestTempFileThreaded.java
index 8c203e69b9..57837d13cd 100644
--- a/src/ooxml/testcases/org/apache/poi/util/tests/TestTempFileThreaded.java
+++ b/src/ooxml/testcases/org/apache/poi/util/tests/TestTempFileThreaded.java
@@ -157,7 +157,7 @@ public class TestTempFileThreaded {
files.get(threadNum).add(file);
if (iter % 30 == 0) {
- System.out.println("thread: " + threadNum + ", iter: " + iter + ": " + file);
+ // System.out.println("thread: " + threadNum + ", iter: " + iter + ": " + file);
}
}
}
diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java
index 7717c5062f..043a8e1209 100644
--- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java
+++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java
@@ -20,6 +20,7 @@
package org.apache.poi.xslf.usermodel;
import static java.util.Arrays.asList;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import java.io.File;
@@ -98,10 +99,17 @@ public class TestPPTX2PNG {
}
private String[] getArgs(String format) throws IOException {
+ File tmpDir = new File("build/tmp/");
+
+ // fix maven build errors
+ if (!tmpDir.exists()) {
+ assertTrue(tmpDir.mkdirs());
+ }
+
final List<String> args = new ArrayList<>(asList(
"-format", format, // png,gif,jpg,svg,pdf or null for test
"-slide", "-1", // -1 for all
- "-outdir", new File("build/tmp/").getCanonicalPath(),
+ "-outdir", tmpDir.getCanonicalPath(),
"-outpat", "${basename}-${slideno}-${ext}.${format}",
// "-dump", new File("build/tmp/", pptFile+".json").getCanonicalPath(),
"-dump", "null",
diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java
index 6937aad832..88ba9a576e 100644
--- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java
+++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java
@@ -306,11 +306,18 @@ public class TestXSLFSimpleShape {
@Test
public void testArrayStoreException() throws Exception {
+ File tmpDir = new File("build/tmp/");
+
+ // fix maven build errors
+ if (!tmpDir.exists()) {
+ assertTrue(tmpDir.mkdirs());
+ }
+
File file = POIDataSamples.getSlideShowInstance().getFile("aascu.org_workarea_downloadasset.aspx_id=5864.pptx");
String[] args = {
"-format", "null", // png,gif,jpg,svg or null for test
"-slide", "-1", // -1 for all
- "-outdir", new File("build/tmp/").getCanonicalPath(),
+ "-outdir", tmpDir.getCanonicalPath(),
"-quiet",
"-fixside", "long",
"-scale", "800",
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java
index 37f57baa3c..1041b94fa8 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRowsAndColumns.java
@@ -17,13 +17,8 @@
package org.apache.poi.xssf.usermodel;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.util.CellAddress;
-import org.apache.poi.ss.util.CellRangeAddress;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileOutputStream;
@@ -31,8 +26,13 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.Locale;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.ss.util.CellAddress;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
public class TestXSSFSheetShiftRowsAndColumns {
private static final File resultDir = new File("build/custom-reports-test");
@@ -81,8 +81,6 @@ public class TestXSSFSheetShiftRowsAndColumns {
*/
final CellRangeAddress range = new CellRangeAddress(FIRST_MERGE_ROW,LAST_MERGE_ROW,FIRST_MERGE_COL,LAST_MERGE_COL);
sheet.addMergedRegion(range);
- System.out.println(String.format(Locale.US, "\n%s: mergeArea=%s", procName,range));
-
writeFile(procName);
}
@@ -94,12 +92,10 @@ public class TestXSSFSheetShiftRowsAndColumns {
public void cleanup() throws IOException {
final String procName = "TestXSSFSheetRemoveTable.cleanup";
if (workbook == null) {
- System.out.println(String.format(Locale.ROOT,"%s: workbook==null",procName));
return;
}
if(fileName == null) {
- System.out.println(String.format(Locale.ROOT, "%s: fileName==null",procName));
return;
}
@@ -112,7 +108,6 @@ public class TestXSSFSheetShiftRowsAndColumns {
final File file = new File(resultDir,fileName);
try (OutputStream fileOut = new FileOutputStream(file)) {
workbook.write(fileOut);
- System.out.println(String.format(Locale.ROOT, "%s: test file written to %s",procName,file.getAbsolutePath()));
}
}
@@ -126,8 +121,6 @@ public class TestXSSFSheetShiftRowsAndColumns {
testCellAddresses(procName,0,0);
testMergeRegion(procName,0,0);
-
- System.out.println(String.format(Locale.US, "%s: finished without error", procName));
}
@Test
@@ -138,7 +131,6 @@ public class TestXSSFSheetShiftRowsAndColumns {
sheet.shiftRows(INSERT_ROW, numRows-1, nRowsToShift);
testCellAddresses(procName,nRowsToShift,0);
- System.out.println(String.format(Locale.US, "%s: finished without error", procName));
}
@Test
@@ -149,7 +141,6 @@ public class TestXSSFSheetShiftRowsAndColumns {
sheet.shiftRows(INSERT_ROW, numRows-1, nRowsToShift);
testMergeRegion(procName,nRowsToShift,0);
- System.out.println(String.format(Locale.US, "%s: finished without error", procName));
}
@Test
@@ -160,7 +151,6 @@ public class TestXSSFSheetShiftRowsAndColumns {
sheet.shiftColumns(INSERT_COLUMN, numCols-1, nShift);
testCellAddresses(procName,0,nShift);
- System.out.println(String.format(Locale.US, "%s: finished without error", procName));
}
@Test
@@ -171,7 +161,6 @@ public class TestXSSFSheetShiftRowsAndColumns {
sheet.shiftColumns(INSERT_COLUMN, numCols-1, nShift);
testMergeRegion(procName,0, nShift);
- System.out.println(String.format(Locale.US, "%s: finished without error", procName));
}
/**
@@ -183,24 +172,18 @@ public class TestXSSFSheetShiftRowsAndColumns {
for(int nRow = 0;nRow<nNumRows;++nRow) {
final XSSFRow row = sheet.getRow(nRow);
if(row == null) {
- System.out.println(String.format(Locale.US, "%s: Row %d is empty", procName,nRow));
continue;
}
for(int nCol = 0;nCol<nNumCols;++nCol) {
final String address = new CellAddress(nRow,nCol).formatAsString();
final XSSFCell cell = row.getCell(nCol);
if(cell == null) {
- System.out.println(String.format(Locale.US, "%s: Cell %s is empty", procName,address));
continue;
}
final CTCell ctCell = cell.getCTCell();
final Object cellAddress = cell.getAddress().formatAsString();
final Object r = ctCell.getR();
- if(nCol == 0 || nRow == 0) {
- System.out.println(String.format(Locale.US, "%s: Row %d col %d address=%s cell.address=%s cell.getR=%s", procName, nRow,
- nCol, address, cellAddress, ctCell.getR()));
- }
assertEquals(String.format(Locale.US, "%s: Testing cell.getAddress",procName),address,cellAddress);
assertEquals(String.format(Locale.US, "%s: Testing ctCell.getR",procName),address,r);
}