[jboss-cvs] JBossAS SVN: r87603 - in projects/bootstrap/trunk/spi-test: src/test/java/org/jboss/bootstrap/spi/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 20 22:47:02 EDT 2009


Author: ALRubinger
Date: 2009-04-20 22:47:02 -0400 (Mon, 20 Apr 2009)
New Revision: 87603

Modified:
   projects/bootstrap/trunk/spi-test/pom.xml
   projects/bootstrap/trunk/spi-test/src/test/java/org/jboss/bootstrap/spi/test/ClassLoadingTestCase.java
Log:
[JBBOOT-46] Test bootstrap-spi using aop and aop-mc-int on the URLCP, ensuring that we don not leak out Kernel references (as was previously via MCServer, causing NCDFE from parent/child CL relationship)

Modified: projects/bootstrap/trunk/spi-test/pom.xml
===================================================================
--- projects/bootstrap/trunk/spi-test/pom.xml	2009-04-21 02:39:36 UTC (rev 87602)
+++ projects/bootstrap/trunk/spi-test/pom.xml	2009-04-21 02:47:02 UTC (rev 87603)
@@ -2,7 +2,8 @@
   <!--
   vi:ts=2:sw=2:expandtab:
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <!-- Parent -->
   <parent>
@@ -26,15 +27,16 @@
   <properties>
 
     <!-- Versioning -->
-    <version.org.jboss.bootstrap_jboss.bootstrap.impl.base>0.1.1</version.org.jboss.bootstrap_jboss.bootstrap.impl.base>
-    <version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>0.1.1</version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>
-    <version.org.jboss.bootstrap_jboss.bootstrap.spi>0.1.1</version.org.jboss.bootstrap_jboss.bootstrap.spi>
-    <version.org.jboss.bootstrap_jboss.bootstrap.spi.mc>0.1.1</version.org.jboss.bootstrap_jboss.bootstrap.spi.mc>
+    <version.org.jboss.aop_jboss.aop>2.0.0.SP1</version.org.jboss.aop_jboss.aop>
+    <version.org.jboss.bootstrap_jboss.bootstrap.impl.base>0.1.2-SNAPSHOT</version.org.jboss.bootstrap_jboss.bootstrap.impl.base>
+    <version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>0.1.2-SNAPSHOT</version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>
+    <version.org.jboss.bootstrap_jboss.bootstrap.spi>0.1.2-SNAPSHOT</version.org.jboss.bootstrap_jboss.bootstrap.spi>
+    <version.org.jboss.bootstrap_jboss.bootstrap.spi.mc>0.1.2-SNAPSHOT</version.org.jboss.bootstrap_jboss.bootstrap.spi.mc>
     <version.org.jboss.logging_jboss.logging.log4j>2.0.6.GA</version.org.jboss.logging_jboss.logging.log4j>
     <version.org.jboss.logging_jboss.logging.spi>2.0.5.GA</version.org.jboss.logging_jboss.logging.spi>
     <version.org.jboss.microcontainer_jboss.kernel>2.0.4.GA</version.org.jboss.microcontainer_jboss.kernel>
+    <version.org.jboss.microcontainer_jboss.aop.mc.int>2.2.0.M1</version.org.jboss.microcontainer_jboss.aop.mc.int>
     <version.org.jboss_jbossxb>2.0.0.GA</version.org.jboss_jbossxb>
-
     <version.org.jboss_jboss.common.core>2.2.8.GA</version.org.jboss_jboss.common.core>
     <version.org.jboss_jboss.reflect>2.0.0.GA</version.org.jboss_jboss.reflect>
     <version.apache_xerces_xml.apis>2.9.1</version.apache_xerces_xml.apis>
@@ -47,6 +49,8 @@
     <version.org.jboss_jboss.mdr>2.0.1.GA</version.org.jboss_jboss.mdr>
     <version.sun_jaxb_jaxb_api>2.1.4</version.sun_jaxb_jaxb_api>
     <version.org.jboss.microcontainer_jboss.dependency>2.0.4.GA</version.org.jboss.microcontainer_jboss.dependency>
+    <version.trove_trove>2.1.1</version.trove_trove>
+    <version.javassist_javassist>3.9.0.GA</version.javassist_javassist>
 
   </properties>
 
@@ -107,8 +111,6 @@
                   <artifactId>jbossxb</artifactId>
                   <version>${version.org.jboss_jbossxb}</version>
                 </artifactItem>
-
-
                 <artifactItem>
                   <groupId>org.jboss</groupId>
                   <artifactId>jboss-common-core</artifactId>
@@ -169,6 +171,27 @@
                   <artifactId>jboss-dependency</artifactId>
                   <version>${version.org.jboss.microcontainer_jboss.dependency}</version>
                 </artifactItem>
+                <artifactItem>
+                  <groupId>org.jboss.aop</groupId>
+                  <artifactId>jboss-aop</artifactId>
+                  <version>${version.org.jboss.aop_jboss.aop}</version>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.jboss.microcontainer</groupId>
+                  <artifactId>jboss-aop-mc-int</artifactId>
+                  <version>${version.org.jboss.microcontainer_jboss.aop.mc.int}</version>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>trove</groupId>
+                  <artifactId>trove</artifactId>
+                  <version>${version.trove_trove}</version>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>javassist</groupId>
+                  <artifactId>javassist</artifactId>
+                  <artifactId>javassist</artifactId>
+                  <version>${version.javassist_javassist}</version>
+                </artifactItem>
               </artifactItems>
             </configuration>
           </execution>
@@ -183,23 +206,18 @@
     <!--
 
       The ONLY dependencies allowed in this section are upon the
-      Bootstrap SPIs and JUnit. Anything else will either fail the tests
-      or render them invalid. The purpose of this project is to ensure
-      that the Server may be launched with *only* the bootstrap SPIs
-      upon the application classpath. Other dependencies must be added
-      to the dependency plugin configuration to be placed in target/lib.
+      bootstrap-spi and JUnit. Anything else will either fail
+      the tests or render them invalid. The purpose of this project is
+      to ensure that the Server may be launched with *only* the
+      bootstrap SPI upon the application classpath. Other dependencies
+      must be added to the dependency plugin configuration to be placed
+      in target/lib.
     -->
 
     <dependency>
       <groupId>org.jboss.bootstrap</groupId>
-      <artifactId>jboss-bootstrap-spi-mc</artifactId>
-      <version>${version.org.jboss.bootstrap_jboss.bootstrap.spi.mc}</version>
-      <exclusions>
-        <exclusion>
-            <groupId>org.jboss.microcontainer</groupId>
-            <artifactId>jboss-kernel</artifactId>
-        </exclusion>
-      </exclusions>
+      <artifactId>jboss-bootstrap-spi</artifactId>
+      <version>${version.org.jboss.bootstrap_jboss.bootstrap.spi}</version>
     </dependency>
 
     <dependency>

Modified: projects/bootstrap/trunk/spi-test/src/test/java/org/jboss/bootstrap/spi/test/ClassLoadingTestCase.java
===================================================================
--- projects/bootstrap/trunk/spi-test/src/test/java/org/jboss/bootstrap/spi/test/ClassLoadingTestCase.java	2009-04-21 02:39:36 UTC (rev 87602)
+++ projects/bootstrap/trunk/spi-test/src/test/java/org/jboss/bootstrap/spi/test/ClassLoadingTestCase.java	2009-04-21 02:47:02 UTC (rev 87603)
@@ -33,9 +33,9 @@
 
 import junit.framework.TestCase;
 
+import org.jboss.bootstrap.spi.factory.ServerFactory;
 import org.jboss.bootstrap.spi.lifecycle.LifecycleState;
-import org.jboss.bootstrap.spi.mc.server.MCServer;
-import org.jboss.bootstrap.spi.mc.server.MCServerFactory;
+import org.jboss.bootstrap.spi.server.Server;
 import org.junit.Test;
 
 /**
@@ -65,6 +65,11 @@
     */
    private static final String LOCATION_LIB = "../lib/";
 
+   /**
+    * FQN of the MC Server implementation class which we'll use to construct a new server instance
+    */
+   private static final String CLASS_NAME_MC_SERVER_IMPL = "org.jboss.bootstrap.impl.mc.server.MCServerImpl";
+
    //-------------------------------------------------------------------------------------||
    // Tests ------------------------------------------------------------------------------||
    //-------------------------------------------------------------------------------------||
@@ -99,7 +104,17 @@
       {
 
          // Create the server
-         final MCServer server = MCServerFactory.createServerWithDefaultConfiguration(runtimeCl);
+         Server<?, ?> server = null;
+         try
+         {
+            Object objServer = ServerFactory.createServer(CLASS_NAME_MC_SERVER_IMPL, runtimeCl);
+            server = (Server<?, ?>) objServer;
+         }
+         catch (Exception e)
+         {
+            throw new RuntimeException(e);
+         }
+
          getOut().println("Got Server: " + server);
 
          // Configure it
@@ -163,7 +178,7 @@
       boolean gotExpectedCnfe = false;
 
       // Get the class impl name
-      final String serverImplClassName = MCServerFactory.DEFAULT_MC_SERVER_IMPL_CLASS_NAME;
+      final String serverImplClassName = "org.jboss.bootstrap.impl.mc.server.MCServerImpl";
 
       // Log
       getOut().println("Attempting to obtain " + serverImplClassName + " from " + cl + "...");
@@ -207,7 +222,7 @@
          {
             try
             {
-               URL url = lib.toURL();
+               URL url = lib.toURI().toURL();
                getOut().println("Adding to CP: " + url);
                urls.add(url);
             }




More information about the jboss-cvs-commits mailing list