[jboss-cvs] JBossAS SVN: r72237 - in trunk/testsuite: imports/sections and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 15 10:57:11 EDT 2008


Author: adrian at jboss.org
Date: 2008-04-15 10:57:10 -0400 (Tue, 15 Apr 2008)
New Revision: 72237

Removed:
   trunk/testsuite/src/main/org/jboss/test/classloader/circularity/
   trunk/testsuite/src/main/org/jboss/test/classloader/concurrentload/
   trunk/testsuite/src/main/org/jboss/test/classloader/test/BasicLoaderUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/classloader/test/CircularityUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/classloader/test/DeadlockTests32.java
   trunk/testsuite/src/main/org/jboss/test/classloader/test/UnifiedLoaderUnitTestCase.java
   trunk/testsuite/src/resources/classloader/circularity/
   trunk/testsuite/src/resources/classloader/concurrentloader/
Modified:
   trunk/testsuite/build.xml
   trunk/testsuite/imports/sections/classloader.xml
   trunk/testsuite/src/main/org/jboss/test/classloader/test/ScopingUnitTestCase.java
Log:
[JBAS-5241] - Remove old UCL tests now in jboss-classloader project for the new classloader

Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml	2008-04-15 14:47:08 UTC (rev 72236)
+++ trunk/testsuite/build.xml	2008-04-15 14:57:10 UTC (rev 72237)
@@ -843,8 +843,6 @@
       <exclude name="org/jboss/test/deployers/seam/test/**"/>
    	<!-- Test of old farming implementation -->
       <exclude name="org/jboss/test/cluster/multicfg/test/ClusterFileTransferTestCase.class"/>
-      <!-- JBAS-5241 -->
-      <exclude name="org/jboss/test/classloader/test/CircularityUnitTestCase.class"/>
    </patternset>
 	
    <patternset id="jbossmq.excludes">

Modified: trunk/testsuite/imports/sections/classloader.xml
===================================================================
--- trunk/testsuite/imports/sections/classloader.xml	2008-04-15 14:47:08 UTC (rev 72236)
+++ trunk/testsuite/imports/sections/classloader.xml	2008-04-15 14:57:10 UTC (rev 72237)
@@ -3,123 +3,6 @@
    <target name="_jars-classloader" depends="compile-classes-only">
       <mkdir dir="${build.lib}"/>
       
-      <!-- build concurrentloader.sar -->
-      <jar destfile="${build.lib}/concurrentloader.sar">
-         <metainf dir="${source.resources}/classloader/concurrentloader"/>
-         <fileset dir="${build.classes}">
-            <include name="org/jboss/test/classloader/concurrentload/**"/>
-         </fileset>
-      </jar>
-      <!-- build concurrentloader.ear which deploys the concurrentloader.sar
-      with a HeirarchicalLoaderRepository
-      -->
-      <ear earfile="${build.lib}/concurrentloader.ear"
-         appxml="${build.resources}/classloader/concurrentloader/application.xml">
-         <metainf dir="${build.resources}/classloader/concurrentloader">
-            <include name="jboss-app.xml"/>
-         </metainf>
-         <fileset dir="${build.lib}">
-            <include name="concurrentloader.sar"/>
-            <include name="tests-dummy.jar"/>
-         </fileset>
-      </ear>
-      
-      <!-- build circularity.sar -->
-      <jar destfile="${build.lib}/j0.jar" basedir="${build.classes}"
-         includes="org/jboss/test/classloader/circularity/support/Class0.class"/>
-      <jar destfile="${build.lib}/j1.jar" basedir="${build.classes}"
-         includes="org/jboss/test/classloader/circularity/support/Class1.class"/>
-      <jar destfile="${build.lib}/j2.jar" basedir="${build.classes}"
-         includes="org/jboss/test/classloader/circularity/support/Class2.class"/>
-      <jar destfile="${build.lib}/j3.jar" basedir="${build.classes}"
-         includes="org/jboss/test/classloader/circularity/support/Derived.class"/>
-      <jar destfile="${build.lib}/any0.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/Base.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/Class0.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/Class2.class"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/any1.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/Class0.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/Class2.class"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/xsub1.jar">
-         <fileset dir="${build.classes}">
-            <include name="org/jboss/test/classloader/circularity/support/linkage/X.class"/>
-            <include name="org/jboss/test/classloader/circularity/support/linkage/Xsub.class"/>
-            <include name="org/jboss/test/classloader/circularity/support/linkage/Y.class"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/xsub2.jar">
-         <fileset dir="${build.classes}">
-            <include name="org/jboss/test/classloader/circularity/support/linkage/Xsub.class"/>
-            <include name="org/jboss/test/classloader/circularity/support/linkage/Y.class"/>
-         </fileset>
-      </jar>
-      
-      <jar destfile="${build.lib}/login.jar" basedir="${build.classes}"
-         manifest="${source.resources}/classloader/circularity/to-cl-util.mf"
-         includes="org/jboss/test/classloader/circularity/support/UserOfLoginInfo.class"/>
-      <jar destfile="${build.lib}/usrmgr.jar" basedir="${build.classes}"
-         manifest="${source.resources}/classloader/circularity/to-cl-util.mf"
-         includes="org/jboss/test/classloader/circularity/support/UserOfUsrMgr.class"/>
-      <jar destfile="${build.lib}/cl-util.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/LoginInfo.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/UsrMgr.class"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/le0.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/Base.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/UserOfBase.class"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/le1.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/Base.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/Support.class"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/dl10.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/pkg0/Derived.class"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/dl11.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/Base.class"/>
-         </fileset>
-      </jar>
-      
-      <!-- Jars used by the Deadlock32 tests -->
-      <jar destfile="${build.lib}/dl-a.jar">
-         <fileset dir="${build.classes}">
-            <include name="org/jboss/test/classloader/test/abc/TestA*"/>
-         </fileset>
-      </jar>
-      <jar destfile="${build.lib}/dl-b.jar">
-         <fileset dir="${build.classes}">
-            <include name="org/jboss/test/classloader/test/abc/TestB*"/>
-         </fileset>
-      </jar>
-      
       <!-- A jar that appears to contain java.sql classes for
       ScopingUnitTestCase.testSystemClasses2
       -->
@@ -131,25 +14,6 @@
          </fileset>
       </jar>
       
-      <jar destfile="${build.lib}/ha.jar">
-         <fileset dir="${build.classes}">
-            <include
-               name="org/jboss/test/classloader/circularity/support/HARMIServerImpl.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/HARMIServer.class"/>
-            <include
-               name="org/jboss/test/classloader/circularity/support/HARMIServerImpl_Stub.class"/>
-         </fileset>
-      </jar>
-      
-      <jar destfile="${build.lib}/circularity.sar">
-         <metainf dir="${source.resources}/classloader/circularity"/>
-         <fileset dir="${build.classes}">
-            <include name="org/jboss/test/classloader/circularity/*"/>
-            <include name="org/jboss/test/classloader/circularity/test/*"/>
-         </fileset>
-      </jar>
-      
       <!-- build interrupt.sar -->
       <jar destfile="${build.lib}/interrupt.sar">
          <metainf dir="${source.resources}/classloader/interrupt"/>

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/test/BasicLoaderUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/test/BasicLoaderUnitTestCase.java	2008-04-15 14:47:08 UTC (rev 72236)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/test/BasicLoaderUnitTestCase.java	2008-04-15 14:57:10 UTC (rev 72237)
@@ -1,359 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.classloader.test;
-
-import java.io.File;
-import java.net.URL;
-import java.lang.reflect.Field;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.framework.Test;
-
-import org.jboss.mx.loading.HeirarchicalLoaderRepository3;
-import org.jboss.mx.loading.UnifiedClassLoader3;
-import org.jboss.mx.loading.UnifiedLoaderRepository3;
-import org.jboss.mx.loading.RepositoryClassLoader;
-import org.jboss.test.util.ClassMover;
-import org.jboss.logging.Logger;
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.CtField;
-import javassist.Modifier;
-
-/** Basic tests of the org.jboss.mx.loading.* classes
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class BasicLoaderUnitTestCase extends TestCase
-{
-   static Logger log = Logger.getLogger(BasicLoaderUnitTestCase.class);
-   String jbosstestDeployDir;
-
-   public BasicLoaderUnitTestCase(String name)
-   {
-      super(name);
-   }
-
-   protected void setUp() throws Exception
-   {
-      jbosstestDeployDir = System.getProperty("jbosstest.deploy.dir");
-      if( jbosstestDeployDir == null )
-         throw new Exception("System property jbosstest.deploy.dir is not defined");
-   }
-
-   /** Test the UnifiedLoaderRepository for multi-threaded class loading
-    */
-   public void testNoClassDefFoundError() throws Exception
-   {
-      UnifiedLoaderRepository3 ulr = new UnifiedLoaderRepository3();
-      File cwd = new File(jbosstestDeployDir);
-      URL cp = new URL(cwd.toURL(), "../classes");
-      log.info("Using cp: " + cp);
-      ClassLoader loader = ulr.newClassLoader(cp, true);
-
-      File bakFile = null;
-      try
-      {
-         bakFile = ClassMover.move("org.jboss.test.classloader.test.ex.BaseException");
-         loader.loadClass("org.jboss.test.classloader.test.ex.DerivedException");
-         fail("Should not have loaded DerivedException");
-      }
-      catch (NoClassDefFoundError e)
-      {
-         String msg = e.getMessage();
-         log.info("NCDFE msg: " + msg, e);
-         int index = msg.indexOf("BaseException");
-         assertTrue("Saw BaseException in NCDFE: (" + index + "), msg=" + msg, index > 0);
-      }
-      finally
-      {
-         if (bakFile != null)
-            ClassMover.restore(bakFile);
-      }
-
-   }
-
-   public void testNoClassDefFoundError2() throws Exception
-   {
-      UnifiedLoaderRepository3 ulr = new UnifiedLoaderRepository3();
-      File cwd = new File(jbosstestDeployDir);
-      URL cp = new URL(cwd.toURL(), "../classes");
-      log.info("Using cp: " + cp);
-      ClassLoader loader = ulr.newClassLoader(cp, true);
-
-      File bakFile = null;
-      try
-      {
-         bakFile = ClassMover.move("org.jboss.test.classloader.test.ex.BaseException");
-         Class c = loader.loadClass("org.jboss.test.classloader.test.ex.ExThrower");
-         c.getMethods();
-         fail("Should not have gotten ExThrower methods");
-      }
-      catch (NoClassDefFoundError e)
-      {
-         String msg = e.getMessage();
-         log.info("CNFE msg: " + msg, e);
-         int index = msg.indexOf("BaseException");
-         assertTrue("Saw BaseException in CNFE: (" + index + "), msg=" + msg, index > 0);
-      }
-      finally
-      {
-         if (bakFile != null)
-            ClassMover.restore(bakFile);
-      }
-
-   }
-
-   public void testDeadlockScenario1() throws Exception
-   {
-      File libDir = new File(jbosstestDeployDir);
-      log.info("Using cp: " + libDir);
-      DeadlockTests32 test = new DeadlockTests32(libDir);
-      test.testDeadLock();
-   }
-
-   public void testDeadlockScenario2() throws Exception
-   {
-      File libDir = new File(jbosstestDeployDir);
-      log.info("Using cp: " + libDir);
-      DeadlockTests32 test = new DeadlockTests32(libDir);
-      test.testDeadLockAndCircularity();
-   }
-
-   /**
-    Validate that the added order/classpath order is used when loading classes
-    from the ULR.
-
-    @throws Exception
-    */
-   public void testClasspathOrdering() throws Exception
-   {
-      File libDir = new File(jbosstestDeployDir);
-      File classes1 = new File(libDir, "classes1");
-      classes1.mkdir();
-
-      // Create a test.Info class with a static String version = "Version 1.0"
-      ClassPool defaultPool = ClassPool.getDefault();
-      ClassPool classes1Pool = new ClassPool(defaultPool);
-      CtClass info = classes1Pool.makeClass("test.Info");
-      CtClass s = classes1Pool.get("java.lang.String");
-      CtField version = new CtField(s, "version", info);
-      version.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
-      info.addField(version, CtField.Initializer.constant("Version 1.0"));
-      info.writeFile(classes1.getAbsolutePath());
-
-      // Create a test.Info class with a static String version = "Version 2.0"
-      ClassPool classes2Pool = new ClassPool(defaultPool);
-      info = classes2Pool.makeClass("test.Info");
-      File classes2 = new File(libDir, "classes2");
-      classes2.mkdir();
-      version = new CtField(s, "version", info);
-      version.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
-      info.addField(version, CtField.Initializer.constant("Version 2.0"));      
-      info.writeFile(classes2.getAbsolutePath());
-
-      // Create a test.Info class with a static String version = "Version 3.0"
-      ClassPool classes3Pool = new ClassPool(defaultPool);
-      info = classes3Pool.makeClass("test.Info");
-      File classes3 = new File(libDir, "classes3");
-      classes3.mkdir();
-      version = new CtField(s, "version", info);
-      version.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
-      info.addField(version, CtField.Initializer.constant("Version 3.0"));      
-      info.writeFile(classes3.getAbsolutePath());
-
-      // Create a URL with classpath {classes1, classes2, classes3}
-      UnifiedLoaderRepository3 ulr = new UnifiedLoaderRepository3();
-      RepositoryClassLoader loader1 = ulr.newClassLoader(classes1.toURL(), true);
-      loader1.addURL(classes2.toURL());
-      RepositoryClassLoader loader2 = ulr.newClassLoader(classes3.toURL(), true);
-
-      // This should see version 1
-      Class infoClass = loader1.loadClass("test.Info");
-      log.info("#1.1"+infoClass.getProtectionDomain().getCodeSource());
-      Field theVersion = infoClass.getField("version");
-      String v = (String) theVersion.get(null);
-      assertTrue(v, v.equals("Version 1.0"));
-
-      // This should also see version 1
-      infoClass = loader2.loadClass("test.Info");
-      log.info("#1.2"+infoClass.getProtectionDomain().getCodeSource());
-      theVersion = infoClass.getField("version");
-      v = (String) theVersion.get(null);
-      assertTrue(v, v.equals("Version 1.0"));
-      ulr.removeClassLoader(loader1);
-      ulr.removeClassLoader(loader2);
-      ulr.flush();
-
-      // Create a URL with classpath {classes2, classes1, classes3}
-      ulr = new UnifiedLoaderRepository3();
-      loader1 = ulr.newClassLoader(classes2.toURL(), true);
-      loader1.addURL(classes1.toURL());
-      loader2 = ulr.newClassLoader(classes3.toURL(), true);
-
-      // This should see version 2
-      infoClass = loader1.loadClass("test.Info");
-      log.info("#2.1"+infoClass.getProtectionDomain().getCodeSource());
-      theVersion = infoClass.getField("version");
-      v = (String) theVersion.get(null);
-      assertTrue(v, v.equals("Version 2.0"));
-
-      // This should also see version 2
-      infoClass = loader2.loadClass("test.Info");
-      log.info("#2.2"+infoClass.getProtectionDomain().getCodeSource());
-      theVersion = infoClass.getField("version");
-      v = (String) theVersion.get(null);
-      assertTrue(v, v.equals("Version 2.0"));
-      ulr.removeClassLoader(loader1);
-      ulr.removeClassLoader(loader2);
-      ulr.flush();
-
-      // Create a URL with classpath {classes3, classes1, classes2}
-      ulr = new UnifiedLoaderRepository3();
-      loader1 = ulr.newClassLoader(classes3.toURL(), true);
-      loader1.addURL(classes1.toURL());
-      loader2 = ulr.newClassLoader(classes2.toURL(), true);
-
-      // This should see version 3
-      infoClass = loader1.loadClass("test.Info");
-      log.info("#3.1"+infoClass.getProtectionDomain().getCodeSource());
-      theVersion = infoClass.getField("version");
-      v = (String) theVersion.get(null);
-      assertTrue(v, v.equals("Version 3.0"));
-
-      // This should also see version 3
-      infoClass = loader2.loadClass("test.Info");
-      log.info("#3.2"+infoClass.getProtectionDomain().getCodeSource());
-      theVersion = infoClass.getField("version");
-      v = (String) theVersion.get(null);
-      assertTrue(v, v.equals("Version 3.0"));
-   }
-
-   /**
-    * This needs to run with a -Xmx10m in order for these iter values
-    * to produce an OME when the blacklist is not a SoftSet
-    * 
-    * @throws Exception
-    */
-   public void testBlacklistLeak()
-      throws Exception
-   {
-      UnifiedLoaderRepository3 ulr = new UnifiedLoaderRepository3();
-      URL cs = getClass().getProtectionDomain().getCodeSource().getLocation();
-      RepositoryClassLoader loader = ulr.newClassLoader(cs, true);
-      //
-      String base = "org.jboss";
-      for(int n = 0; n < 1000; n ++)
-         base += ".package"+n;
-      for(int n = 0; n < 1000; n ++)
-      {
-         String name = base + ".Class"+n;
-         try
-         {
-            Class c = loader.loadClass(name);
-            fail("was able to load: "+name);
-         }
-         catch(ClassNotFoundException e)
-         {
-            
-         }
-         catch(Error e)
-         {
-            fail("Failed with error: "+e+", iter: "+n);
-         }
-      }
-   }
-
-   /**
-    * Force a LinkageError during loading of a class to validate that
-    * a legitimate LinkageError does not cause an infinite loop.
-    * JBAS-4441
-    * @throws Exception
-    */
-   public void testLinkageError() throws Exception
-   {
-      log.info("Begin testLinkageError");
-      UnifiedLoaderRepository3 parentRepo = new UnifiedLoaderRepository3();
-      HeirarchicalLoaderRepository3 repo2 = new HeirarchicalLoaderRepository3(parentRepo);
-      repo2.setUseParentFirst(false);
-      File libDir = new File(jbosstestDeployDir);
-      URL origURL = libDir.toURL();
-      log.info("Lib origURL="+origURL);
-      URL j2 = new URL(origURL, "xsub2.jar");
-      log.info("j2 = "+j2);
-      URL j1 = new URL(origURL, "xsub1.jar");
-      log.info("j1 = "+j1);
-      ClassLoader parent = new ClassLoader()
-      {
-          @Override
-          protected synchronized Class<?> loadClass(String name, boolean resolve)
-             throws ClassNotFoundException
-          {
-             if( name.startsWith("java"))
-                return super.loadClass(name, resolve);
-             throw new ClassNotFoundException("No class loading");
-          }
-      };
-      final UnifiedClassLoader3 ucl0 = new UnifiedClassLoader3(j1, j1, parent, parentRepo);
-      parentRepo.addClassLoader(ucl0);
-      final UnifiedClassLoader3 ucl2 = new UnifiedClassLoader3(j2, j2, parent, repo2)
-      {
-         /**
-          * Throw a LinkageError to trigger the LoadMgr retry logic
-          */
-         @Override
-         public Class loadClassLocally(String name, boolean resolve) throws ClassNotFoundException
-         {
-            if( name.equals("org.jboss.test.classloader.circularity.support.linkage.X") )
-               throw new LinkageError("Cannot load X");
-            return super.loadClassLocally(name, resolve);
-         }
-      };
-      repo2.addClassLoader(ucl2);
-
-      try
-      {
-         Class c = ucl2.loadClass("org.jboss.test.classloader.circularity.support.linkage.Xsub");
-         fail("Was able to load Xsub");
-      }
-      catch(NoClassDefFoundError e)
-      {
-         log.info("Saw NoClassDefFoundError as expected", e);
-      }
-
-   }
-
-   public static Test suite()
-   {
-      TestSuite suite = new TestSuite();
-      suite.addTest(new BasicLoaderUnitTestCase("testNoClassDefFoundError"));
-      suite.addTest(new BasicLoaderUnitTestCase("testNoClassDefFoundError2"));
-      suite.addTest(new BasicLoaderUnitTestCase("testDeadlockScenario1"));
-      suite.addTest(new BasicLoaderUnitTestCase("testDeadlockScenario2"));
-      suite.addTest(new BasicLoaderUnitTestCase("testClasspathOrdering"));
-      suite.addTest(new BasicLoaderUnitTestCase("testLinkageError"));
-      return suite;
-   }
-}
-

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/test/CircularityUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/test/CircularityUnitTestCase.java	2008-04-15 14:47:08 UTC (rev 72236)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/test/CircularityUnitTestCase.java	2008-04-15 14:57:10 UTC (rev 72237)
@@ -1,116 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.classloader.test;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.jboss.test.JBossTestCase;
-import org.jboss.test.JBossTestSetup;
-
-/** Unit tests for the org.jboss.mx.loading.UnifiedLoaderRepository
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class CircularityUnitTestCase extends JBossTestCase
-{
-   private static String JMX_NAME = "jboss.test:name=CircularityError";
-   private ObjectName testObjectName;
-   private Object[] args = {};
-   private String[] sig = {};
-   MBeanServerConnection server;
-
-   public CircularityUnitTestCase(String name) throws Exception
-   {
-      super(name);
-      testObjectName = new ObjectName(JMX_NAME);
-   }
-
-   /** Test the UnifiedLoaderRepository for ClassCircularityError
-    */
-   public void testDuplicateClass() throws Exception
-   {
-      server.invoke(testObjectName, "testDuplicateClass", args, sig);
-   }
-   public void testUCLOwner() throws Exception
-   {
-      server.invoke(testObjectName, "testUCLOwner", args, sig);
-   }
-   public void testMissingSuperClass() throws Exception
-   {
-      server.invoke(testObjectName, "testMissingSuperClass", args, sig);
-   }
-   public void testLoading() throws Exception
-   {
-      server.invoke(testObjectName, "testLoading", args, sig);
-   }
-   public void testPackageProtected() throws Exception
-   {
-      server.invoke(testObjectName, "testPackageProtected", args, sig);
-   }
-   public void testDeadlockCase1() throws Exception
-   {
-      server.invoke(testObjectName, "testDeadlockCase1", args, sig);
-   }
-   public void testRecursiveLoadMT() throws Exception
-   {
-      server.invoke(testObjectName, "testRecursiveLoadMT", args, sig);
-   }
-
-   /**
-    * Setup the test suite.
-    */
-   public static Test suite() throws Exception
-   {
-      TestSuite suite = new TestSuite();
-      suite.addTest(new TestSuite(CircularityUnitTestCase.class));
-
-      // Create an initializer for the test suite
-      TestSetup wrapper = new JBossTestSetup(suite)
-      {
-         protected void setUp() throws Exception
-         {
-            super.setUp();
-            deploy("circularity.sar");
-         }
-         protected void tearDown() throws Exception
-         {
-            undeploy("circularity.sar");
-            super.tearDown();
-         }
-      };
-      return wrapper;
-   }
-
-   @Override
-   protected void setUp() throws Exception
-   {
-      // TODO Auto-generated method stub
-      super.setUp();
-      server = getServer();
-   }
-   
-}

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/test/DeadlockTests32.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/test/DeadlockTests32.java	2008-04-15 14:47:08 UTC (rev 72236)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/test/DeadlockTests32.java	2008-04-15 14:57:10 UTC (rev 72237)
@@ -1,506 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.classloader.test;
-
-import java.net.URL;
-import java.io.File;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.jboss.logging.Logger;
-import org.jboss.mx.loading.UnifiedLoaderRepository3;
-import org.jboss.mx.loading.UnifiedClassLoader3;
-import org.jboss.mx.loading.LoaderRepository;
-import org.jboss.mx.loading.LoadMgr3;
-import org.jboss.test.classloader.circularity.test.MyClassLoadingTask;
-import org.jboss.test.util.ClassMover;
-
-
-/** Additional deadlock scenario tests of the UnifiedClassLoader3
-
-     .....................................
-     :   +-------+           +-------+   :
-     :   | TestA |           | TestA2|   :
-     :   +---+---+           +---+---+   :
-     '''''''''|'''''''''''''''''''|'''''''
-              |      extends      |
-          ''''|''''''             |
-    ......|.........|.............|.........
-    : +--+----+  +--+----+     +--+----+   :
-    : | TestB |  | TestB3|     | TestB2|   :
-    : +-------+  +-------+     +-------+   :
-    :......................................:
- 
- @author Frank.Gamerdinger at Sun.COM
- @author Scott.Stark at jboss.org
- @version $Revision$
- */
-public class DeadlockTests32
-{
-   private static Logger log = Logger.getLogger(DeadlockTests32.class);
-   private SyncEvent syncEvent = new SyncEvent();
-   private TestClassLoader loaders[];
-   private UnifiedLoaderRepository3 mainRep;
-   private TestClassLoader blockingLoader;
-   private String blockname;
-
-   /**
-      [starksm at banshee testsuite]$ jar -tf output/lib/dl-a.jar
-      org/jboss/test/classloader/test/abc/TestA.class
-      org/jboss/test/classloader/test/abc/TestA2.class
-      [starksm at banshee testsuite]$ jar -tf output/lib/dl-b.jar
-      org/jboss/test/classloader/test/abc/TestB.class
-      org/jboss/test/classloader/test/abc/TestB2.class
-      org/jboss/test/classloader/test/abc/TestB3.class
-    @param libDir
-    @throws Exception
-    */ 
-   public DeadlockTests32(File libDir) throws Exception
-   {
-      ClassLoader appCl = this.getClass().getClassLoader();
-      URL u1 = new File(libDir, "dl-a.jar").toURL();
-      URL u2 = new File(libDir, "dl-b.jar").toURL();
-      loaders = new TestClassLoader[2];
-      mainRep = new UnifiedLoaderRepository3();
-      loaders[0] = new TestClassLoader(u1, appCl, mainRep);
-      loaders[1] = new TestClassLoader(u2, appCl, mainRep);
-   }
-
-   /** Scenario:
-
-    Thread T1                               Thread T2
-    classLoader 1 [a.jar]                   classLoader 2   [b.jar]
-    
-             .                                     .
-    t0 ------------------------------------------------------------
-             |                                     | loadClass(abc.TestB)
-             |                                     |----+
-             |                                     +----+ registered,
-             |                                     |
-             |                                     |----+
-             |                                     +----+ wait in beforeTaskLoop
-    t1 ------------------------------------------------------------
-             | load abc.TestB2                     |
-             |       schedule abc.TestB2 --------->|
-             |                                     |
-             |-----+                               |
-             |     | nextTask(WAIT_ON_EVENT)       | 
-             +-----+                               |
-    t2 ------------------------------------------------------------
-             |                                     | <--- release beforeTaskLoop lock
-    t3 ------------------------------------------------------------
-             |                                     | loadClassLocally(abc.TestB2)
-             |                                     |
-             |                                     |
-             |<+---------- schedule abc.TestA -----|
-             |                                     |-----+ nextTask
-             |                                     |     |
-             |                                     +-----+
-             |                                     |
-             |                                     |   loadClassLocally
-             |<+---------- schedule abc.TestA2-----|   abc.TestB
-             |                                     |
-             |                                     |-----+
-             |                                     |     | nextTask
-             |                                     +-----+ wait
-             |                                     |
-    t4 -------------------- Dead-Lock ----------------------------
-    @throws Exception
-    */ 
-   public void testDeadLock() throws Exception
-   {
-      log.info("RUNNING: testDeadLock");
-      File TestAclass = ClassMover.move("org.jboss.test.classloader.test.abc.TestA");
-      File TestBclass = ClassMover.move("org.jboss.test.classloader.test.abc.TestB");
-      File TestB2class = ClassMover.move("org.jboss.test.classloader.test.abc.TestB2");
-
-      /* Indicate that CL2 will wait after acquring the UCL registration monitor
-      and that the class its loading is TestB
-      */
-      blockingLoader = loaders[1];
-      blockname = "org.jboss.test.classloader.test.abc.TestB";
-      ClassLoader cl1 = loaders[0];
-      ClassLoader cl2 = loaders[1];
-      Runner t2 = new Runner("T2", blockname, cl2);
-      ThreadList threads = new ThreadList();
-      threads.add(t2);
-
-      log.info("t0, Waiting for T2 to start");
-      t2.start();      
-      Thread.sleep(2000);
-      log.info("t1, T2 should be waiting in beforeTaskLoop");
-
-      /* Load B2 through T1/CL1 which requires CL2 held by T2
-      */
-      Runner t1 = new Runner("T1", "org.jboss.test.classloader.test.abc.TestB2", cl1);
-      threads.add(t1);
-      log.info("t2, Waiting for T1 to start");
-      t1.start();
-      Thread.sleep(4000);
-      log.info("t3, Now releasing T2/CL2");
-      syncEvent.set();
-      log.info("t4, Waiting for T1, T2 to complete");
-      threads.waitAll();
-
-      ClassMover.restore(TestAclass);
-      ClassMover.restore(TestBclass);
-      ClassMover.restore(TestB2class);
-   }
-
-   /** Scenario:
-
-    Thread T1                               Thread T2
-    classLoader 1 [a.jar]                   classLoader 2   [b.jar]
-    
-             .                                     .
-    t0 ------------------------------------------------------------
-             |                                     | loadClass(abc.TestB)
-             |                                     |----+
-             |                                     +----+ registered,
-             |                                     |
-             |                                     |----+
-             |                                     +----+ wait in beforeTaskLoop
-    t1 ------------------------------------------------------------
-             | load abc.TestB3                     |
-             |       schedule abc.TestB3 --------->|
-             |                                     |
-             |-----+                               |
-             |     | nextTask(WAIT_ON_EVENT)       | 
-             +-----+                               |
-    t2 ------------------------------------------------------------
-             |                                     | <--- release beforeTaskLoop lock
-    t3 ------------------------------------------------------------
-             |                                     | loadClassLocally(abc.TestB3)
-             |                                     |
-             |                                     |
-             |<+---------- schedule abc.TestA -----|
-             | loadClassLocally(abc.TestA)         |
-             |-----+                               |
-             |     | nextTask(WAIT_ON_EVENT)       | 
-             +-----+                               |
-             |                                     | loadClassLocally(abc.TestB)
-             |                                     | CCE(abc.TestA)
-             |                                     |
-             |                                     |-----+
-             |                                     |     | nextTask
-             |                                     +-----+ wait(WAIT_ON_EVENT)
-             |                                     |
-    t4 -------------------- Dead-Lock ----------------------------
-    @throws Exception
-    */ 
-   public void testDeadLockAndCircularity() throws Exception
-   {
-      log.info("RUNNING: testDeadLockAndCircularity");
-      File TestAclass = ClassMover.move("org.jboss.test.classloader.test.abc.TestA");
-      File TestBclass = ClassMover.move("org.jboss.test.classloader.test.abc.TestB");
-      File TestB3class = ClassMover.move("org.jboss.test.classloader.test.abc.TestB3");
-
-      /* Indicate that CL2 will wait after acquring the UCL registration monitor
-      and that the class its loading is TestB
-      */
-      blockingLoader = loaders[1];
-      blockname = "org.jboss.test.classloader.test.abc.TestB";
-      ClassLoader cl1 = loaders[0];
-      ClassLoader cl2 = loaders[1];
-      Runner t2 = new Runner("T2", blockname, cl2);
-      ThreadList threads = new ThreadList();
-      threads.add(t2);
-      // Start t2 so that it blocks
-      log.info("t0, Waiting for T2 to start");
-      t2.start();
-      Thread.sleep(2000);
-      log.info("t1, T2 should be waiting in beforeTaskLoop");
-
-      Runner t1 = new Runner("T1", "org.jboss.test.classloader.test.abc.TestB3", cl1);
-      threads.add(t1);
-      log.info("t2, Waiting for T1 to start");
-      t1.start();
-      Thread.sleep(4000);
-      log.info("t3, Now releasing T2/CL2");
-      syncEvent.set();
-      threads.waitAll();
-
-      ClassMover.restore(TestAclass);
-      ClassMover.restore(TestBclass);
-      ClassMover.restore(TestB3class);
-   }
-
-
-   private class Runner extends Thread
-   {
-      private String clsname;
-      private ClassLoader loader;
-
-      public Runner(String name, String clsname, ClassLoader cl)
-      {
-         super(name);
-         this.clsname = clsname;
-         this.loader = cl;
-      }
-
-      private Throwable savedEx;
-
-      public Throwable getThrowable()
-      {
-         return savedEx;
-      }
-
-      public void showException()
-      {
-         if (savedEx != null)
-         {
-            log.error("Exception for: " + getName(), savedEx);
-         }
-      }
-
-      public void run()
-      {
-         try
-         {
-            Class cls = Class.forName(clsname, true, loader);
-            cls.newInstance();
-         }
-         catch (Throwable ex)
-         {
-            savedEx = ex;
-         }
-      }
-
-   }
-
-
-   public void beforeTaskLoop(UnifiedClassLoader3 cl, String clsname)
-   {
-      log.info("BeforeTaskLoop: " + clsname);
-      if (cl == blockingLoader && clsname.equals(blockname))
-      {
-         log.info("Waiting in beforeTaskLoop: " + cl + " on " + blockname);
-         try
-         {
-            syncEvent.aquire();
-         }
-         catch (InterruptedException e)
-         {
-            log.error("Interrupted", e);
-         }
-         log.info("End beforeTaskLoop: " + cl);
-      }
-   }
-
-   public class TestClassLoader extends UnifiedClassLoader3
-   {
-      public TestClassLoader(URL url, ClassLoader parent,
-         LoaderRepository repository)
-      {
-         super(url, null, parent, null);
-         repository.addClassLoader(this);
-      }
-
-      public synchronized Class loadClassImpl(String name, boolean resolve)
-         throws ClassNotFoundException
-      {
-         boolean trace = log.isTraceEnabled();
-
-         /* Since loadClass can be called from loadClassInternal with the monitor
-            already held, we need to determine if there is a ClassLoadingTask
-            which requires this UCL. If there is, we release the UCL monitor
-            so that the ClassLoadingTask can use the UCL.
-          */
-         boolean acquired = attempt(1);
-         while( acquired == false )
-         {
-            /* Another thread needs this UCL to load a class so release the
-             monitor acquired by the synchronized method. We loop until
-             we can acquire the class loading lock.
-            */
-           try
-            {
-               if( trace )
-                  log.trace("Waiting for loadClass lock");
-               this.wait();
-            }
-            catch(InterruptedException ignore)
-            {
-            }
-            acquired = attempt(1);
-         }
-
-         MyClassLoadingTask task = null;
-         try
-         {
-            Thread t = Thread.currentThread();
-            // Register this thread as owning this UCL
-            if( loadLock.holds() == 1 )
-               LoadMgr3.registerLoaderThread(this, t);
-            // Callout to cause blocking with UCL monitor held
-            beforeTaskLoop(name);
-
-            // Create a class loading task and submit it to the repository
-            task = new MyClassLoadingTask(name, this, t);
-            /* Process class loading tasks needing this UCL until our task has
-               been completed by the thread owning the required UCL(s).
-             */
-            UnifiedLoaderRepository3 ulr3 = (UnifiedLoaderRepository3) repository;
-            if( LoadMgr3.beginLoadTask(task, ulr3) == false )
-            {
-               while( task.threadTaskCount() != 0 )
-               {
-                  try
-                  {
-                     LoadMgr3.nextTask(t, task, ulr3);
-                  }
-                  catch(InterruptedException e)
-                  {
-                     // Abort the load or retry?
-                     break;
-                  }
-               }
-            }
-         }
-         finally
-         {
-            // Unregister as the UCL owner to reschedule any remaining load tasks
-            if( loadLock.holds() == 1 )
-               LoadMgr3.endLoadTask(task);
-            // Notify any threads waiting to use this UCL
-            this.release();
-            this.notifyAll();
-         }
-
-         if( task.loadedClass() == null )
-         {
-            if( task.loadException() instanceof ClassNotFoundException )
-               throw (ClassNotFoundException) task.loadException();
-            else if( task.loadException() != null )
-            {
-               if( log.isTraceEnabled() )
-                  log.trace("Unexpected error during load of:"+name, task.loadException());
-               String msg = "Unexpected error during load of: "+name
-                  + ", msg="+task.loadException().getMessage();
-               throw new ClassNotFoundException(msg);
-            }
-            // Assert that loadedClass is not null
-            else
-               throw new IllegalStateException("ClassLoadingTask.loadedTask is null, name: "+name);
-         }
-
-         return task.loadedClass();
-      }
-
-      protected void beforeTaskLoop(String clsname)
-      {
-         log.info("Calling taskLoop");
-         DeadlockTests32.this.beforeTaskLoop(this, clsname);
-      }
-
-   }
-
-   private class ThreadList
-   {
-      List list = new ArrayList();
-
-      public ThreadList()
-      {
-      }
-
-
-      public void add(Thread t)
-      {
-         list.add(t);
-      }
-
-      public void waitAll() throws Exception
-      {
-         Iterator it = list.iterator();
-         Throwable ex = null;
-         StringBuffer buf = new StringBuffer();
-         while (it.hasNext())
-         {
-            Runner t = (Runner) it.next();
-            t.join();
-            //t.showException();
-            Throwable e = t.getThrowable();
-            if (e != null)
-            {
-               buf.append("Failure for: ").append(t.getName());
-               buf.append('\n').append(e);
-               if (ex == null)
-               {
-                  ex = e;
-               }
-            }
-         }
-         if (ex != null)
-         {
-            log.info(buf.toString());
-            if (ex instanceof Exception)
-            {
-               throw (Exception) ex;
-            }
-            else if (ex instanceof Error)
-            {
-               throw (Error) ex;
-            }
-         }
-      }
-
-   }
-
-   private class SyncEvent
-   {
-      private boolean cond;
-
-      public SyncEvent()
-      {
-         this(false);
-      }
-
-      public SyncEvent(boolean initialValue)
-      {
-         cond = initialValue;
-      }
-
-
-      public void aquire() throws InterruptedException
-      {
-         synchronized (this)
-         {
-            while (!cond)
-            {
-               wait();
-            }
-         }
-      }
-
-      public synchronized void set()
-      {
-         cond = true;
-         notifyAll();
-      }
-
-      public synchronized void unset()
-      {
-         cond = false;
-      }
-
-   }
-}

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/test/ScopingUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/test/ScopingUnitTestCase.java	2008-04-15 14:47:08 UTC (rev 72236)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/test/ScopingUnitTestCase.java	2008-04-15 14:57:10 UTC (rev 72237)
@@ -222,7 +222,7 @@
       log.info("+++ Begin testSystemClasses");
       UnifiedLoaderRepository3 parent = new UnifiedLoaderRepository3();
       HeirarchicalLoaderRepository3 repository0 = new HeirarchicalLoaderRepository3(parent);
-      URL j0URL = getDeployURL("j0.jar");
+      URL j0URL = getDeployURL("tests-dummy.jar");
       RepositoryClassLoader ucl0 = repository0.newClassLoader(j0URL, true);
 
       Class c0 = ucl0.loadClass("java.sql.SQLException");

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/test/UnifiedLoaderUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/test/UnifiedLoaderUnitTestCase.java	2008-04-15 14:47:08 UTC (rev 72236)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/test/UnifiedLoaderUnitTestCase.java	2008-04-15 14:57:10 UTC (rev 72237)
@@ -1,285 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.classloader.test;
-
-import javax.management.MBeanException;
-import javax.management.ObjectName;
-
-import org.jboss.test.JBossTestCase;
-import org.jboss.system.ServiceMBean;
-
-/** Unit tests for the org.jboss.mx.loading.UnifiedLoaderRepository
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class UnifiedLoaderUnitTestCase extends JBossTestCase
-{
-   public UnifiedLoaderUnitTestCase(String name)
-   {
-      super(name);
-   }
-
-   /** Test the UnifiedLoaderRepository for multi-threaded class loading
-    */
-   public void testClassLoadingMBean() throws Exception
-   {
-      try
-      {
-         deploy("concurrentloader.sar");
-         ObjectName testName = new ObjectName("jboss.test:name=ConcurrentLoader");
-         boolean isRegistered = getServer().isRegistered(testName);
-         assertTrue(testName+" isRegistered", isRegistered);
-         Integer state = (Integer) getServer().getAttribute(testName, "State");
-         assertTrue("state.intValue() == ServiceMBean.STARTED",
-               state.intValue() == ServiceMBean.STARTED);
-      }
-      finally
-      {
-         undeploy("concurrentloader.sar");
-      } // end of try-finally
-   }
-   /** Test the UnifiedLoaderRepository being accessed by thread with an
-    interrupted status
-    */
-   public void testInterruptedThreads() throws Exception
-   {
-      try
-      {
-         deploy("interrupt.sar");
-         ObjectName testName = new ObjectName("jboss.test:name=InterruptTest");
-         boolean isRegistered = getServer().isRegistered(testName);
-         assertTrue(testName+" isRegistered", isRegistered);
-         Integer state = (Integer) getServer().getAttribute(testName, "State");
-         assertTrue("state.intValue() == ServiceMBean.STARTED",
-               state.intValue() == ServiceMBean.STARTED);
-      }
-      finally
-      {
-         undeploy("interrupt.sar");
-      } // end of try-finally
-   }
-   /**
-    * Test the UnifiedLoaderRepository finding local and global resources
-    */
-   public void testResource()
-      throws Exception
-   {
-      try
-      {
-         deploy("loadingresource.ear");
-         ObjectName testName = new ObjectName("jboss.test:name=LoadingResource");
-         boolean isRegistered = getServer().isRegistered(testName);
-         assertTrue(testName+" isRegistered", isRegistered);
-         Integer state = (Integer) getServer().getAttribute(testName, "State");
-         assertTrue("state.intValue() == ServiceMBean.STARTED",
-               state.intValue() == ServiceMBean.STARTED);
-      }
-      finally
-      {
-         undeploy("loadingresource.ear");
-      } // end of try-finally
-   }
-
-   public void testUnpackedResources()
-      throws Exception
-   {
-      deploy("unpacked/loadingresource1.ear");
-      deploy("unpacked/loadingresource2.ear");
-
-      // Assert that the version1 LoadingResource service is started
-      ObjectName testName = new ObjectName("jboss.test:name=LoadingResource,version=1");
-      boolean isRegistered = getServer().isRegistered(testName);
-      assertTrue(testName+" isRegistered", isRegistered);
-      Integer state = (Integer) getServer().getAttribute(testName, "State");
-      assertTrue("state.intValue() == ServiceMBean.STARTED",
-            state.intValue() == ServiceMBean.STARTED);
-
-      // Assert that the version1 LoadingResource service is started
-      testName = new ObjectName("jboss.test:name=LoadingResource,version=2");
-      isRegistered = getServer().isRegistered(testName);
-      assertTrue(testName+" isRegistered", isRegistered);
-      state = (Integer) getServer().getAttribute(testName, "State");
-      assertTrue("state.intValue() == ServiceMBean.STARTED",
-            state.intValue() == ServiceMBean.STARTED);
-
-      undeploy("unpacked/loadingresource1.ear");
-      undeploy("unpacked/loadingresource2.ear");
-   }
-   
-   public void testLoadingArrayClass() throws Exception
-   {
-      deploy("loadingclazz.sar");
-
-      ObjectName testName = new ObjectName("jboss.test:name=LoadingClazz");
-
-      boolean isRegistered = getServer().isRegistered(testName);
-
-      assertTrue(testName + " is registered", isRegistered);
-
-      try
-      {
-         try
-         {
-            getServer().invoke(
-               testName,
-               "loadClass",
-               new Object[] { "[Ljava.lang.String;" },
-               new String[] { String.class.getName()});
-         }
-         catch (MBeanException ex)
-         {
-            Exception tex = ex.getTargetException();
-            if (tex instanceof ClassNotFoundException)
-            {
-               fail("java.lang.String[] not found: " + ex.getMessage());
-            }
-            else
-            {
-               throw tex;
-            }
-         }
-
-         try
-         {
-            getServer().invoke(
-               testName,
-               "loadClassFromTCL",
-               new Object[] { "[Ljava.lang.String;" },
-               new String[] { String.class.getName()});
-         }
-         catch (MBeanException ex)
-         {
-            Exception tex = ex.getTargetException();
-            if (tex instanceof ClassNotFoundException)
-            {
-               fail(
-                  "java.lang.String[] not found from TCL: " + ex.getMessage());
-            }
-            else
-            {
-               throw tex;
-            }
-         }
-
-         try
-         {
-            getServer().invoke(
-               testName,
-               "loadClass",
-               new Object[] { "org.jboss.test.classloader.clazz.ClazzTest" },
-               new String[] { String.class.getName()});
-         }
-         catch (MBeanException ex)
-         {
-            Exception tex = ex.getTargetException();
-            if (tex instanceof ClassNotFoundException)
-            {
-               fail(
-                  "org.jboss.test.classloader.clazz.ClazzTest not found: "
-                     + ex.getMessage());
-            }
-            else
-            {
-               throw tex;
-            }
-         }
-
-         try
-         {
-            getServer().invoke(
-               testName,
-               "loadClassFromTCL",
-               new Object[] { "org.jboss.test.classloader.clazz.ClazzTest" },
-               new String[] { String.class.getName()});
-         }
-         catch (MBeanException ex)
-         {
-            Exception tex = ex.getTargetException();
-            if (tex instanceof ClassNotFoundException)
-            {
-               fail(
-                  "org.jboss.test.classloader.clazz.ClazzTest not found from TCL: "
-                     + ex.getMessage());
-            }
-            else
-            {
-               throw tex;
-            }
-         }
-
-         try
-         {
-            getServer().invoke(
-               testName,
-               "loadClass",
-               new Object[] { "[Lorg.jboss.test.classloader.clazz.ClazzTest;" },
-               new String[] { String.class.getName()});
-         }
-         catch (MBeanException ex)
-         {
-            Exception tex = ex.getTargetException();
-            if (tex instanceof ClassNotFoundException)
-            {
-               fail(
-                  "org.jboss.test.classloader.clazz.ClazzTest[] not found: "
-                     + ex.getMessage());
-            }
-            else
-            {
-               throw tex;
-            }
-         }
-
-         try
-         {
-            getServer().invoke(
-               testName,
-               "loadClassFromTCL",
-               new Object[] { "[Lorg.jboss.test.classloader.clazz.ClazzTest;" },
-               new String[] { String.class.getName()});
-         }
-         catch (MBeanException ex)
-         {
-            Exception tex = ex.getTargetException();
-            if (tex instanceof ClassNotFoundException)
-            {
-               fail(
-                  "org.jboss.test.classloader.clazz.ClazzTest[] not found from TCL: "
-                     + ex.getMessage());
-            }
-            else
-            {
-               throw tex;
-            }
-         }
-      }
-      finally
-      {
-         undeploy("loadingclazz.sar");
-      }
-   }
-
-   protected void debug(String message)
-   {
-      getLog().debug(message);
-   }
-}




More information about the jboss-cvs-commits mailing list