[jboss-cvs] JBossAS SVN: r62853 - branches/JBoss_4_0_2_CP/testsuite/src/main/org/jboss/test/aop/bean.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 7 21:13:50 EDT 2007
Author: anil.saldhana at jboss.com
Date: 2007-05-07 21:13:50 -0400 (Mon, 07 May 2007)
New Revision: 62853
Modified:
branches/JBoss_4_0_2_CP/testsuite/src/main/org/jboss/test/aop/bean/SecurityTester.java
Log:
ASPATCH-207: fix the failing aop test by applying JBAS-2706
Modified: branches/JBoss_4_0_2_CP/testsuite/src/main/org/jboss/test/aop/bean/SecurityTester.java
===================================================================
--- branches/JBoss_4_0_2_CP/testsuite/src/main/org/jboss/test/aop/bean/SecurityTester.java 2007-05-08 01:13:14 UTC (rev 62852)
+++ branches/JBoss_4_0_2_CP/testsuite/src/main/org/jboss/test/aop/bean/SecurityTester.java 2007-05-08 01:13:50 UTC (rev 62853)
@@ -66,8 +66,8 @@
try{
log.info("TESTING XML Security");
- SecurityAssociation.setPrincipal(new SimplePrincipal("somebody"));
- SecurityAssociation.setCredential("password".toCharArray() );
+ char[] password = "password".toCharArray();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("somebody"), password);
log.info("testing unchecked constructor");
SecuredPOJO pojo = new SecuredPOJO(); // unchecked construction
@@ -76,8 +76,8 @@
log.info("testing unchecked field");
pojo.uncheckedField = 5;
- SecurityAssociation.setPrincipal(new SimplePrincipal("authfail"));
- SecurityAssociation.setCredential("password".toCharArray() );
+ SecurityAssociation.popSubjectContext();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("authfail"), password);
boolean securityFailure = true;
try
@@ -121,7 +121,8 @@
if (securityFailure) throw new RuntimeException("auth failure was not caught for constructor");
securityFailure = true;
- SecurityAssociation.setPrincipal(new SimplePrincipal("rolefail"));
+ SecurityAssociation.popSubjectContext();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("rolefail"), password);
try
{
log.info("testing role failure method");
@@ -161,7 +162,8 @@
if (securityFailure) throw new RuntimeException("role failure was not caught for constructor");
- SecurityAssociation.setPrincipal(new SimplePrincipal("pass"));
+ SecurityAssociation.popSubjectContext();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("pass"), password);
log.info("test pass");
pojo.someMethod();
pojo.someField = 5;
@@ -216,8 +218,8 @@
try{
log.info("TESTING Annotated Security");
- SecurityAssociation.setPrincipal(new SimplePrincipal("somebody"));
- SecurityAssociation.setCredential("password".toCharArray() );
+ char[] password = "password".toCharArray();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("somebody"), password);
log.info("testing unchecked constructor");
AnnotatedSecuredPOJO pojo = new AnnotatedSecuredPOJO(); // unchecked construction
@@ -226,8 +228,8 @@
log.info("testing unchecked field");
pojo.uncheckedField = 5;
- SecurityAssociation.setPrincipal(new SimplePrincipal("authfail"));
- SecurityAssociation.setCredential("password".toCharArray() );
+ SecurityAssociation.popSubjectContext();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("authfail"), password);
boolean securityFailure = true;
try
@@ -271,7 +273,8 @@
if (securityFailure) throw new RuntimeException("auth failure was not caught for constructor");
securityFailure = true;
- SecurityAssociation.setPrincipal(new SimplePrincipal("rolefail"));
+ SecurityAssociation.popSubjectContext();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("rolefail"), password);
try
{
log.info("testing role failure method");
@@ -311,7 +314,9 @@
if (securityFailure) throw new RuntimeException("role failure was not caught for constructor");
- SecurityAssociation.setPrincipal(new SimplePrincipal("pass"));
+ SecurityAssociation.popSubjectContext();
+ SecurityAssociation.pushSubjectContext(null, new SimplePrincipal("pass"), password);
+
log.info("test pass");
pojo.someMethod();
pojo.someField = 5;
More information about the jboss-cvs-commits
mailing list