You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/08/09 21:22:17 UTC
cvs commit: jakarta-avalon-excalibur/event/src/test/org/apache/excalibur/mpool/test PoolComparisonProfileAbstract.java
bloritsch 2002/08/09 12:22:17
Modified: event build.xml
event/src/test/org/apache/excalibur/mpool/test
PoolComparisonProfileAbstract.java
Log:
enable profiling tests with a flag
Revision Changes Path
1.31 +1 -0 jakarta-avalon-excalibur/event/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/event/build.xml,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- build.xml 8 Aug 2002 07:31:13 -0000 1.30
+++ build.xml 9 Aug 2002 19:22:16 -0000 1.31
@@ -195,6 +195,7 @@
<batchtest todir="${build.tests}">
<fileset dir="${build.testclasses}">
<include name="**/test/*TestCase.class"/>
+ <include name="**/test/*Profile.class" if="test.profile"/>
<exclude name="**/Abstract*"/>
</fileset>
</batchtest>
1.2 +55 -11 jakarta-avalon-excalibur/event/src/test/org/apache/excalibur/mpool/test/PoolComparisonProfileAbstract.java
Index: PoolComparisonProfileAbstract.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/event/src/test/org/apache/excalibur/mpool/test/PoolComparisonProfileAbstract.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PoolComparisonProfileAbstract.java 7 Aug 2002 22:44:26 -0000 1.1
+++ PoolComparisonProfileAbstract.java 9 Aug 2002 19:22:16 -0000 1.2
@@ -55,6 +55,7 @@
import org.apache.avalon.framework.logger.LogKitLogger;
import org.apache.avalon.framework.logger.Logger;
import org.apache.excalibur.mpool.FixedSizePool;
+import org.apache.excalibur.mpool.BlockingFixedSizePool;
import org.apache.excalibur.mpool.ObjectFactory;
import org.apache.excalibur.mpool.Pool;
import org.apache.excalibur.mpool.VariableSizePool;
@@ -130,30 +131,73 @@
}
/**
- * Compare the FixedSizePool and ResourceLimitingPool when the
- * ResourceLimitingPool is configured to act like a FixedSizePool.
+ * Compare the FixedSizePool and BlockingFixedSizePool when the
+ * BlockingFixedSizePool is configured to act like a FixedSizePool.
* <p>
* Test will use pools with a max size of 100, while getting up to 100 at a time,
* Poolables are medium objects.
*/
- public void testCompare_FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables()
+ public void testCompare_FixedSizePool_And_BlockingFixedSizePool_Max100_Gets100_SmallPoolables()
throws Exception
{
- String name = "FixedSizePool_And_ResourceLimitingPool_Max100_Gets100_MediumPoolables";
+ String name = "FixedSizePool_And_BlockingFixedSizePool_Max100_Gets100_SmallPoolables";
+
+ Class poolableClass = SmallPoolable.class;
+ ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
+ int min = 0;
+ int max = 100;
+ long blockTimeout = 1;
+
+ FixedSizePool poolA = new FixedSizePool( factory, max );
+ BlockingFixedSizePool poolB = new BlockingFixedSizePool( factory, max, blockTimeout );
+
+ generalTest( name, poolA, poolB, 100, factory );
+ }
+
+ /**
+ * Compare the FixedSizePool and BlockingFixedSizePool when the
+ * BlockingFixedSizePool is configured to act like a FixedSizePool.
+ * <p>
+ * Test will use pools with a max size of 100, while getting up to 100 at a time,
+ * Poolables are medium objects.
+ */
+ public void testCompare_FixedSizePool_And_BlockingFixedSizePool_Max100_Gets100_MediumPoolables()
+ throws Exception
+ {
+ String name = "FixedSizePool_And_BlockingFixedSizePool_Max100_Gets100_MediumPoolables";
Class poolableClass = MediumPoolable.class;
ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
int min = 0;
int max = 100;
- boolean maxStrict = true;
- boolean blocking = false;
- long blockTimeout = 0;
- long trimInterval = 0;
+ long blockTimeout = 1;
FixedSizePool poolA = new FixedSizePool( factory, max );
+ BlockingFixedSizePool poolB = new BlockingFixedSizePool( factory, max, blockTimeout );
- ResourceLimitingPool poolB = new ResourceLimitingPool( factory, max, maxStrict, blocking, blockTimeout, trimInterval );
- poolB.enableLogging( m_poolLogger );
+ generalTest( name, poolA, poolB, 100, factory );
+ }
+
+ /**
+ * Compare the FixedSizePool and BlockingFixedSizePool when the
+ * BlockingFixedSizePool is configured to act like a FixedSizePool.
+ * <p>
+ * Test will use pools with a max size of 100, while getting up to 100 at a time,
+ * Poolables are medium objects.
+ */
+ public void testCompare_FixedSizePool_And_BlockingFixedSizePool_Max100_Gets100_LargePoolables()
+ throws Exception
+ {
+ String name = "FixedSizePool_And_BlockingFixedSizePool_Max100_Gets100_LargePoolables";
+
+ Class poolableClass = LargePoolable.class;
+ ClassInstanceObjectFactory factory = new ClassInstanceObjectFactory( poolableClass, m_poolLogger );
+ int min = 0;
+ int max = 100;
+ long blockTimeout = 1;
+
+ FixedSizePool poolA = new FixedSizePool( factory, max );
+ BlockingFixedSizePool poolB = new BlockingFixedSizePool( factory, max, blockTimeout );
generalTest( name, poolA, poolB, 100, factory );
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>