From: Yegor Kozlov Date: Fri, 10 Apr 2009 06:44:54 +0000 (+0000) Subject: set forkmode=once for junit tests, it made the build process faster by 5x X-Git-Tag: REL_3_5_BETA6~65 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9b561e8d3ff23e9c172e8841192d67624c236378;p=poi.git set forkmode=once for junit tests, it made the build process faster by 5x git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@763881 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/build.xml b/build.xml index db8c88ea82..4f98d06394 100644 --- a/build.xml +++ b/build.xml @@ -562,7 +562,7 @@ under the License. - @@ -676,7 +676,7 @@ under the License. - + @@ -782,7 +782,7 @@ under the License. - + diff --git a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java index a4cdb734a6..4447ceed5d 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java @@ -21,9 +21,9 @@ package org.apache.poi.poifs.storage; 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.*; @@ -115,9 +115,10 @@ public class TestRawDataBlock 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 @@ -168,9 +169,10 @@ public class TestRawDataBlock */ 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 diff --git a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlockList.java b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlockList.java index 0f65c0e8a4..81ee0501c4 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlockList.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlockList.java @@ -20,10 +20,10 @@ 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.*; @@ -91,9 +91,10 @@ public class TestRawDataBlockList 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