[jboss-cvs] JBossAS SVN: r79311 - trunk/testsuite/src/main/org/jboss/test/web/security/authorization.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 9 18:17:44 EDT 2008
Author: mmoyses
Date: 2008-10-09 18:17:44 -0400 (Thu, 09 Oct 2008)
New Revision: 79311
Modified:
trunk/testsuite/src/main/org/jboss/test/web/security/authorization/XACMLWebIntegrationUnitTestCase.java
Log:
Test for side effects of redeploying XACML policies
Modified: trunk/testsuite/src/main/org/jboss/test/web/security/authorization/XACMLWebIntegrationUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/web/security/authorization/XACMLWebIntegrationUnitTestCase.java 2008-10-09 21:58:17 UTC (rev 79310)
+++ trunk/testsuite/src/main/org/jboss/test/web/security/authorization/XACMLWebIntegrationUnitTestCase.java 2008-10-09 22:17:44 UTC (rev 79311)
@@ -75,16 +75,46 @@
}
public void testRequestAttributePresence() throws Throwable
- {
+ {
+ doTestRequestAttributePresence();
+ }
+
+ public void testSubjectRBAC() throws Throwable
+ {
+ doTestSubjectRBAC();
+ }
+
+ /**
+ * Tests if redeploying causes any side effects.
+ * It runs the tests again after a redeploy.
+ */
+ public void testRedeploy() throws Throwable
+ {
+ //undeploy
+ String url = getResourceURL("web/xacml/app-policy-service.xml");
+ undeploy(url);
+ undeploy("xacml-requestattrib.war");
+ undeploy("xacml-subjectrole.war");
+ //deploy again
+ deploy("xacml-requestattrib.war");
+ deploy("xacml-subjectrole.war");
+ deploy(url);
+
+ doTestRequestAttributePresence();
+ doTestSubjectRBAC();
+ }
+
+ private void doTestRequestAttributePresence() throws Throwable
+ {
URL url = new URL(HttpUtils.getBaseURL()+"xacml-requestattrib/test?status=employed");
HttpUtils.accessURL(url, "JBoss XACML Test", HttpURLConnection.HTTP_OK);
url = new URL(HttpUtils.getBaseURL()+"xacml-requestattrib/test");
- HttpUtils.accessURL(url, "JBoss XACML Test", HttpURLConnection.HTTP_FORBIDDEN);
+ HttpUtils.accessURL(url, "JBoss XACML Test", HttpURLConnection.HTTP_FORBIDDEN);
}
- public void testSubjectRBAC() throws Throwable
- {
+ private void doTestSubjectRBAC() throws Throwable
+ {
URL url = new URL(HttpUtils.getBaseURL()+"xacml-subjectrole/test");
- HttpUtils.accessURL(url, "JBoss XACML Test", HttpURLConnection.HTTP_OK);
+ HttpUtils.accessURL(url, "JBoss XACML Test", HttpURLConnection.HTTP_OK);
}
}
More information about the jboss-cvs-commits
mailing list