leif 02/02/22 00:25:03
Modified: src/test/org/apache/avalon/excalibur/component/test
ExcaliburComponentManagerTestCase.java
Log:
Memory checking code does not really show any problem because
the JUnit memory is increasing due to the tests being run.
Revision Changes Path
1.6 +1 -30
jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/component/test/ExcaliburComponentManagerTestCase.java
Index: ExcaliburComponentManagerTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/component/test/ExcaliburComponentManagerTestCase.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ExcaliburComponentManagerTestCase.java 21 Feb 2002 06:45:14 -0000
1.5
+++ ExcaliburComponentManagerTestCase.java 22 Feb 2002 08:25:03 -0000
1.6
@@ -40,7 +40,7 @@
* it is correctly handling component lifestyle management.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ryan Shaw</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class ExcaliburComponentManagerTestCase extends TestCase
{
@@ -116,28 +116,9 @@
return suite;
}
- protected long resetMemory()
- {
- System.gc();
- System.gc();
-
- // Let the system settle down.
- try
- {
- Thread.sleep( 50 );
- }
- catch (InterruptedException e ) {}
- Runtime runtime = Runtime.getRuntime();
- long memory = runtime.totalMemory() - runtime.freeMemory();
- //m_logger.debug( "Memory: " + memory );
- return memory;
- }
-
protected void managerLifecycle(Class momClass, Class dadClass, Class
kidClass)
throws Exception
{
- long startMemory = resetMemory();
-
Configuration emptyConfig = new DefaultConfiguration( "", "" );
m_manager.addComponent( Mom.ROLE, momClass, emptyConfig );
@@ -150,21 +131,11 @@
Component dad = m_manager.lookup( Dad.ROLE );
m_manager.release( mom );
- mom = null;
m_manager.release( dad );
- dad = null;
m_manager.dispose();
- m_manager = null;
- emptyConfig = null;
checkNumberOfDisposals( momClass, dadClass, kidClass );
-
- long endMemory = resetMemory();
-
- m_logger.info("Test start memory=" + startMemory +
- " end memory=" + endMemory +
- " diff=" + (endMemory - startMemory));
}
private void checkNumberOfDisposals( Class momClass, Class dadClass,
Class kidClass )
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>