src/test/java/org/jboss/test/util/test/loading/ConstructorTCCLClassLoaderSourceUnitTestCase.java
/**
    * Tests that the ClassLoaderSource does not prevent garbage collection of
    * the classloader.
    */
Tests that the ClassLoaderSource does not prevent garbage collection of
the classloader.
Tests that the ClassLoaderSource does not prevent garbage collection of the classloader .
public void testGarbageCollectedClassLoader()
   {
      ClassLoader cl = getExtendedClassLoader();
      Thread.currentThread().setContextClassLoader(cl);
      ClassLoaderSource cls = createClassLoaderSource();
      Thread.currentThread().setContextClassLoader(origCl);
      cl = null;
      System.gc();
      assertNull("ClassLoader garbage collected", cls.getClassLoader());
   }
public void testGarbageCollectedClassLoader ( ) { ClassLoader cl = getExtendedClassLoader ( ) ; Thread . currentThread ( ) . setContextClassLoader ( cl ) ; ClassLoaderSource cls = createClassLoaderSource ( ) ; Thread . currentThread ( ) . setContextClassLoader ( origCl ) ; cl = null ; System . gc ( ) ; assertNull ( "ClassLoader garbage collected" , cls . getClassLoader ( ) ) ; }
Tests that the ClassLoaderSource does not prevent garbage collection of
 the classloader.
Tests that the ClassLoaderSource does not prevent garbage collection of the classloader .