[jboss-cvs] JBossAS SVN: r72654 - in projects/jboss-aspects/trunk/current-invocation: src/test/java/org/jboss/aspects/test/currentinvocation/unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 23 22:04:29 EDT 2008


Author: ALRubinger
Date: 2008-04-23 22:04:29 -0400 (Wed, 23 Apr 2008)
New Revision: 72654

Modified:
   projects/jboss-aspects/trunk/current-invocation/pom.xml
   projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/unit/CurrentInvocationUnitTestCase.java
Log:
[JBASPECT-5] Set proper configuration for tests

Modified: projects/jboss-aspects/trunk/current-invocation/pom.xml
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/pom.xml	2008-04-24 02:00:09 UTC (rev 72653)
+++ projects/jboss-aspects/trunk/current-invocation/pom.xml	2008-04-24 02:04:29 UTC (rev 72654)
@@ -32,7 +32,8 @@
     <testSourceDirectory>src/test/java</testSourceDirectory>
     
     <plugins>
-      <!-- alrubinger specific
+    
+      <!-- Surefire -->
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
@@ -45,10 +46,36 @@
           </includes>
           <forkMode>always</forkMode>
           <argLine>-Djboss.aop.verbose=true</argLine>
-          <argLine>-javaagent:/home/alrubinger/.m2/repository/jboss/aop/jboss-aop-jdk50/2.0.0.CR8/jboss-aop-jdk50-2.0.0.CR8.jar</argLine>
+          <argLine>-javaagent:${project.build.directory}/dependencies/lib/jboss-aop-jdk50.jar</argLine>
         </configuration>
       </plugin>
-      -->
+      
+      <!-- Dependency Plugin Configuration -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy-jboss-test</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>jboss.aop</groupId>
+                  <artifactId>jboss-aop-jdk50</artifactId>
+                </artifactItem>
+              </artifactItems>
+              <outputDirectory>${project.build.directory}/dependencies/lib</outputDirectory>
+              <overWriteIfNewer>true</overWriteIfNewer>
+              <stripVersion>true</stripVersion>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      
     </plugins>
     
   </build>
@@ -71,6 +98,13 @@
     </dependency>
     
     <dependency>
+      <groupId>jboss.aop</groupId>
+      <artifactId>jboss-aop-jdk50</artifactId>
+      <version>2.0.0.CR8</version>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

Modified: projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/unit/CurrentInvocationUnitTestCase.java
===================================================================
--- projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/unit/CurrentInvocationUnitTestCase.java	2008-04-24 02:00:09 UTC (rev 72653)
+++ projects/jboss-aspects/trunk/current-invocation/src/test/java/org/jboss/aspects/test/currentinvocation/unit/CurrentInvocationUnitTestCase.java	2008-04-24 02:04:29 UTC (rev 72654)
@@ -66,6 +66,9 @@
    @Test
    public void testCurrentInvocationInContext()
    {
+      // Set TCL
+      Thread.currentThread().setContextClassLoader(PojoBean.class.getClassLoader());
+      
       // Ensure current invocation is accessible from within context
       TestCase.assertEquals("Current Invocation for this Thread was null", true, new PojoBean()
             .canGetCurrentInvocation());
@@ -81,6 +84,9 @@
    @Test
    public void testCleanupAfterException()
    {
+      // Set TCL
+      Thread.currentThread().setContextClassLoader(PojoBean.class.getClassLoader());
+      
       try
       {
          new PojoBean().throwException();
@@ -100,6 +106,9 @@
    @Test
    public void testConcurrentAccessFromSeparateThreadFails()
    {
+      // Set TCL
+      Thread.currentThread().setContextClassLoader(PojoBean.class.getClassLoader());
+      
       // Initialize
       long waitForLaunch = 750L;
 




More information about the jboss-cvs-commits mailing list