<target name="test-main" unless="main.test.notRequired"
depends="compile-main, -test-main-check, fail-unless-junit-is-available">
- <junit fork="yes" printsummary="yes" haltonfailure="${halt.on.test.failure}"
+ <junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="${halt.on.test.failure}"
failureproperty="main.test.failed" showoutput="true">
<classpath refid="test.classpath"/>
<sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
</target>
<target name="test-scratchpad" depends="compile-main,compile-scratchpad,-test-scratchpad-check" unless="scratchpad.test.notRequired">
- <junit printsummary="yes" fork="yes" haltonfailure="${halt.on.test.failure}" failureproperty="scratchpad.test.failed">
+ <junit printsummary="yes" fork="yes" forkmode="once" haltonfailure="${halt.on.test.failure}" failureproperty="scratchpad.test.failed">
<classpath>
<path refid="scratchpad.classpath"/>
<pathelement location="${main.output.dir}"/>
</target>
<target name="test-ooxml" depends="compile-main,compile-ooxml,-test-ooxml-check" unless="ooxml.test.notRequired">
- <junit printsummary="yes" fork="yes" haltonfailure="${halt.on.test.failure}" failureproperty="ooxml.test.failed">
+ <junit printsummary="yes" fork="yes" forkmode="once" haltonfailure="${halt.on.test.failure}" failureproperty="ooxml.test.failed">
<classpath refid="test.ooxml.classpath" />
<sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/>
<sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
import java.io.*;
import java.util.Random;
+import java.lang.reflect.Field;
import org.apache.poi.util.DummyPOILogger;
-import org.apache.poi.util.POILogFactory;
import junit.framework.*;
public void testShortConstructor() throws Exception
{
// Get the logger to be used
- DummyPOILogger logger = (DummyPOILogger)POILogFactory.getLogger(
- RawDataBlock.class
- );
+ DummyPOILogger logger = new DummyPOILogger();
+ Field fld = RawDataBlock.class.getDeclaredField("log");
+ fld.setAccessible(true);
+ fld.set(null, logger);
assertEquals(0, logger.logged.size());
// Test for various data sizes
*/
public void testSlowInputStream() throws Exception {
// Get the logger to be used
- DummyPOILogger logger = (DummyPOILogger)POILogFactory.getLogger(
- RawDataBlock.class
- );
+ DummyPOILogger logger = new DummyPOILogger();
+ Field fld = RawDataBlock.class.getDeclaredField("log");
+ fld.setAccessible(true);
+ fld.set(null, logger);
assertEquals(0, logger.logged.size());
// Test for various ok data sizes
package org.apache.poi.poifs.storage;
import java.io.*;
+import java.lang.reflect.Field;
import org.apache.poi.poifs.common.POIFSConstants;
import org.apache.poi.util.DummyPOILogger;
-import org.apache.poi.util.POILogFactory;
import junit.framework.*;
public void testShortConstructor() throws Exception
{
// Get the logger to be used
- DummyPOILogger logger = (DummyPOILogger)POILogFactory.getLogger(
- RawDataBlock.class
- );
+ DummyPOILogger logger = new DummyPOILogger();
+ Field fld = RawDataBlock.class.getDeclaredField("log");
+ fld.setAccessible(true);
+ fld.set(null, logger);
assertEquals(0, logger.logged.size());
// Test for various short sizes