Allow to produce a jar for the integration-test-code so we can use it directly in the mass-regression tests without having to copy it for every run.
Enable some forbidden-api-checks for integration-test code git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808506 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6044d4629c
commit
92ae9ce5e0
@ -445,6 +445,8 @@ under the License.
|
|||||||
<path refid="ooxml.classpath"/>
|
<path refid="ooxml.classpath"/>
|
||||||
<path refid="ooxml.xmlsec.classpath"/>
|
<path refid="ooxml.xmlsec.classpath"/>
|
||||||
<path refid="excelant.classpath"/>
|
<path refid="excelant.classpath"/>
|
||||||
|
<path refid="examples.classpath"/>
|
||||||
|
<pathelement location="${examples.output.dir}"/>
|
||||||
<path path="${env.CLASSPATH}"/>
|
<path path="${env.CLASSPATH}"/>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
@ -1978,6 +1980,9 @@ under the License.
|
|||||||
<maven-jar dir="${excelant.src}"/>
|
<maven-jar dir="${excelant.src}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="integration-test-jar" depends="compile-integration,-manifest" description="target for packaging the integration-test code for mass regression test runs">
|
||||||
|
<maven-jar dir="${integration.output.test.dir}"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="-do-jar-check-javadocs-package-list">
|
<target name="-do-jar-check-javadocs-package-list">
|
||||||
<condition property="javadocs.package-list.present">
|
<condition property="javadocs.package-list.present">
|
||||||
@ -2228,7 +2233,7 @@ under the License.
|
|||||||
<!-- spot any cases where we've accidently used methods we shouldn't -->
|
<!-- spot any cases where we've accidently used methods we shouldn't -->
|
||||||
<!-- See https://github.com/policeman-tools/forbidden-apis for details -->
|
<!-- See https://github.com/policeman-tools/forbidden-apis for details -->
|
||||||
<!-- of the checks that this can do -->
|
<!-- of the checks that this can do -->
|
||||||
<target name="forbidden-apis-check" depends="init, compile">
|
<target name="forbidden-apis-check" depends="init, compile, compile-integration">
|
||||||
<taskdef name="forbiddenapis"
|
<taskdef name="forbiddenapis"
|
||||||
classname="de.thetaphi.forbiddenapis.ant.AntTask"
|
classname="de.thetaphi.forbiddenapis.ant.AntTask"
|
||||||
classpath="${forbidden.jar}"/>
|
classpath="${forbidden.jar}"/>
|
||||||
@ -2262,6 +2267,7 @@ under the License.
|
|||||||
<!--
|
<!--
|
||||||
<fileset dir="${scratchpad.output.test.dir}"/>
|
<fileset dir="${scratchpad.output.test.dir}"/>
|
||||||
<fileset dir="${excelant.output.test.dir}"/>
|
<fileset dir="${excelant.output.test.dir}"/>
|
||||||
|
<fileset dir="${integration.output.test.dir}"/>
|
||||||
-->
|
-->
|
||||||
</forbiddenapis>
|
</forbiddenapis>
|
||||||
|
|
||||||
@ -2277,6 +2283,7 @@ under the License.
|
|||||||
<fileset dir="${ooxml.output.dir}"/>
|
<fileset dir="${ooxml.output.dir}"/>
|
||||||
<fileset dir="${scratchpad.output.dir}"/>
|
<fileset dir="${scratchpad.output.dir}"/>
|
||||||
<fileset dir="${excelant.output.dir}"/>
|
<fileset dir="${excelant.output.dir}"/>
|
||||||
|
<fileset dir="${integration.output.test.dir}"/>
|
||||||
</forbiddenapis>
|
</forbiddenapis>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ import java.io.*;
|
|||||||
import org.apache.poi.hslf.record.Record;
|
import org.apache.poi.hslf.record.Record;
|
||||||
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
|
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
|
||||||
import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
|
import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
|
||||||
|
import org.apache.poi.util.POILogger;
|
||||||
|
import org.apache.poi.util.SystemOutLogger;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class HSLFFileHandler extends SlideShowHandler {
|
public class HSLFFileHandler extends SlideShowHandler {
|
||||||
@ -52,7 +54,7 @@ public class HSLFFileHandler extends SlideShowHandler {
|
|||||||
testOneFile(new File("test-data/slideshow/54880_chinese.ppt"));
|
testOneFile(new File("test-data/slideshow/54880_chinese.ppt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// a test-case to test this locally without executing the full TestAllFiles
|
// a test-case to test all .ppt files without executing the full TestAllFiles
|
||||||
@Override
|
@Override
|
||||||
@Test
|
@Test
|
||||||
public void test() throws Exception {
|
public void test() throws Exception {
|
||||||
@ -66,11 +68,12 @@ public class HSLFFileHandler extends SlideShowHandler {
|
|||||||
|
|
||||||
System.out.println("Testing " + files.length + " files");
|
System.out.println("Testing " + files.length + " files");
|
||||||
|
|
||||||
|
POILogger logger = new SystemOutLogger();
|
||||||
for(File file : files) {
|
for(File file : files) {
|
||||||
try {
|
try {
|
||||||
testOneFile(file);
|
testOneFile(file);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
logger.log(POILogger.WARN, "Failed to handle file " + file, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user