org.jboss.test
Class JBossMemoryTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jboss.test.JBossMemoryTestCase
All Implemented Interfaces:
junit.framework.Test

public class JBossMemoryTestCase
extends junit.framework.TestCase

A Regular MemoryTestCase not using any container side.

Author:
Clebert Suconic

Constructor Summary
JBossMemoryTestCase()
           
JBossMemoryTestCase(String name)
           
 
Method Summary
protected  void checkUnload(WeakReference weakReferenceOnLoader, String className, String reportHTMLFile)
          If you started your class with -agentlib:jbossAgent in case of leakage (if className still loaded) a file (reportFile) will be created, and a heapSnapshot(./snapshot,mem)
protected  void clearEverySingleFieldOnInstances(String className)
          This method could be used for debug purposes
protected static ClassLoader newClassLoader(Class anyUserClass)
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JBossMemoryTestCase

public JBossMemoryTestCase()

JBossMemoryTestCase

public JBossMemoryTestCase(String name)
Method Detail

newClassLoader

protected static ClassLoader newClassLoader(Class anyUserClass)
                                     throws Exception
Throws:
Exception

checkUnload

protected void checkUnload(WeakReference weakReferenceOnLoader,
                           String className,
                           String reportHTMLFile)
                    throws Exception
If you started your class with -agentlib:jbossAgent in case of leakage (if className still loaded) a file (reportFile) will be created, and a heapSnapshot(./snapshot,mem)

Parameters:
weakReferenceOnLoader - A weakReference to the created ClassLoader. If there is no references to this classLoader this reference will be cleared
className - The class name supposed to be unloade.
reportHTMLFile - the report file
Throws:
Exception

clearEverySingleFieldOnInstances

protected void clearEverySingleFieldOnInstances(String className)
This method could be used for debug purposes

Parameters:
className - the class name


Copyright © 2004 JBoss Inc. All Rights Reserved.