[jboss-cvs] JBossAS SVN: r82345 - in projects/jboss-aspects/trunk: common and 15 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Dec 17 10:29:18 EST 2008


Author: sguilhen at redhat.com
Date: 2008-12-17 10:29:18 -0500 (Wed, 17 Dec 2008)
New Revision: 82345

Added:
   projects/jboss-aspects/trunk/security/src/test/
   projects/jboss-aspects/trunk/security/src/test/java/
   projects/jboss-aspects/trunk/security/src/test/java/org/
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJO.java
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJODelegate.java
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationInterceptorFactory.java
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationManager.java
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationInterceptorFactory.java
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationManager.java
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/test/
   projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/test/SecurityInterceptorsTestCase.java
   projects/jboss-aspects/trunk/security/src/test/resources/
   projects/jboss-aspects/trunk/security/src/test/resources/jboss-aop.xml
Modified:
   projects/jboss-aspects/trunk/build/pom.xml
   projects/jboss-aspects/trunk/common/pom.xml
   projects/jboss-aspects/trunk/security/.classpath
   projects/jboss-aspects/trunk/security/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-aspects/trunk/security/pom.xml
   projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RoleBasedAuthorizationInterceptor.java
   projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RunAsSecurityInterceptor.java
   projects/jboss-aspects/trunk/test/pom.xml
Log:
JBASPECT-29: Added a SecurityInterceptorsTestCase. Created new constructor for RoleBasedAuthorizationManager that takes the AuthorizationManager instead of the RealmMapping implementation.



Modified: projects/jboss-aspects/trunk/build/pom.xml
===================================================================
--- projects/jboss-aspects/trunk/build/pom.xml	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/build/pom.xml	2008-12-17 15:29:18 UTC (rev 82345)
@@ -33,11 +33,11 @@
   <properties>
     <version.jboss.common.core>2.2.7.GA</version.jboss.common.core>
     <version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
-    <version.jboss.aop>2.0.0.CR15</version.jboss.aop>
-    <version.jboss.security.spi>2.0.2.CR6</version.jboss.security.spi>
+    <version.jboss.aop>2.0.0.GA</version.jboss.aop>
+    <version.jboss.security.spi>2.0.2.SP3</version.jboss.security.spi>
     <version.jboss.transaction.spi>5.0.0.CR2</version.jboss.transaction.spi>
     <version.jboss.transaction.api>1.0.1.CR1</version.jboss.transaction.api>
-    <version.jboss.security.jbosssx>2.0.2.CR2</version.jboss.security.jbosssx>
+    <version.jboss.security.jbosssx>2.0.2.SP3</version.jboss.security.jbosssx>
     <version.jboss.microcontainer>2.0.0.Beta17</version.jboss.microcontainer>
     <version.org.jboss.man>2.0.0.Beta15</version.org.jboss.man>
     <version.org.jboss.remoting>2.4.0.SP1</version.org.jboss.remoting>

Modified: projects/jboss-aspects/trunk/common/pom.xml
===================================================================
--- projects/jboss-aspects/trunk/common/pom.xml	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/common/pom.xml	2008-12-17 15:29:18 UTC (rev 82345)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.jboss.aspects</groupId>
     <artifactId>jboss-aspects-build</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
+    <version>1.0.1-SNAPSHOT</version>
     <relativePath>../build</relativePath>
   </parent>
 

Modified: projects/jboss-aspects/trunk/security/.classpath
===================================================================
--- projects/jboss-aspects/trunk/security/.classpath	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/security/.classpath	2008-12-17 15:29:18 UTC (rev 82345)
@@ -1,29 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src/main/java"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
-	<classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar" sourcepath="M2_REPO/ant/ant/1.6.5/ant-1.6.5-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/javax/security/jacc/1.0/jacc-1.0.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/javassist/3.7.1.GA/javassist-3.7.1.GA.jar" sourcepath="M2_REPO/org/jboss/javassist/3.7.1.GA/javassist-3.7.1.GA-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR8/jboss-aop-2.0.0.CR8.jar" sourcepath="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR8/jboss-aop-2.0.0.CR8-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta10/jboss-container-2.0.0.Beta10.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta10/jboss-container-2.0.0.Beta10-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.Beta14/jboss-dependency-2.0.0.Beta14.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.Beta11/jboss-dependency-2.0.0.Beta11-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-jaspi-api/1.0.0.CR1/jboss-jaspi-api-1.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-jaspi-api/1.0-BETA1/jboss-jaspi-api-1.0-BETA1-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.Beta14/jboss-kernel-2.0.0.Beta14.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.Beta11/jboss-kernel-2.0.0.Beta11-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.3.GA/jboss-logging-spi-2.0.3.GA.jar" sourcepath="M2_REPO/jboss/jboss-logging-spi/2.0.3.GA/jboss-logging-spi-2.0.3.GA-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.0.Beta15/jboss-mdr-2.0.0.Beta15.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.0.Beta12/jboss-mdr-2.0.0.Beta12-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.0.Beta12/jboss-reflect-2.0.0.Beta12.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.0.0.Beta12/jboss-reflect-2.0.0.Beta12-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-security-spi/2.0.2.CR2/jboss-security-spi-2.0.2.CR2.jar" sourcepath="/M2_REPO/org/jboss/security/jboss-security-spi/2.0.2.CR2/jboss-security-spi-2.0.2.CR2.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/security/jbosssx/2.0.2.CR1/jbosssx-2.0.2.CR1.jar" sourcepath="M2_REPO/org/jboss/security/jbosssx-client/2.0.2.Beta5/jbosssx-client-2.0.2.Beta5-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR9/jbossxb-2.0.0.CR9.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.0.CR7/jbossxb-2.0.0.CR7-sources.jar"/>
-	<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="var" path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
-	<classpathentry kind="output" path="target/eclipse-classes"/>
-</classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.0/ant-1.7.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/security/jacc/1.0/jacc-1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.GA/jboss-aop-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.GA/jboss-aop-2.0.0.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.Beta17/jboss-dependency-2.0.0.Beta17.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.Beta17/jboss-dependency-2.0.0.Beta17-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-jaspi-api/1.0.0.CR1/jboss-jaspi-api-1.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-jaspi-api/1.0.0.CR1/jboss-jaspi-api-1.0.0.CR1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.Beta17/jboss-kernel-2.0.0.Beta17.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.Beta17/jboss-kernel-2.0.0.Beta17-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.0.GA/jboss-mdr-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.0.GA/jboss-mdr-2.0.0.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.0.GA/jboss-reflect-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.0.0.GA/jboss-reflect-2.0.0.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-security-spi/2.0.2.SP3/jboss-security-spi-2.0.2.SP3.jar" sourcepath="M2_REPO/org/jboss/security/jboss-security-spi/2.0.2.SP3/jboss-security-spi-2.0.2.SP3-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbosssx/2.0.2.SP3/jbosssx-2.0.2.SP3.jar" sourcepath="M2_REPO/org/jboss/security/jbosssx/2.0.2.SP3/jbosssx-2.0.2.SP3-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR12/jbossxb-2.0.0.CR12.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.0.CR12/jbossxb-2.0.0.CR12-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.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/qdox/qdox/1.6.1/qdox-1.6.1.jar" sourcepath="M2_REPO/qdox/qdox/1.6.1/qdox-1.6.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar"/>
+</classpath>
\ No newline at end of file

Modified: projects/jboss-aspects/trunk/security/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-aspects/trunk/security/.settings/org.eclipse.jdt.core.prefs	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/security/.settings/org.eclipse.jdt.core.prefs	2008-12-17 15:29:18 UTC (rev 82345)
@@ -1,5 +1,6 @@
-#Thu Apr 10 18:45:23 CEST 2008
+#Thu Dec 11 13:24:36 GMT-03:00 2008
+eclipse.preferences.version=1
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.compliance=1.5
 org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5

Modified: projects/jboss-aspects/trunk/security/pom.xml
===================================================================
--- projects/jboss-aspects/trunk/security/pom.xml	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/security/pom.xml	2008-12-17 15:29:18 UTC (rev 82345)
@@ -2,7 +2,7 @@
   <parent>
     <groupId>org.jboss.aspects</groupId>
     <artifactId>jboss-aspects-build</artifactId>
-    <version>1.0.1.CR5</version>
+    <version>1.0.1-SNAPSHOT</version>
     <relativePath>../build/pom.xml</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
@@ -13,16 +13,6 @@
   <url>http://www.jboss.org/jbossas/</url>
   <description>JBoss Security Aspects</description>  
   <build>
-    <resources>
-      <resource>
-        <directory>src/resources/main</directory>
-      </resource>
-    </resources>
-    <testResources>
-      <testResource>
-        <directory>src/resources/tests</directory>
-      </testResource>
-    </testResources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -36,11 +26,22 @@
         </executions>
       </plugin>
       <plugin>
+        <!-- use load-time weaving when running the security tests -->
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-      </plugin>   	   
+        <configuration>
+          <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader -Djboss.aop.path=src/test/resources/jboss-aop.xml -Djboss.aop.exclude=org.apache.maven</argLine>
+          <includes>
+            <include>**/*TestCase.java</include>
+          </includes>
+          <testFailureIgnore>false</testFailureIgnore>
+          <useFile>false</useFile>
+          <trimStackTrace>false</trimStackTrace>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
+
   <!-- Do not add version information here, use ../build/pom.xml instead -->
   <dependencies>
     <!-- Global dependencies -->
@@ -85,7 +86,13 @@
         <groupId>javax.security</groupId>
         <artifactId>jacc</artifactId>
       </dependency>
-      
+     
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <scope>test</scope>
+      </dependency>
+ 
     <!-- Test dependencies -->
   </dependencies>
 </project>

Modified: projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RoleBasedAuthorizationInterceptor.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RoleBasedAuthorizationInterceptor.java	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RoleBasedAuthorizationInterceptor.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -1,24 +1,24 @@
 /*
-  * 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.aspects.security;
 
 import java.security.Principal;
@@ -29,16 +29,16 @@
 import org.jboss.logging.Logger;
 import org.jboss.security.AnybodyPrincipal;
 import org.jboss.security.AuthenticationManager;
+import org.jboss.security.AuthorizationManager;
 import org.jboss.security.NobodyPrincipal;
 import org.jboss.security.RealmMapping;
 import org.jboss.security.RunAsIdentity;
 import org.jboss.security.SimplePrincipal;
 
 /**
- * The RoleBasedAuthorizationInterceptor checks that the caller principal is
- * authorized to call a method by verifing that it contains at least one
- * of the required roled.
- *
+ * The RoleBasedAuthorizationInterceptor checks that the caller principal is authorized to call a method by verifing
+ * that it contains at least one of the required roled.
+ * 
  * @author <a href="bill at jboss.org">Bill Burke</a>
  * @author <a href="on at ibis.odessa.ua">Oleg Nitz</a>
  * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
@@ -48,31 +48,89 @@
 public class RoleBasedAuthorizationInterceptor implements org.jboss.aop.advice.Interceptor
 {
    protected Logger log = Logger.getLogger(this.getClass());
-   protected AuthenticationManager securityManager;
+
+   protected AuthenticationManager authenticationManager;
+
+   protected AuthorizationManager authorizationManager;
+
    protected RealmMapping realmMapping;
 
+   /**
+    * <p>
+    * Creates an instance of {@code RoleBasedAuthorizationInterceptor} using the specified {@code AuthenticationManager}
+    * and {@code RealmMapping} implementations.
+    * </p>
+    * 
+    * @param manager the {@code AuthenticationManager} instance to be used when the caller hasn't been previously
+    *            authenticated.
+    * @param realmMapping the {@code RealmMapping} instance to be used to determine if the caller has or has not the
+    *            required roles.
+    * @deprecated use {@code #RoleBasedAuthorizationInterceptor(AuthenticationManager, AuthorizationManager)} instead.
+    */
+   @Deprecated
    public RoleBasedAuthorizationInterceptor(AuthenticationManager manager, RealmMapping realmMapping)
    {
-      this.securityManager = manager;
+      this.authenticationManager = manager;
       this.realmMapping = realmMapping;
    }
 
+   /**
+    * <p>
+    * Creates an instance of {@code RoleBasedAuthorizationInterceptor} using the specified {@code AuthenticationManager}
+    * and {@code AuthorizationManager} implementations.
+    * </p>
+    * 
+    * @param authManager the {@code AuthenticationManager} instance to be used when the caller hasn't been previously
+    *            authenticated.
+    * @param authzManager the {@code AuthorizationManager} instance to be used to determine if the caller is authorized
+    *            to access the protected resource. This typically means checking if the caller has been assigned to one
+    *            or more required roles.
+    */
+   public RoleBasedAuthorizationInterceptor(AuthenticationManager authManager, AuthorizationManager authzManager)
+   {
+      this.authenticationManager = authManager;
+      this.authorizationManager = authzManager;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.Interceptor#getName()
+    */
    public String getName()
    {
       return "RoleBasedAuthorizationInterceptor";
    }
 
-   protected Set getRoleSet(Invocation invocation)
+   /**
+    * <p>
+    * Obtains the roles that have access to the method represented by the specified {@code Invocation}.
+    * </p>
+    * 
+    * @param invocation the object that contains the metadata of the method being called.
+    * @return a {@code Set<Principal>} containing the allowed roles.
+    */
+   @SuppressWarnings("unchecked")
+   protected Set<Principal> getRoleSet(Invocation invocation)
    {
-      Set roles = (Set) invocation.getMetaData("security", "roles");
-      if (roles == null) roles = getAnnotationRoleSet(invocation);
+      Set<Principal> roles = (Set<Principal>) invocation.getMetaData("security", "roles");
+      if (roles == null)
+         roles = getAnnotationRoleSet(invocation);
       return roles;
 
    }
 
-   protected Set getAnnotationRoleSet(Invocation invocation)
+   /**
+    * <p>
+    * Obtains the roles that have been specified through annotations from the {@code Invocation} object.
+    * </p>
+    * 
+    * @param invocation the object that contains the metadata of the method being called.
+    * @return a {@code Set<Principal>} containing the roles that have been specified through annotations.
+    */
+   protected Set<Principal> getAnnotationRoleSet(Invocation invocation)
    {
-      HashSet set = new HashSet();
+      Set<Principal> set = new HashSet<Principal>();
       Exclude exclude = (Exclude) invocation.resolveAnnotation(Exclude.class);
       if (exclude != null)
       {
@@ -98,34 +156,32 @@
       }
       return set;
    }
-   
+
    /**
-    * Check if the principal is authorized to call the method by verifying that
-    * the it containes at least one of the required roles.
+    * Check if the principal is authorized to call the method by verifying that the it containes at least one of the
+    * required roles.
     */
    public Object invoke(Invocation invocation) throws Throwable
    {
       // If there is not a security manager then there is no authorization
       // required
-      if (securityManager == null)
+      if (this.authenticationManager == null)
       {
          return invocation.invokeNext();
       }
 
-      if (realmMapping == null)
+      if (this.authorizationManager == null && realmMapping == null)
       {
-         throw new SecurityException("Role mapping manager has not been set");
+         throw new SecurityException("Authorization manager has not been set");
       }
 
-      Set roles = getRoleSet(invocation);
+      Set<Principal> roles = getRoleSet(invocation);
       if (roles == null)
       {
          /*
-           REVISIT: for better message
-         String message = "No method permissions assigned. to " +
-               "method=" + invocation.getMethod().getName() +
-               ", interface=" + invocation.getType();
-         */
+          * REVISIT: for better message String message = "No method permissions assigned. to " + "method=" +
+          * invocation.getMethod().getName() + ", interface=" + invocation.getType();
+          */
          String message = "No method permissions assigned.";
          log.error(message);
          throw new SecurityException(message);
@@ -140,11 +196,16 @@
          {
             Principal principal = SecurityActions.getPrincipal();
             // Now actually check if the current caller has one of the required method roles
-            if (realmMapping.doesUserHaveRole(principal, roles) == false)
+            boolean hasRole = this.authorizationManager != null ? 
+                  this.authorizationManager.doesUserHaveRole(principal, roles) : 
+                  this.realmMapping.doesUserHaveRole(principal, roles);
+            if (hasRole == false)
             {
-               Set userRoles = realmMapping.getUserRoles(principal);
-               String msg = "Insufficient permissions, principal=" + principal
-               + ", requiredRoles=" + roles + ", principalRoles=" + userRoles;
+               Set<Principal> userRoles = this.authorizationManager != null ? 
+                     this.authorizationManager.getUserRoles(principal) : 
+                     this.realmMapping.getUserRoles(principal);
+               String msg = "Insufficient permissions, principal=" + principal + ", requiredRoles=" + roles
+                     + ", principalRoles=" + userRoles;
                log.error(msg);
                throw new SecurityException(msg);
             }
@@ -157,14 +218,14 @@
             if (callerRunAsIdentity instanceof RunAsIdentity)
             {
                RunAsIdentity rai = (RunAsIdentity) callerRunAsIdentity;
-               if(rai.doesUserHaveRole(roles) == false)
+               if (rai.doesUserHaveRole(roles) == false)
                {
-                  String msg = "Insufficient permissions, runAsPrincipal=" + rai.getName()
-                  + ", requiredRoles=" + roles + ", runAsRoles=" + rai.getRunAsRoles();
+                  String msg = "Insufficient permissions, runAsPrincipal=" + rai.getName() + ", requiredRoles=" + roles
+                        + ", runAsRoles=" + rai.getRunAsRoles();
                   log.error(msg);
-                  throw new SecurityException(msg); 
+                  throw new SecurityException(msg);
                }
-            } 
+            }
             else
                throw new RuntimeException("Unknown RunAs type");
          }

Modified: projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RunAsSecurityInterceptor.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RunAsSecurityInterceptor.java	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/security/src/main/java/org/jboss/aspects/security/RunAsSecurityInterceptor.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -1,90 +1,140 @@
 /*
-  * 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.aspects.security;
 
 import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.logging.Logger;
 import org.jboss.security.AuthenticationManager;
 import org.jboss.security.RealmMapping;
 import org.jboss.security.RunAsIdentity;
 
-/** 
+/**
  * An interceptor that enforces the run-as identity declared by a bean.
- *
+ * 
  * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
  * @author <a href="mailto:dain at daingroup.com">Dain Sundstrom</a>.
  * @version $Revision: 65273 $
  */
 public class RunAsSecurityInterceptor implements org.jboss.aop.advice.Interceptor
 {
-   private static final Logger log = Logger.getLogger(RunAsSecurityInterceptor.class);
-   
    protected AuthenticationManager securityManager;
+
    protected RealmMapping realmMapping;
 
+   /**
+    * <p>
+    * Creates an instance of {@code RunAsSecurityInterceptor}.
+    * </p>
+    */
+   public RunAsSecurityInterceptor()
+   {
+   }
+
+   /**
+    * <p>
+    * Creates an instance of {@code RunAsSecurityInterceptor} using the specified {@code AuthenticationManager}
+    * and {@code RealmMapping} implementations.
+    * </p>
+    * 
+    * @param manager the {@code AuthenticationManager} instance to be used when the caller hasn't been previously
+    *            authenticated.
+    * @param realmMapping the {@code RealmMapping} instance to be used to determine if the caller has or has not the
+    *            required roles.
+    * @deprecated use {@code #RunAsSecurityInterceptor()} instead.
+    */
+   @Deprecated
    public RunAsSecurityInterceptor(AuthenticationManager manager, RealmMapping realmMapping)
    {
       this.securityManager = manager;
       this.realmMapping = realmMapping;
    }
-   
-   public String getName() { return "RunAsSecurityInterceptor"; }
 
+   /*
+    * (non-Javadoc)
+    * @see org.jboss.aop.advice.Interceptor#getName()
+    */
+   public String getName()
+   {
+      return "RunAsSecurityInterceptor";
+   }
+
+   /**
+    * <p>
+    * Obtains the run-as identity to be used when running the method represented by the {@code Invocation}.
+    * </p>
+    * 
+    * @param invocation the object that contains the metadata of the method being called.
+    * @return the {@code RunAsIdentity} to be used, or {@code null} if no run-as identity can be found.
+    */
    protected RunAsIdentity getRunAsIdentity(Invocation invocation)
    {
-      RunAsIdentity identity = (RunAsIdentity)invocation.getMetaData("security", "run-as");
-      if (identity == null) identity = getAnnotationRunAsIdentity(invocation);
+      RunAsIdentity identity = (RunAsIdentity) invocation.getMetaData("security", "run-as");
+      if (identity == null)
+         identity = getAnnotationRunAsIdentity(invocation);
       return identity;
    }
 
+   /**
+    * <p>
+    * Obtains the run-as identity that have been specified through annotations.
+    * </p>
+    * 
+    * @param invocation the object that contains the metadata of the method being called.
+    * @return the {@code RunAsIdentity} to be used, or {@code null} if no run-as identity has been specified..
+    */
    protected RunAsIdentity getAnnotationRunAsIdentity(Invocation invocation)
    {
       RunAs runAs = (RunAs) invocation.resolveAnnotation(RunAs.class);
       if (runAs == null)
       {
-         runAs = (RunAs)invocation.resolveClassAnnotation(RunAs.class);
+         runAs = (RunAs) invocation.resolveClassAnnotation(RunAs.class);
       }
-      if (runAs == null) return null;
+      if (runAs == null)
+         return null;
       RunAsIdentity runAsRole = new RunAsIdentity(runAs.value(), null);
       return runAsRole;
    }
+
+   /*
+    * (non-Javadoc)
+    * @see org.jboss.aop.advice.Interceptor#invoke(org.jboss.aop.joinpoint.Invocation)
+    */
    public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
    {
       RunAsIdentity runAsRole = getRunAsIdentity(invocation);
       // If a run-as role was specified, push it so that any calls made
       // by this bean will have the runAsRole available for declarative
       // security checks.
-      if(runAsRole != null)
+      if (runAsRole != null)
       {
          SecurityActions.pushRunAsIdentity(runAsRole);
       }
-     
+
       try
       {
          return invocation.invokeNext();
       }
       finally
       {
-         if(runAsRole != null)
+         if (runAsRole != null)
          {
             SecurityActions.popRunAsIdentity();
          }

Added: projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJO.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJO.java	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJO.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.aspects.security.support;
+
+import org.jboss.aspects.security.Exclude;
+import org.jboss.aspects.security.Permissions;
+import org.jboss.aspects.security.RunAs;
+import org.jboss.aspects.security.Unchecked;
+
+/**
+ * <p>
+ * Annotated POJO class used in the security interceptors tests.
+ * </p>
+ * 
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class AnnotatedPOJO
+{
+
+   private String protectedValue;
+
+   private AnnotatedPOJODelegate delegate;
+
+   /**
+    * <p>
+    * Default constructor that can be invoked by anyone.
+    * </p>
+    */
+   @Unchecked
+   public AnnotatedPOJO()
+   {
+      this.delegate = new AnnotatedPOJODelegate();
+   }
+
+   /**
+    * <p>
+    * Constructor that can be invoked by managers only.
+    * </p>
+    * 
+    * @param value the protected value.
+    */
+   @Permissions({"manager"})
+   public AnnotatedPOJO(String value)
+   {
+      this.protectedValue = value;
+      this.delegate = new AnnotatedPOJODelegate();
+   }
+
+   /**
+    * <p>
+    * Operation that can be invoked by anyone.
+    * </p>
+    */
+   @Unchecked
+   public void uncheckedOperation()
+   {
+   }
+
+   /**
+    * <p>
+    * Excluded operation: no one can invoke it.
+    * </p>
+    */
+   @Exclude
+   public void excludedOperation()
+   {
+   }
+
+   /**
+    * <p>
+    * Operation that can be invoked by managers only.
+    * </p>
+    * 
+    * @return the protected value.
+    */
+   @Permissions({"manager"})
+   public String manageProtectedValue()
+   {
+      return this.protectedValue;
+   }
+
+   // ---------------------------------------- Invoke delegate methods ----------------------------------------//
+
+   /**
+    * <p>
+    * Calls the delegate using the caller's identity. As the delegate method expects an user in the administrator role,
+    * only users with this role will be able to call this method successfully.
+    * </p>
+    * 
+    * @return the delegate's result.
+    */
+   @Unchecked
+   public String invokeDelegate()
+   {
+      return delegate.executeDelegate();
+   }
+
+   /**
+    * <p>
+    * Calls the delegate using the run-as identity (administrator). All authenticated users will be able to perform this
+    * operation.
+    * </p>
+    * 
+    * @return the delegate's result.
+    */
+   @Unchecked
+   @RunAs("administrator")
+   public String invokeDelegateRunAs()
+   {
+      return delegate.executeDelegate();
+   }
+}

Added: projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJODelegate.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJODelegate.java	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/AnnotatedPOJODelegate.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.aspects.security.support;
+
+import org.jboss.aspects.security.Permissions;
+
+/**
+ * <p>
+ * Annotated POJO class used in the security run-as tests.
+ * </p>
+ * 
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class AnnotatedPOJODelegate
+{
+
+   /**
+    * <p>
+    * Operation that can be invoked by administrators only.
+    * </p>
+    * 
+    * @return the string "Delegate Result".
+    */
+   @Permissions({"administrator"})
+   public String executeDelegate()
+   {
+      return "Delegate Result";
+   }
+}

Added: projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationInterceptorFactory.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationInterceptorFactory.java	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationInterceptorFactory.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.aspects.security.support;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+import org.jboss.aspects.security.AuthenticationInterceptor;
+
+/**
+ * <p>
+ * Mock {@code AspectFactory} used to create the {@code MockAuthenticationManager} used by the
+ * {@code AuthenticationInterceptor} in the security tests.
+ * </p>
+ * 
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class MockAuthenticationInterceptorFactory implements AspectFactory
+{
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerClass(org.jboss.aop.Advisor)
+    */
+   public Object createPerClass(Advisor arg0)
+   {
+      return new AuthenticationInterceptor(new MockAuthenticationManager());
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerInstance(org.jboss.aop.Advisor, org.jboss.aop.InstanceAdvisor)
+    */
+   public Object createPerInstance(Advisor arg0, InstanceAdvisor arg1)
+   {
+      throw new RuntimeException("PER_INSTANCE not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerJoinpoint(org.jboss.aop.Advisor,
+    *      org.jboss.aop.joinpoint.Joinpoint)
+    */
+   public Object createPerJoinpoint(Advisor arg0, Joinpoint arg1)
+   {
+      throw new RuntimeException("PER_JOINPOINT not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerJoinpoint(org.jboss.aop.Advisor, org.jboss.aop.InstanceAdvisor,
+    *      org.jboss.aop.joinpoint.Joinpoint)
+    */
+   public Object createPerJoinpoint(Advisor arg0, InstanceAdvisor arg1, Joinpoint arg2)
+   {
+      throw new RuntimeException("PER_JOINPOINT not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerVM()
+    */
+   public Object createPerVM()
+   {
+      throw new RuntimeException("PER_VM not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#getName()
+    */
+   public String getName()
+   {
+      return this.getClass().getSimpleName();
+   }
+}

Added: projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationManager.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationManager.java	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthenticationManager.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.aspects.security.support;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.security.auth.Subject;
+
+import org.jboss.security.AuthenticationManager;
+
+/**
+ * <p>
+ * Mock {@code AuthenticationManager} used in the security interceptors tests.
+ * </p>
+ * 
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class MockAuthenticationManager implements AuthenticationManager
+{
+
+   private Properties users = new Properties();
+   
+   public MockAuthenticationManager()
+   {
+      // set a few test users
+      this.users.setProperty("user1", "pass1");
+      this.users.setProperty("user2", "pass2");
+      this.users.setProperty("user3", "pass3");
+      this.users.setProperty("user4", "pass4");
+   }
+   
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthenticationManager#getActiveSubject()
+    */
+   public Subject getActiveSubject()
+   {
+      return null;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthenticationManager#getTargetPrincipal(java.security.Principal, java.util.Map)
+    */
+   public Principal getTargetPrincipal(Principal anotherDomainPrincipal, Map<String, Object> contextMap)
+   {
+      return null;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthenticationManager#isValid(java.security.Principal, java.lang.Object)
+    */
+   public boolean isValid(Principal principal, Object credential)
+   {
+      return this.isValid(principal, credential, new Subject());
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthenticationManager#isValid(java.security.Principal, java.lang.Object,
+    *      javax.security.auth.Subject)
+    */
+   public boolean isValid(Principal principal, Object credential, Subject activeSubject)
+   {
+      if(principal != null && credential != null)
+      {
+         String credentialString = credential.toString();
+         return credentialString.equals(this.users.getProperty(principal.getName()));
+      }
+      return false;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.BaseSecurityManager#getSecurityDomain()
+    */
+   public String getSecurityDomain()
+   {
+      return "other";
+   }
+
+}

Added: projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationInterceptorFactory.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationInterceptorFactory.java	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationInterceptorFactory.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.aspects.security.support;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+import org.jboss.aspects.security.RoleBasedAuthorizationInterceptor;
+
+/**
+ * Mock {@code AspectFactory} used to create the {@code MockAuthorizationManager} used by the
+ * {@code RoleBasedAuthorizationInterceptor} in the security tests.
+ * 
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class MockAuthorizationInterceptorFactory implements AspectFactory
+{
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerClass(org.jboss.aop.Advisor)
+    */
+   public Object createPerClass(Advisor arg0)
+   {
+      return new RoleBasedAuthorizationInterceptor(new MockAuthenticationManager(), new MockAuthorizationManager());
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerInstance(org.jboss.aop.Advisor, org.jboss.aop.InstanceAdvisor)
+    */
+   public Object createPerInstance(Advisor arg0, InstanceAdvisor arg1)
+   {
+      throw new RuntimeException("PER_INSTANCE not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerJoinpoint(org.jboss.aop.Advisor,
+    *      org.jboss.aop.joinpoint.Joinpoint)
+    */
+   public Object createPerJoinpoint(Advisor arg0, Joinpoint arg1)
+   {
+      throw new RuntimeException("PER_JOINPOINT not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerJoinpoint(org.jboss.aop.Advisor, org.jboss.aop.InstanceAdvisor,
+    *      org.jboss.aop.joinpoint.Joinpoint)
+    */
+   public Object createPerJoinpoint(Advisor arg0, InstanceAdvisor arg1, Joinpoint arg2)
+   {
+      throw new RuntimeException("PER_JOINPOINT not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#createPerVM()
+    */
+   public Object createPerVM()
+   {
+      throw new RuntimeException("PER_VM not supported for this interceptor factory, only PER_CLASS");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.aop.advice.AspectFactory#getName()
+    */
+   public String getName()
+   {
+      return this.getClass().getSimpleName();
+   }
+
+}

Added: projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationManager.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationManager.java	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/support/MockAuthorizationManager.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,199 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.aspects.security.support;
+
+import java.security.Principal;
+import java.security.acl.Group;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+
+import org.jboss.security.AuthorizationManager;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.security.authorization.AuthorizationException;
+import org.jboss.security.authorization.EntitlementHolder;
+import org.jboss.security.authorization.Permission;
+import org.jboss.security.authorization.Resource;
+import org.jboss.security.identity.Identity;
+import org.jboss.security.identity.RoleGroup;
+
+/**
+ * <p>
+ * Mock {@code AuthorizationManager} used in the security interceptors tests. We just care about the
+ * {@code doesUserHaveRole} and {@code getUserRoles} methods.
+ * </p>
+ * 
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class MockAuthorizationManager implements AuthorizationManager
+{
+
+   Map<String, Set<Principal>> roles = new HashMap<String, Set<Principal>>();
+
+   public MockAuthorizationManager()
+   {
+      // set the roles of each test user.
+      Set<Principal> userRoles = new HashSet<Principal>();
+      userRoles.add(new SimplePrincipal("guest"));
+      this.roles.put("user1", userRoles);
+
+      userRoles = new HashSet<Principal>();
+      userRoles.add(new SimplePrincipal("administrator"));
+      this.roles.put("user2", userRoles);
+
+      userRoles = new HashSet<Principal>();
+      userRoles.add(new SimplePrincipal("administrator"));
+      userRoles.add(new SimplePrincipal("manager"));
+      this.roles.put("user3", userRoles);
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#authorize(org.jboss.security.authorization.Resource)
+    */
+   public int authorize(Resource resource) throws AuthorizationException
+   {
+      return 0;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#authorize(org.jboss.security.authorization.Resource,
+    *      javax.security.auth.Subject)
+    */
+   public int authorize(Resource resource, Subject subject) throws AuthorizationException
+   {
+      return 0;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#authorize(org.jboss.security.authorization.Resource,
+    *      javax.security.auth.Subject, org.jboss.security.identity.RoleGroup)
+    */
+   public int authorize(Resource resource, Subject subject, RoleGroup role) throws AuthorizationException
+   {
+      return 0;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#authorize(org.jboss.security.authorization.Resource,
+    *      javax.security.auth.Subject, java.security.acl.Group)
+    */
+   public int authorize(Resource resource, Subject subject, Group roleGroup) throws AuthorizationException
+   {
+      return 0;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#authorize(org.jboss.security.authorization.Resource,
+    *      org.jboss.security.identity.Identity, org.jboss.security.authorization.Permission)
+    */
+   public int authorize(Resource resource, Identity identity, Permission permission) throws AuthorizationException
+   {
+      return 0;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#doesUserHaveRole(java.security.Principal, java.util.Set)
+    */
+   public boolean doesUserHaveRole(Principal principal, Set<Principal> roles)
+   {
+      Set<Principal> userRoles = this.roles.get(principal.getName());
+      if (userRoles != null)
+      {
+         for (Principal role : roles)
+         {
+            if (userRoles.contains(role))
+               return true;
+         }
+      }
+      return false;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#getEntitlements(java.lang.Class,
+    *      org.jboss.security.authorization.Resource, org.jboss.security.identity.Identity)
+    */
+   public <T> EntitlementHolder<T> getEntitlements(Class<T> clazz, Resource resource, Identity identity)
+         throws AuthorizationException
+   {
+      return null;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#getSubjectRoles(javax.security.auth.Subject,
+    *      javax.security.auth.callback.CallbackHandler)
+    */
+   public RoleGroup getSubjectRoles(Subject authenticatedSubject, CallbackHandler cbh)
+   {
+      return null;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#getTargetRoles(java.security.Principal, java.util.Map)
+    */
+   public Group getTargetRoles(Principal targetPrincipal, Map<String, Object> contextMap)
+   {
+      return null;
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.AuthorizationManager#getUserRoles(java.security.Principal)
+    */
+   public Set<Principal> getUserRoles(Principal principal)
+   {
+      return this.roles.get(principal.getName());
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see org.jboss.security.BaseSecurityManager#getSecurityDomain()
+    */
+   public String getSecurityDomain()
+   {
+      return "other";
+   }
+
+}

Added: projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/test/SecurityInterceptorsTestCase.java
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/test/SecurityInterceptorsTestCase.java	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/java/org/jboss/test/aspects/security/test/SecurityInterceptorsTestCase.java	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,207 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.aspects.security.test;
+
+import junit.framework.TestCase;
+
+import org.jboss.logging.Logger;
+import org.jboss.security.client.SecurityClient;
+import org.jboss.security.client.SecurityClientFactory;
+import org.jboss.test.aspects.security.support.AnnotatedPOJO;
+
+/**
+ * <p>
+ * A {@code TestCase} that verifies the functionality of the security interceptors.
+ * </p>
+ * 
+ * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
+ */
+public class SecurityInterceptorsTestCase extends TestCase
+{
+   private static Logger logger = Logger.getLogger(SecurityInterceptorsTestCase.class);
+
+   /**
+    * <p>
+    * Check that invocations to a protected resource are correclty intercepted by the {@code AuthenticationInterceptor}
+    * and that access is only granted to users that present the correct credentials.
+    * </p>
+    * 
+    * @throws Exception if an error occurs while running the test.
+    */
+   @SuppressWarnings("unused")
+   public void testAuthenticationInterceptor() throws Exception
+   {
+      AnnotatedPOJO pojo = null;
+
+      // unauthenticated users should not have access to the protected POJO.
+      try
+      {
+         pojo = new AnnotatedPOJO();
+         fail();
+      }
+      catch (RuntimeException re)
+      {
+         logger.info(re.getMessage());
+      }
+
+      // user that supplies wrong credentials should get a security (authentication) exception.
+      SecurityClient client = SecurityClientFactory.getSecurityClient();
+      client.setSimple("user1", "badpass");
+      client.login();
+      try
+      {
+         pojo = new AnnotatedPOJO();
+         fail();
+      }
+      catch (SecurityException se)
+      {
+         logger.info(se.getMessage());
+      }
+      client.logout();
+
+      // user with the correct credentials should be able to construct AnnotatedPOJO.
+      for (int i = 1; i < 5; i++)
+      {
+         client.setSimple("user" + i, "pass" + i);
+         client.login();
+         pojo = new AnnotatedPOJO();
+         client.logout();
+      }
+   }
+
+   /**
+    * <p>
+    * Check that invocations to a protected resource are intercepted by the {@code RoleBasedAuthorizationInterceptor}
+    * and that access is only granted to users that have the required roles.
+    * </p>
+    * 
+    * @throws Exception if an error occurs while running the test.
+    */
+   public void testAuthorizationInterceptor() throws Exception
+   {
+      AnnotatedPOJO pojo = null;
+
+      // user in the 'guest' role should have access to unchecked methods and constructors.
+      SecurityClient client = SecurityClientFactory.getSecurityClient();
+      client.setSimple("user1", "pass1");
+      client.login();
+
+      pojo = new AnnotatedPOJO();
+      pojo.uncheckedOperation();
+
+      try
+      {
+         pojo.excludedOperation();
+         fail();
+      }
+      catch (SecurityException se)
+      {
+         logger.info(se.getMessage());
+      }
+      try
+      {
+         pojo.manageProtectedValue();
+         fail();
+      }
+      catch (SecurityException se)
+      {
+         logger.info(se.getMessage());
+      }
+      try
+      {
+         pojo = new AnnotatedPOJO("Secret Phrase");
+         fail();
+      }
+      catch (SecurityException se)
+      {
+         logger.info(se.getMessage());
+      }
+      client.logout();
+
+      // user in the 'manager' role should have access to all but the excluded methods.
+      client.setSimple("user3", "pass3");
+      client.login();
+
+      pojo = new AnnotatedPOJO();
+      pojo.uncheckedOperation();
+      String phrase = pojo.manageProtectedValue();
+      assertNull(phrase);
+      pojo = new AnnotatedPOJO("Protected Info");
+      pojo.uncheckedOperation();
+      phrase = pojo.manageProtectedValue();
+      assertEquals("Protected Info", phrase);
+
+      try
+      {
+         pojo.excludedOperation();
+         fail();
+      }
+      catch (SecurityException se)
+      {
+         logger.info(se.getMessage());
+      }
+      client.logout();
+   }
+
+   /**
+    * <p>
+    * Check that a method annotated with {@code @RunAS} propagates the specified run-as identity when calling a method
+    * on another protected POJO.
+    * </p>
+    * 
+    * @throws Exception if an error occurs while running the test.
+    */
+   public void testRunAsInterceptor() throws Exception
+   {
+      AnnotatedPOJO pojo = null;
+      
+      // a user in the guest role should only be able to access the delegate through the run-as method.
+      SecurityClient client = SecurityClientFactory.getSecurityClient();
+      client.setSimple("user1", "pass1");
+      client.login();
+      
+      pojo = new AnnotatedPOJO();
+      String result = pojo.invokeDelegateRunAs();
+      assertEquals("Delegate Result", result);
+      try
+      {
+         pojo.invokeDelegate();
+         fail();
+      }
+      catch(SecurityException se)
+      {
+         logger.info(se.getMessage());
+      }
+      client.logout();
+      
+      // a user in the administrator role should be able to access the delegate using both invokeDelegate methods.
+      client.setSimple("user3", "pass3");
+      client.login();
+      
+      pojo = new AnnotatedPOJO("Protected Info");
+      result = pojo.invokeDelegate();
+      assertEquals("Delegate Result", result);
+      result = pojo.invokeDelegateRunAs();
+      assertEquals("Delegate Result", result);
+      client.logout();
+   }
+}

Added: projects/jboss-aspects/trunk/security/src/test/resources/jboss-aop.xml
===================================================================
--- projects/jboss-aspects/trunk/security/src/test/resources/jboss-aop.xml	                        (rev 0)
+++ projects/jboss-aspects/trunk/security/src/test/resources/jboss-aop.xml	2008-12-17 15:29:18 UTC (rev 82345)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+   "-//JBoss//DTD JBOSS AOP 1.0//EN"
+   "http://labs.jboss.com/portal/jbossaop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+
+   <stack name="SecurityInterceptors">
+      <interceptor factory="org.jboss.test.aspects.security.support.MockAuthenticationInterceptorFactory" scope="PER_CLASS"/>
+      <interceptor factory="org.jboss.test.aspects.security.support.MockAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+      <interceptor class="org.jboss.aspects.security.RunAsSecurityInterceptor" scope="PER_CLASS"/>
+   </stack>
+
+   <bind pointcut="all(@security)">
+      <stack-ref name="SecurityInterceptors"/>
+   </bind>
+
+   <bind pointcut="all(@org.jboss.aspects.security.Permissions)">
+      <stack-ref name="SecurityInterceptors"/>
+   </bind>
+
+   <bind pointcut="all(@org.jboss.aspects.security.Unchecked)">
+      <stack-ref name="SecurityInterceptors"/>
+   </bind>
+
+   <bind pointcut="all(@org.jboss.aspects.security.Exclude)">
+      <stack-ref name="SecurityInterceptors"/>
+   </bind>
+
+</aop>
\ No newline at end of file

Modified: projects/jboss-aspects/trunk/test/pom.xml
===================================================================
--- projects/jboss-aspects/trunk/test/pom.xml	2008-12-17 14:55:29 UTC (rev 82344)
+++ projects/jboss-aspects/trunk/test/pom.xml	2008-12-17 15:29:18 UTC (rev 82345)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.jboss.aspects</groupId>
     <artifactId>jboss-aspects-build</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
+    <version>1.0.1-SNAPSHOT</version>
     <relativePath>../build</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
@@ -31,7 +31,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader</argLine>
+          <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader -Djboss.aop.exclude=org.apache.maven</argLine>
           <!--forkMode>always</forkMode-->
           <includes>
             <include>**/*TestCase.java</include>




More information about the jboss-cvs-commits mailing list