[jboss-cvs] JBossAS SVN: r102818 - projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 23 15:44:02 EDT 2010


Author: flavia.rainone at jboss.com
Date: 2010-03-23 15:44:01 -0400 (Tue, 23 Mar 2010)
New Revision: 102818

Modified:
   projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCL.java
   projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCLTestCase.java
Log:
[JBAOP-781] Test fixed.

Modified: projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCL.java
===================================================================
--- projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCL.java	2010-03-23 19:43:39 UTC (rev 102817)
+++ projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCL.java	2010-03-23 19:44:01 UTC (rev 102818)
@@ -29,6 +29,9 @@
 
 /**
  * User-defined class loader.
+ * Demonstrates which classes need to be provided by a user defined
+ * ClassLoader in order for JBoss AOP to be able to find the classes
+ * during weaving.
  * 
  * @author  <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
  */
@@ -42,15 +45,13 @@
    @Override
    public URL  getResource(String name)
    {
-      System.out.println("GET RESOURCE: " + name);
-      new Exception().printStackTrace();
-      return null;
+      return super.getResource(name);
    }
    
    @Override
    public InputStream getResourceAsStream(String name)
    {
-      return null;
+      return super.getResourceAsStream(name);
    }
    
    @Override
@@ -62,9 +63,11 @@
    @Override
    public URL  findResource(String name)
    {
-      return null;
+      return super.findResource(name);
    }
-   public Enumeration<URL>    findResources(String name)
+   
+   @Override
+   public Enumeration<URL> findResources(String name)
    {
       return null;
    }

Modified: projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCLTestCase.java
===================================================================
--- projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCLTestCase.java	2010-03-23 19:43:39 UTC (rev 102817)
+++ projects/aop/branches/Branch_2_2/aop/src/test/java/org/jboss/test/aop/classloader/UserDefinedCLTestCase.java	2010-03-23 19:44:01 UTC (rev 102818)
@@ -1,28 +1,29 @@
 /*
-  * 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.
-  */
+ * 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.aop.classloader;
 
 import java.lang.reflect.Method;
 import java.net.URL;
+import java.util.ArrayList;
 
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.advice.AdviceBinding;
@@ -58,11 +59,22 @@
       junit.textui.TestRunner.run(UserDefinedCLTestCase.class);
    }
  
+   @Override
+   @SuppressWarnings("all")
    public void setUp() throws Exception
    {
       super.setUp();
       
       jarURL = getURLRelativeToProjectRoot(SCENARIO_TO_LOAD);
+      // add org.apache.log4j and org.junit to exclude list
+      ArrayList<String> exclude = (ArrayList<String>) AspectManager.instance().getExclude().clone();
+      if (exclude == null)
+      {
+         exclude = new ArrayList<String>();
+      }
+      exclude.add("org.apache.log4j");
+      exclude.add("org.junit");
+      AspectManager.instance().setExclude(exclude);
    }
    
    public void testURLLoadedInterception() throws Exception




More information about the jboss-cvs-commits mailing list