Bug 63399

Summary: Ant target test-ooxml fails while running AddImageBench
Product: POI Reporter: David Gauntt <dmgauntt>
Component: POI OverallAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 4.0.x-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description David Gauntt 2019-05-03 12:06:47 UTC
When I run the test-ooxml Ant target, the build fails while running AddImageBench.

The file build/ooxml-test-results/TEST-org.apache.poi.benchmark.AddImageBench.txt contains the following:

    Testsuite: org.apache.poi.benchmark.AddImageBench
    Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec

    Testcase: initializationError took 0 sec
	    Caused an ERROR
    No runnable methods
    java.lang.Exception: No runnable methods
	    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
*** END OF FILE ***

As a workaround, I have tried adding the following lines to the "ooxml-test-runner" in build.xml, but JUnit still tries to run AddImageBench:

    <!-- At least one test in these directories fails -->
    <exclude name="**/org/apache/poi/benchmark/*"/>
    <!-- Tests known to fail -->
    <exclude name="**/AddImageBench.*"/>

I am working in Windows 10, and have had this problem running ant both from the command line and from inside Eclipse.
Comment 1 David Gauntt 2019-05-04 00:15:01 UTC
I just successfully built POI from the command line using the "assemble" target.  I will try to duplicate the problem reported here, and hope to report before 10 May 2019 what caused it.
Comment 2 David Gauntt 2019-05-05 20:32:20 UTC
It appears that the problem was in changes I had made to build.xml trying to get Ant to build POI.  The offending error was in the following text (starting at line 1612):

            <poiunit failureproperty="ooxml.xmlsec.test.failed" heap="768" jacocodest="build/jacoco-@{type}-xmlsec.exec">
                    <path refid="@{classpath}"/>
                    <path refid="test.jar.classpath"/>
                    <path refid="ooxml.xmlsec.classpath"/>
                <batchtest todir="${ooxml.reports.test}">
                    <fileset dir="${ooxml.src.test}">
                        <!-- <include name="**/TestSignatureInfo.java"/> -->

I had commented out <include name="**/TestSignatureInfo.java"/> as part of my debugging attempts.  When this line is commented out and the "assemble" target is run, the unit test "AddImageBenchmark" in target "test-ooxml" fails.  When this line is not commented out, the build succeeds. 

I will add a comment to bug 63381 "Suggested change to "How to build" instructions" with detailed suggestions on how to build POI when using Eclipse.