[jboss-cvs] JBossAS SVN: r70432 - in projects/microcontainer/trunk/managed: src/main/org/jboss/managed/plugins and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 5 10:39:44 EST 2008
Author: adrian at jboss.org
Date: 2008-03-05 10:39:44 -0500 (Wed, 05 Mar 2008)
New Revision: 70432
Removed:
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/advice/
projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTestDelegate.java
Modified:
projects/microcontainer/trunk/managed/.classpath
projects/microcontainer/trunk/managed/pom.xml
projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTest.java
projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/mock/MockTest.java
Log:
Move the managed advices to the profile service, so people dependency on managed for the annotations don't also end up depending on aop
Modified: projects/microcontainer/trunk/managed/.classpath
===================================================================
--- projects/microcontainer/trunk/managed/.classpath 2008-03-05 15:30:22 UTC (rev 70431)
+++ projects/microcontainer/trunk/managed/.classpath 2008-03-05 15:39:44 UTC (rev 70432)
@@ -15,8 +15,6 @@
<classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-log4j/2.0.4.GA/jboss-common-logging-log4j-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-log4j/2.0.4.GA/jboss-common-logging-log4j-2.0.4.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/jboss/profiler/jvmti/jboss-profiler-jvmti/1.0.0.CR5/jboss-profiler-jvmti-1.0.0.CR5.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR3/jboss-aop-2.0.0.CR3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA.jar" sourcepath="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA-sources.jar"/>
<classpathentry kind="src" path="/jboss-container"/>
<classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.0/jaxb-api-2.0.jar"/>
@@ -27,4 +25,4 @@
<classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6/qdox-1.6.jar" sourcepath="M2_REPO/qdox/qdox/1.6/qdox-1.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
<classpathentry kind="src" path="/jboss-metatype"/>
-</classpath>
\ No newline at end of file
+</classpath>
Modified: projects/microcontainer/trunk/managed/pom.xml
===================================================================
--- projects/microcontainer/trunk/managed/pom.xml 2008-03-05 15:30:22 UTC (rev 70431)
+++ projects/microcontainer/trunk/managed/pom.xml 2008-03-05 15:39:44 UTC (rev 70432)
@@ -27,10 +27,6 @@
<dependencies>
<!-- Global dependencies -->
<dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-container</artifactId>
</dependency>
Modified: projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTest.java
===================================================================
--- projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTest.java 2008-03-05 15:30:22 UTC (rev 70431)
+++ projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTest.java 2008-03-05 15:39:44 UTC (rev 70432)
@@ -21,8 +21,7 @@
*/
package org.jboss.test.managed;
-import org.jboss.test.AbstractTestCaseWithSetup;
-import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.BaseTestCase;
/**
* ManagedTest base class that extends AbstractTestCaseWithSetup
@@ -35,23 +34,9 @@
* @author Scott.Stark at jboss.org
* @version $Revision$
*/
-public abstract class ManagedTest extends AbstractTestCaseWithSetup
+public abstract class ManagedTest extends BaseTestCase
{
/**
- * A static getDelegate method that is called by the AbstractTestDelegate
- * getDelegate logic to obtain the test specific delegate. This sets the
- * default delegate for ManagedTests to ManagedTestDelegate.
- *
- * @param clazz the test class
- * @return the delegate
- * @throws Exception for any error
- */
- public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
- {
- return new ManagedTestDelegate(clazz);
- }
-
- /**
* Create a new Managed test
*
* @param name the test name
@@ -60,13 +45,4 @@
{
super(name);
}
-
- /**
- * Adds a call to configureLogging after super.setUp.
- */
- protected void setUp() throws Exception
- {
- super.setUp();
- configureLogging();
- }
}
Deleted: projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTestDelegate.java 2008-03-05 15:30:22 UTC (rev 70431)
+++ projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/ManagedTestDelegate.java 2008-03-05 15:39:44 UTC (rev 70432)
@@ -1,169 +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.managed;
-
-import java.net.URL;
-
-import org.jboss.aop.AspectXmlLoader;
-import org.jboss.net.protocol.URLStreamHandlerFactory;
-import org.jboss.test.AbstractTestDelegate;
-
-/**
- *
- * ManagedTestDelegate overrides the AbstractTestDelegate to
- * deploy/undeploy test specific aop descriptors in setUp/tearDown.
- *
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.com
- * @version $Revision:59255 $
- */
-public class ManagedTestDelegate extends AbstractTestDelegate
-{
- /** The AOP URL used */
- private URL aopURL;
-
- /**
- * Create a new ManagedTestDelegate.
- *
- * @param clazz the class
- * @throws Exception for any error
- */
- public ManagedTestDelegate(Class<?> clazz) throws Exception
- {
- super(clazz);
- }
-
- /**
- * Look for a test specific aop descriptor based on the ctor
- * class first, and if none is found, the ManagedTest.class.
- */
- public void setUp() throws Exception
- {
- super.setUp();
- if (deployAOP(clazz) == false)
- deployAOP(ManagedTest.class);
- }
-
- /**
- * Undeployment any test specific aop descriptor deployed in setUp.
- */
- public void tearDown() throws Exception
- {
- super.tearDown();
- undeployAOP();
- }
-
- /**
- * Look for a test specific resource name by appending "-aop.xml"
- * to the referenceClass name as a resource. For example, a.b.SomeTest
- * would produce a a/b/SomeTest-aop.xml resource that is queried
- * for using clazz.getClassLoader().getResource("a/b/SomeTest-aop.xml");
- *
- * @param referenceClass - the class to use as the aop descriptor base name.
- * @return true if the aop descriptor was found and deployed,
- * false otherwise.
- * @throws Exception on failure to deploy the aop descriptor.
- */
- protected boolean deployAOP(Class<?> referenceClass) throws Exception
- {
- String testName = referenceClass.getName();
- testName = testName.replace('.', '/') + "-aop.xml";
- URL url = clazz.getClassLoader().getResource(testName);
- if (url != null)
- {
- log.debug("Deploying " + url);
- aopURL = url;
- try
- {
- initURLHandlers();
- AspectXmlLoader.deployXML(aopURL);
- }
- catch (Throwable t)
- {
- throw new RuntimeException("Error deploying: " + url, t);
- }
- return true;
- }
- else
- {
- log.debug("No test specific deployment " + testName);
- return false;
- }
- }
-
- /**
- * Undeploy the aop descriptor deployed in deployAOP if
- * one was found.
- *
- */
- protected void undeployAOP()
- {
- if (aopURL == null)
- return;
- try
- {
- log.debug("Undeploying " + aopURL);
- AspectXmlLoader.undeployXML(aopURL);
- }
- catch (Exception e)
- {
- log.warn("Ignored error undeploying " + aopURL, e);
- }
- }
-
- /**
- * Update the java.protocol.handler.pkgs system property
- * to include the org.jboss.net.protocol package.
- *
- */
- private void initURLHandlers()
- {
- try
- {
- // Install a URLStreamHandlerFactory that uses the TCL
- URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory());
-
- // Preload JBoss URL handlers
- URLStreamHandlerFactory.preload();
- }
- catch (Error error)
- { //very naughty but we HAVE to do this or
- //we'll fail if we ever try to do this again
- log.warn("Caught Throwable Error, this probably means " +
- "we've already set the URLStreamHAndlerFactory before");
- //Sys.out because we don't have logging yet
- }
-
- // Include the default JBoss protocol handler package
- String handlerPkgs = System.getProperty("java.protocol.handler.pkgs");
- if (handlerPkgs != null)
- {
- handlerPkgs += "|org.jboss.net.protocol";
- }
- else
- {
- handlerPkgs = "org.jboss.net.protocol";
- }
- System.setProperty("java.protocol.handler.pkgs", handlerPkgs);
- }
-}
Modified: projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/mock/MockTest.java
===================================================================
--- projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/mock/MockTest.java 2008-03-05 15:30:22 UTC (rev 70431)
+++ projects/microcontainer/trunk/managed/src/tests/org/jboss/test/managed/mock/MockTest.java 2008-03-05 15:39:44 UTC (rev 70432)
@@ -29,7 +29,6 @@
import org.jboss.managed.api.Fields;
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.plugins.advice.WrapperAdvice;
import org.jboss.test.managed.ManagedTest;
/**
@@ -69,7 +68,7 @@
{
MockDataSourceManagedObject mock = new MockDataSourceManagedObject();
- ManagedObject mo = WrapperAdvice.wrapManagedObject(mock);
+ ManagedObject mo = mock;
getLog().debug("MockDataSourceManagedObject, available propertes...");
getLog().debug(mock.getPropertyNames());
@@ -116,7 +115,7 @@
throws Exception
{
MockDataSourceManagedObject mock = new MockDataSourceManagedObject();
- ManagedObject mo = WrapperAdvice.wrapManagedObject(mock);
+ ManagedObject mo = mock;
mo.getProperty("jndi-name").setValue("DefaultDS");
mo.getProperty("user").setValue("Scott");
@@ -143,7 +142,7 @@
throws Exception
{
MockDataSourceManagedObject mock = new MockDataSourceManagedObject();
- ManagedObject mo = WrapperAdvice.wrapManagedObject(mock);
+ ManagedObject mo = mock;
ManagedProperty jndiName = mo.getProperty("jndi-name");
jndiName.setValue("DefaultDS");
More information about the jboss-cvs-commits
mailing list