[jboss-cvs] JBossAS SVN: r65612 - in branches/JBPAPP_4_2/testsuite: src/main/org/jboss/test/jacc/test and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 25 18:11:48 EDT 2007


Author: clebert.suconic at jboss.com
Date: 2007-09-25 18:11:48 -0400 (Tue, 25 Sep 2007)
New Revision: 65612

Added:
   branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/
   branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/jboss-service.xml
   branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/spec-test-config.xml
   branches/JBPAPP_4_2/testsuite/src/resources/security/custom-secmgr/queues-jbm-service.xml
Modified:
   branches/JBPAPP_4_2/testsuite/imports/sections/security.xml
   branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/EJBSpecUnitTestCase.java
   branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/WebIntegrationUnitTestCase.java
   branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/CustomSecurityManagerTestCase.java
   branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/EJBSpecUnitTestCase.java
Log:
Fixing testsuite on the integration with JBM

Modified: branches/JBPAPP_4_2/testsuite/imports/sections/security.xml
===================================================================
--- branches/JBPAPP_4_2/testsuite/imports/sections/security.xml	2007-09-25 21:53:49 UTC (rev 65611)
+++ branches/JBPAPP_4_2/testsuite/imports/sections/security.xml	2007-09-25 22:11:48 UTC (rev 65612)
@@ -91,7 +91,34 @@
          </fileset>
       </jar>
       
-      <!-- build security-srp.jar and security-srp.sar -->
+    <!-- build security-spec-jbm.jar -->
+    <jar destfile="${build.lib}/security-spec-jbm.sar">
+       <metainf dir="${build.resources}/security-spec/service-inf-jbm"/>
+       <fileset dir="${build.resources}/security">
+          <include name="tst.keystore"/>
+       </fileset>
+    </jar>
+    <jar destfile="${build.lib}/security-spec-jbm.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/security/interfaces/**"/>
+          <include name="org/jboss/test/security/ejb/**"/>
+          <include name="org/jboss/test/security/test/Namespace*"/>
+          <include name="org/jboss/test/security/test/PermissionName*"/>
+       </fileset>
+       <fileset dir="${build.resources}/security-spec">
+          <include name="META-INF/ejb-jar.xml"/>
+          <include name="META-INF/jboss.xml"/>
+          <include name="users.properties"/>
+          <include name="roles.properties"/>
+       </fileset>
+       <fileset dir="${build.lib}">
+          <include name="security-spec-jbm.sar"/>
+       </fileset>
+    </jar>
+    
+
+   	
+   	  <!-- build security-srp.jar and security-srp.sar -->
       <jar destfile="${build.lib}/security-srp.sar">
          <metainf dir="${build.resources}/security-srp/service-inf"/>
          <fileset dir="${build.classes}">

Modified: branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/EJBSpecUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/EJBSpecUnitTestCase.java	2007-09-25 21:53:49 UTC (rev 65611)
+++ branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/EJBSpecUnitTestCase.java	2007-09-25 22:11:48 UTC (rev 65612)
@@ -91,6 +91,8 @@
       // Create an initializer for the test suite
       TestSetup wrapper = new JBossTestSetup(suite)
       {
+         boolean useJBM = System.getProperty("jbosstest.useJBM") != null;
+
          protected void setUp() throws Exception
          {
             super.setUp();
@@ -99,12 +101,14 @@
             */
             super.initDefaultLoginConfig();
             Configuration.setConfiguration(new XMLLoginConfigImpl());
-            redeploy("security-spec.jar");
+            
+            redeploy(useJBM?"security-spec-jbm.jar":"security-spec.jar");
             flushAuthCache();
          }
          protected void tearDown() throws Exception
          {
-            undeploy("security-spec.jar");
+             
+            undeploy(useJBM?"security-spec-jbm.jar":"security-spec.jar");
             super.tearDown();
          
          }

Modified: branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/WebIntegrationUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/WebIntegrationUnitTestCase.java	2007-09-25 21:53:49 UTC (rev 65611)
+++ branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jacc/test/WebIntegrationUnitTestCase.java	2007-09-25 22:11:48 UTC (rev 65612)
@@ -79,13 +79,15 @@
          }
          protected void tearDown() throws Exception
          {
+        	boolean useJBM = System.getProperty("jbosstest.useJBM") != null;
+        	
             undeploy("jbosstest-web.ear");
             super.tearDown();
 
             // Remove all the messages created during this test
             getServer().invoke
             (
-               new ObjectName("jboss.mq.destination:service=Queue,name=testQueue"),
+               new ObjectName(useJBM?"jboss.messaging.destination:service=Topic,name=testTopic":"jboss.mq.destination:service=Queue,name=testQueue"),
                "removeAllMessages",
                new Object[0],
                new String[0]

Modified: branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/CustomSecurityManagerTestCase.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/CustomSecurityManagerTestCase.java	2007-09-25 21:53:49 UTC (rev 65611)
+++ branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/CustomSecurityManagerTestCase.java	2007-09-25 22:11:48 UTC (rev 65612)
@@ -101,18 +101,20 @@
       // Create an initializer for the test suite
       TestSetup wrapper = new JBossTestSetup(suite)
       {
+         boolean useJBM = System.getProperty("jbosstest.useJBM") != null;
+
          protected void setUp() throws Exception
          {
             super.setUp();
             Configuration.setConfiguration(new XMLLoginConfigImpl());
-            deploy(getResourceURL("security/custom-secmgr/queues-service.xml"));
+            deploy(getResourceURL(useJBM?"security/custom-secmgr/queues-jbm-service.xml":"security/custom-secmgr/queues-service.xml"));
             redeploy("custom-secmgrtests.ear"); 
             flushAuthCache();
          }
          protected void tearDown() throws Exception
          {
             undeploy("custom-secmgrtests.ear"); 
-            undeploy(getResourceURL("security/custom-secmgr/queues-service.xml"));
+            undeploy(getResourceURL(useJBM?"security/custom-secmgr/queues-jbm-service.xml":"security/custom-secmgr/queues-service.xml"));
             super.tearDown();
          
          }

Modified: branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/EJBSpecUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/EJBSpecUnitTestCase.java	2007-09-25 21:53:49 UTC (rev 65611)
+++ branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/security/test/EJBSpecUnitTestCase.java	2007-09-25 22:11:48 UTC (rev 65612)
@@ -937,16 +937,18 @@
       // Create an initializer for the test suite
       TestSetup wrapper = new JBossTestSetup(suite)
       {
+         boolean useJBM = System.getProperty("jbosstest.useJBM") != null;
+
          protected void setUp() throws Exception
          {
             super.setUp();
             Configuration.setConfiguration(new XMLLoginConfigImpl());
-            redeploy("security-spec.jar");
+            redeploy(useJBM?"security-spec-jbm.jar":"security-spec.jar");
             flushAuthCache();
          }
          protected void tearDown() throws Exception
          {
-            undeploy("security-spec.jar");
+            undeploy(useJBM?"security-spec-jbm.jar":"security-spec.jar");
             super.tearDown();
          
          }

Added: branches/JBPAPP_4_2/testsuite/src/resources/security/custom-secmgr/queues-jbm-service.xml
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/resources/security/custom-secmgr/queues-jbm-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2/testsuite/src/resources/security/custom-secmgr/queues-jbm-service.xml	2007-09-25 22:11:48 UTC (rev 65612)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueA"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueB"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+   
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueC"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueD"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+</server>


Property changes on: branches/JBPAPP_4_2/testsuite/src/resources/security/custom-secmgr/queues-jbm-service.xml
___________________________________________________________________
Name: svn:keywords
   + Id LastChangedDate Author Revision

Added: branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/jboss-service.xml
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/jboss-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/jboss-service.xml	2007-09-25 22:11:48 UTC (rev 65612)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <!-- The custom JAAS login configuration service that installs 
+       a Configuration capable of dynamically updating the
+       config settings
+   -->
+   <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
+         name="jboss.security.tests:service=SecuritySpecLoginConfig">
+      <attribute name="AuthConfig">META-INF/spec-test-config.xml</attribute>
+      <depends optional-attribute-name="LoginConfigService">
+         jboss.security:service=XMLLoginConfig
+      </depends>
+      <depends optional-attribute-name="SecurityManagerService">
+         jboss.security:service=JaasSecurityManager
+      </depends>
+   </mbean>
+
+   <!-- A JaasSecurityDomain setup to test that changes to the security
+   layer do not affect the ability to use this subclass of JaasSecurityManager
+   -->
+   <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
+      name="jboss.security:service=JaasSecurityDomain,domain=spec-test-domain">
+      <constructor>
+         <arg type="java.lang.String" value="spec-test-domain"/>
+      </constructor>
+      <attribute name="KeyStoreURL">resource:tst.keystore</attribute>
+      <attribute name="KeyStorePass">unit-tests</attribute>
+      <attribute name="Salt">abcdefgh</attribute>
+      <attribute name="IterationCount">13</attribute>
+      <depends optional-attribute-name="ManagerServiceName">jboss.security:service=JaasSecurityManager</depends>
+   </mbean>
+
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueA"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueB"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+   
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueC"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=QueueD"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+</server>


Property changes on: branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/jboss-service.xml
___________________________________________________________________
Name: svn:keywords
   + "Id LastChangedDate Author Revision"

Added: branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/spec-test-config.xml
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/spec-test-config.xml	                        (rev 0)
+++ branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/spec-test-config.xml	2007-09-25 22:11:48 UTC (rev 65612)
@@ -0,0 +1,36 @@
+<?xml version='1.0'?>
+<!DOCTYPE policy PUBLIC
+      "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+      "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The JAAS login configuration file for the java:/jaas/spec-test
+security domain used by the security-spec test case
+-->
+<policy>
+
+    <application-policy name = "spec-test">
+       <authentication>
+          <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
+             flag = "required">
+             <module-option name = "unauthenticatedIdentity">anonymous</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+
+    <application-policy name = "spec-test-domain">
+       <authentication>
+          <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
+             flag = "required">
+             <module-option name = "unauthenticatedIdentity">anonymous</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+   <application-policy name = "spec-test-domain2">
+      <authentication>
+         <login-module code = "org.jboss.test.security.ejb.UsersRoles2LoginModule"
+            flag = "required">
+         </login-module>
+      </authentication>
+   </application-policy>
+
+</policy>


Property changes on: branches/JBPAPP_4_2/testsuite/src/resources/security-spec/service-inf-jbm/spec-test-config.xml
___________________________________________________________________
Name: svn:keywords
   + "Id LastChangedDate Author Revision"




More information about the jboss-cvs-commits mailing list