Adjust to make forbidden-api-check succeed again

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808930 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2017-09-19 19:02:31 +00:00
parent 985af5304a
commit 1496e83eaa
4 changed files with 12 additions and 31 deletions

View File

@ -20,10 +20,7 @@
==================================================================== */ ==================================================================== */
package org.apache.poi.dev; package org.apache.poi.dev;
import java.io.File; import java.io.*;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.OPCPackage;
@ -38,14 +35,14 @@ public class TestOOXMLLister {
private static PrintStream SYSTEM_OUT; private static PrintStream SYSTEM_OUT;
@BeforeClass @BeforeClass
public static void setUp() { public static void setUp() throws UnsupportedEncodingException {
SYSTEM_OUT = System.out; SYSTEM_OUT = System.out;
System.setOut(new PrintStream(new OutputStream() { System.setOut(new PrintStream(new OutputStream() {
@Override @Override
public void write(int b) throws IOException { public void write(int b) throws IOException {
} }
})); }, false, "UTF-8"));
} }
@AfterClass @AfterClass

View File

@ -26,10 +26,7 @@ import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import java.io.File; import java.io.*;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
@ -39,14 +36,14 @@ public class TestOOXMLPrettyPrint {
private static PrintStream SYSTEM_OUT; private static PrintStream SYSTEM_OUT;
@BeforeClass @BeforeClass
public static void setUp() { public static void setUp() throws UnsupportedEncodingException {
SYSTEM_OUT = System.out; SYSTEM_OUT = System.out;
System.setOut(new PrintStream(new OutputStream() { System.setOut(new PrintStream(new OutputStream() {
@Override @Override
public void write(int b) throws IOException { public void write(int b) throws IOException {
} }
})); }, false, "UTF-8"));
} }
@AfterClass @AfterClass

View File

@ -28,13 +28,7 @@ import org.junit.BeforeClass;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.io.ByteArrayOutputStream; import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -42,15 +36,14 @@ public class TestPOIFSDump {
private static PrintStream SYSTEM; private static PrintStream SYSTEM;
@BeforeClass @BeforeClass
public static void setUp() { public static void setUp() throws UnsupportedEncodingException {
SYSTEM = System.out; SYSTEM = System.out;
System.setOut(new PrintStream(new OutputStream() { System.setOut(new PrintStream(new OutputStream() {
@Override @Override
public void write(int b) throws IOException { public void write(int b) throws IOException {
} }
} }, false, "UTF-8"));
));
} }
@AfterClass @AfterClass

View File

@ -22,13 +22,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream; import java.io.*;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
@ -39,14 +33,14 @@ public class TestHexDump {
private static PrintStream SYSTEM_OUT; private static PrintStream SYSTEM_OUT;
@BeforeClass @BeforeClass
public static void setUp() { public static void setUp() throws UnsupportedEncodingException {
SYSTEM_OUT = System.out; SYSTEM_OUT = System.out;
System.setOut(new PrintStream(new OutputStream() { System.setOut(new PrintStream(new OutputStream() {
@Override @Override
public void write(int b) throws IOException { public void write(int b) throws IOException {
} }
})); }, false, "UTF-8"));
} }
@AfterClass @AfterClass