[jboss-cvs] JBossAS SVN: r108261 - in branches/JBPAPP_5_1/testsuite: imports and 16 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Sep 21 11:52:46 EDT 2010
Author: pskopek at redhat.com
Date: 2010-09-21 11:52:45 -0400 (Tue, 21 Sep 2010)
New Revision: 108261
Added:
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorld.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorldBean.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/RMIOverHttpsTestCase.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/TestClient.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnot.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnotBean.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/test/TxTimeoutAnnotUnitTestCase.java
branches/JBPAPP_5_1/testsuite/src/resources/cc/cc.policy
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/ejb3-connectors-jboss-beans.xml
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/jbossweb.sar/
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/jbossweb.sar/server.xml
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker-service.xml
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker.war/
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker.war/WEB-INF/
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker.war/WEB-INF/web.xml
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.cer
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.keystore
branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.truststore
Modified:
branches/JBPAPP_5_1/testsuite/build.xml
branches/JBPAPP_5_1/testsuite/imports/sections/security.xml
branches/JBPAPP_5_1/testsuite/imports/sections/tm.xml
branches/JBPAPP_5_1/testsuite/imports/server-config.xml
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleSession.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatefulSessionBean.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatelessSessionBean.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/test/EJB3SpecUnitTestCase.java
branches/JBPAPP_5_1/testsuite/src/resources/cc/testCaseMapping_2.0.xml
branches/JBPAPP_5_1/testsuite/src/resources/cc/tsfi_master_data.txt
Log:
Changes to testsuite with regards to CC certification.
Some new testcases and configurations.
Modified: branches/JBPAPP_5_1/testsuite/build.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/build.xml 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/build.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -1224,6 +1224,11 @@
<exclude name="**/test/passwordinjection/test/*UnitTestCase.class"/>
<exclude name="**/test/security/test/authorization/secured/*UnitTestCase.class"/>
</patternset>
+ <!-- A patternset required for Common Criteria certification -->
+ <patternset id="cc.includes">
+ <include name="**/test/tm/test/TxTimeout*TestCase.class"/>
+ <include name="**/test/security/rmi/test/*TestCase.class"/>
+ </patternset>
<!-- A patternset that requires jboss to run with a security manager -->
<patternset id="securitymgr.includes">
<include name="**/test/securitymgr/test/*TestCase.class"/>
@@ -1678,6 +1683,95 @@
<server:stop name="${conf}"/>
</target>
+ <target name="security-basic-tests"
+ description="The units tests which are run against the jboss all config" depends="init">
+
+
+ <!-- Default configuration to run the tests against -->
+ <property name="conf" value="all"/>
+
+ <echo message="Replacing hornetq-roles and hornetq-users.properties used for tests"/>
+
+ <copy file="${module.output}/resources/test-configs/jbossmessaging/conf/props/hornetq-roles.properties"
+ tofile="${jboss.dist}/server/${conf}/conf/props/hornetq-roles.properties" overwrite="true"/>
+
+ <copy file="${module.output}/resources/test-configs/jbossmessaging/conf/props/hornetq-users.properties"
+ tofile="${jboss.dist}/server/${conf}/conf/props/hornetq-users.properties" overwrite="true"/>
+
+ <server:start name="${conf}"/>
+
+ <antcall target="tests-security-basic-unit">
+ <param name="custom.excludes" value="ec2.excludes" />
+ </antcall>
+
+ <server:stop name="${conf}" />
+ </target>
+
+ <!-- Tests for Common Criteria Evaluation. The JBoss server must be running with a security manager for those tests -->
+ <target name="tests-common-criteria" description="Tests run against a jboss server configured according to CC Guide" depends="init">
+
+ <create-config baseconf="production" newconf="cc">
+ <patternset>
+ <include name="conf/**" />
+ <include name="deployers/**" />
+ <include name="deploy/**" />
+ <include name="deploy-hasingleton/**" />
+ <include name="farm/**" />
+ <include name="lib/**" />
+ </patternset>
+ </create-config>
+
+ <echo message="Starting CC with policy ${build.resources}/securitymgr/server.policy" />
+ <echo message="jboss.home.dir=${jboss.dist}" />
+ <echo message="jboss.server.home.dir=${jboss.dist}${/}server${/}cc" />
+ <echo message="java.naming.provider.url=${node0.jndi.url}" />
+ <echo message="jbosstest.server.host=${node0}" />
+
+ <server:start name="cc" />
+
+ <junit dir="${module.output}" printsummary="true" haltonerror="false" haltonfailure="false" fork="true" timeout="${junit.timeout}" jvm="${junit.jvm}">
+
+ <jvmarg line="${junit.jvm.options}" />
+
+ <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}" />
+ <sysproperty key="jbosstest.server.host" value="${node0}" />
+ <sysproperty key="jboss.home" file="${project.root}" />
+ <sysproperty key="jboss.thirdparty.dir" file="${project.root}/thirdparty" />
+ <sysproperty key="jboss.tools.dir" file="${project.root}/tools" />
+ <sysproperty key="jbosstest.deploy.dir" file="${build.lib}" />
+ <sysproperty key="jbosstest.secure" value="true" />
+ <sysproperty key="java.security.auth.login.config" value="${build.resources}/security/auth.conf" />
+ <sysproperty key="build.testlog" value="${build.testlog}" />
+ <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml" />
+ <sysproperty key="javax.net.ssl.trustStore" value="${build.resources}/test-configs/cc/ssl.truststore" />
+ <sysproperty key="javax.net.ssl.trustStorePassword" value="123456" />
+ <sysproperty key="java.protocol.handler.pkgs" value="javax.net.ssl" />
+
+ <classpath>
+ <pathelement location="${build.resources}" />
+ <pathelement location="${build.classes}" />
+ <path refid="tests.classpath" />
+ </classpath>
+
+ <sysproperty key="jboss-junit-configuration" value="tests-security-manager" />
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="${junit.formatter.usefile}" extension="-tests-security-manager.xml" />
+
+ <batchtest todir="${build.reports}" haltonerror="false" haltonfailure="false" fork="true">
+
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/test/securitymgr/test/PolicyUnitTestCase.class" />
+ <patternset refid="cc.includes"/>
+ </fileset>
+ </batchtest>
+ </junit>
+
+ <echo>Waiting for server to shutdown...</echo>
+ <server:stop name="cc"/>
+ <antcall target="tests-report"/>
+
+ </target>
+
+
<target name="tests-cluster-ec2" description="Runs the various test targets, but against cluster-ec2 config" depends="init">
<record name="${basedir}/output/tests.log" append="no" action="start" loglevel="info"/>
<property name="conf" value="cluster-ec2"/>
Modified: branches/JBPAPP_5_1/testsuite/imports/sections/security.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/sections/security.xml 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/imports/sections/security.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -1,10 +1,10 @@
<project name="tests-security-jars">
-<!-- security test -->
+ <!-- security test -->
<target name="_jars-security">
<mkdir dir="${build.lib}"/>
<!-- caller-info.jar -->
- <jar destfile="${build.lib}/caller-info.jar">
+ <jar destfile="${build.lib}/caller-info.jar">
<metainf dir="${build.resources}/security/caller-info">
<include name="ejb-jar.xml" />
<include name="jboss.xml" />
@@ -20,10 +20,10 @@
<include name="org/jboss/test/security/ejb/StatefulSessionBean.*"/>
<include name="org/jboss/test/security/interfaces/**"/>
</fileset>
- </jar>
+ </jar>
<!-- subject-context.ear/{subject-context.jar,subject-context.war} -->
- <jar destfile="${build.lib}/subject-context.jar">
+ <jar destfile="${build.lib}/subject-context.jar">
<metainf dir="${build.resources}/security/subject-context">
<include name="ejb-jar.xml" />
<include name="jboss.xml" />
@@ -38,14 +38,14 @@
<include name="org/jboss/test/security/interfaces/RunAsServiceRemote*"/>
<include name="org/jboss/test/security/interfaces/SecuredServiceRemote*"/>
</fileset>
- </jar>
- <war warfile="${build.lib}/subject-context.war"
+ </jar>
+ <war warfile="${build.lib}/subject-context.war"
webxml="${build.resources}/security/subject-context/web.xml">
- <webinf dir="${build.resources}/security/subject-context">
+ <webinf dir="${build.resources}/security/subject-context">
<include name="jboss-web.xml"/>
- </webinf>
+ </webinf>
<classes dir="${build.classes}">
- <include name="org/jboss/test/security/servlets/RunAsServlet.*"/>
+ <include name="org/jboss/test/security/servlets/RunAsServlet.*"/>
</classes>
</war>
<ear destfile="${build.lib}/subject-context.ear"
@@ -84,9 +84,9 @@
<include name="META-INF/jboss-structure.xml"/>
<include name="users.properties"/>
<include name="roles.properties"/>
- </fileset>
+ </fileset>
<fileset dir="${build.lib}">
- <include name="security-spec.sar"/>
+ <include name="security-spec.sar"/>
</fileset>
</jar>
@@ -171,7 +171,7 @@
webxml="${build.resources}/web/custom-principal/WEB-INF/web.xml">
<webinf dir="${build.resources}/web/custom-principal/WEB-INF/">
<include name="jboss-web.xml"/>
- </webinf>
+ </webinf>
<fileset dir="${build.resources}/web/custom-principal">
<include name="**/*.html"/>
<include name="**/*.jsp"/>
@@ -231,27 +231,27 @@
<!-- web-constraints.war -->
<war warfile="${build.lib}/web-constraints.war"
webxml="${build.resources}/security/web-constraints/web.xml">
- <classes dir="${build.resources}/security/web-constraints/">
- <include name="*.properties"/>
- </classes>
+ <classes dir="${build.resources}/security/web-constraints/">
+ <include name="*.properties"/>
+ </classes>
<classes dir="${build.classes}">
- <include name="org/jboss/test/security/servlets/ConstraintsServlet.class"/>
+ <include name="org/jboss/test/security/servlets/ConstraintsServlet.class"/>
</classes>
</war>
- <!-- build client-login-tests.jar -->
- <jar destfile="${build.lib}/client-login-tests.jar">
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/security/clientlogin/**"/>
- </fileset>
- <fileset dir="${build.resources}/security/client-login">
- <include name="jaas-service.xml"/>
- </fileset>
- <metainf dir="${build.resources}/security/client-login">
- <include name="ejb-jar.xml" />
- <include name="jboss.xml" />
- </metainf>
- </jar>
+ <!-- build client-login-tests.jar -->
+ <jar destfile="${build.lib}/client-login-tests.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/clientlogin/**"/>
+ </fileset>
+ <fileset dir="${build.resources}/security/client-login">
+ <include name="jaas-service.xml"/>
+ </fileset>
+ <metainf dir="${build.resources}/security/client-login">
+ <include name="ejb-jar.xml" />
+ <include name="jboss.xml" />
+ </metainf>
+ </jar>
<!-- build missing-methods-unchecked.jar -->
<jar destfile="${build.lib}/missing-methods-unchecked.jar">
@@ -286,61 +286,61 @@
</zipfileset>
</jar>
- <!-- security-jacc-callerinrole.jar -->
- <jar destfile="${build.lib}/security-jacc-callerinrole.jar">
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/security/interfaces/Useful*"/>
- <include name="org/jboss/test/security/ejb/Useful*"/>
- </fileset>
- <fileset dir="${build.resources}/security/jacc/callerInRole">
- <include name="META-INF/ejb-jar.xml"/>
- <include name="META-INF/jboss.xml"/>
- <include name="users.properties"/>
- <include name="roles.properties"/>
- </fileset>
- </jar>
-
- <!-- deepcopy.war -->
+ <!-- security-jacc-callerinrole.jar -->
+ <jar destfile="${build.lib}/security-jacc-callerinrole.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/interfaces/Useful*"/>
+ <include name="org/jboss/test/security/ejb/Useful*"/>
+ </fileset>
+ <fileset dir="${build.resources}/security/jacc/callerInRole">
+ <include name="META-INF/ejb-jar.xml"/>
+ <include name="META-INF/jboss.xml"/>
+ <include name="users.properties"/>
+ <include name="roles.properties"/>
+ </fileset>
+ </jar>
+
+ <!-- deepcopy.war -->
<war warfile="${build.lib}/deepcopy.war"
- webxml="${build.resources}/security/deepcopy/WEB-INF/web.xml">
- <webinf dir="${build.resources}/security/deepcopy/WEB-INF">
- <include name="jboss-web.xml"/>
- </webinf>
- <classes dir="${build.classes}">
+ webxml="${build.resources}/security/deepcopy/WEB-INF/web.xml">
+ <webinf dir="${build.resources}/security/deepcopy/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${build.classes}">
<include
- name="org/jboss/test/security/servlets/DeepCopy*.class"/>
- </classes>
- </war>
-
- <!-- package the resources as a jar -->
- <jar destfile="${build.lib}/deepcopy-resources.jar">
- <fileset dir="${build.resources}/security/deepcopy/META-INF">
- <include name="deepcopy-config.xml"/>
- </fileset>
- </jar>
+ name="org/jboss/test/security/servlets/DeepCopy*.class"/>
+ </classes>
+ </war>
- <!--deepcopy.ear-->
+ <!-- package the resources as a jar -->
+ <jar destfile="${build.lib}/deepcopy-resources.jar">
+ <fileset dir="${build.resources}/security/deepcopy/META-INF">
+ <include name="deepcopy-config.xml"/>
+ </fileset>
+ </jar>
+
+ <!--deepcopy.ear-->
<ear destfile="${build.lib}/deepcopy.ear"
- appxml="${build.resources}/security/deepcopy/META-INF/application.xml" >
- <metainf dir="${build.resources}/security/deepcopy/META-INF">
- <include name="*.xml"/>
- <exclude name="deepcopy-service.xml"/>
- <exclude name="deepcopy-config.xml"/>
- <exclude name="application.xml"/>
- </metainf>
- <zipfileset dir="${build.resources}/security/deepcopy/META-INF">
- <include name="deepcopy-service.xml" />
- </zipfileset>
- <zipfileset dir="output/lib" prefix="lib">
- <include name="deepcopy-resources.jar" />
- </zipfileset>
- <fileset dir="output/lib">
- <include name="deepcopy.war" />
- </fileset>
- </ear>
+ appxml="${build.resources}/security/deepcopy/META-INF/application.xml" >
+ <metainf dir="${build.resources}/security/deepcopy/META-INF">
+ <include name="*.xml"/>
+ <exclude name="deepcopy-service.xml"/>
+ <exclude name="deepcopy-config.xml"/>
+ <exclude name="application.xml"/>
+ </metainf>
+ <zipfileset dir="${build.resources}/security/deepcopy/META-INF">
+ <include name="deepcopy-service.xml" />
+ </zipfileset>
+ <zipfileset dir="output/lib" prefix="lib">
+ <include name="deepcopy-resources.jar" />
+ </zipfileset>
+ <fileset dir="output/lib">
+ <include name="deepcopy.war" />
+ </fileset>
+ </ear>
<!-- xacml-ejb.jar -->
- <jar destfile="${build.lib}/xacml-ejb.jar">
+ <jar destfile="${build.lib}/xacml-ejb.jar">
<metainf dir="${build.resources}/security/authorization/xacml-ejb/META-INF">
<include name="ejb-jar.xml" />
<include name="jboss.xml" />
@@ -356,91 +356,91 @@
<include name="users.properties"/>
<include name="roles.properties"/>
</fileset>
- </jar>
-
- <!--jmxinvoker-authorization-test.jar -->
- <jar destfile="${build.lib}/jmxinvoker-authorization-test.jar">
- <fileset dir="${build.resources}/jmx/jmxadaptor/">
- <include name="jmxinvoker-roles.properties"/>
- </fileset>
- <fileset dir="${build.resources}/security/">
+ </jar>
+
+ <!--jmxinvoker-authorization-test.jar -->
+ <jar destfile="${build.lib}/jmxinvoker-authorization-test.jar">
+ <fileset dir="${build.resources}/jmx/jmxadaptor/">
+ <include name="jmxinvoker-roles.properties"/>
+ </fileset>
+ <fileset dir="${build.resources}/security/">
<include name="users.properties"/>
<include name="roles.properties"/>
- </fileset>
- </jar>
+ </fileset>
+ </jar>
- <!-- ejb-null-security-domain.jar -->
- <jar destfile="${build.lib}/ejb-null-security-domain.jar">
- <metainf dir="${build.resources}/security/ejb-null-security-domain">
- <include name="ejb-jar.xml" />
- <include name="jboss.xml" />
- </metainf>
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/security/ejb/StatelessSessionBean.*"/>
- <include name="org/jboss/test/security/interfaces/StatelessSession*"/>
- </fileset>
- <fileset dir="${build.resources}/security">
- <include name="users.properties"/>
- <include name="roles.properties"/>
- </fileset>
- </jar>
+ <!-- ejb-null-security-domain.jar -->
+ <jar destfile="${build.lib}/ejb-null-security-domain.jar">
+ <metainf dir="${build.resources}/security/ejb-null-security-domain">
+ <include name="ejb-jar.xml" />
+ <include name="jboss.xml" />
+ </metainf>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/ejb/StatelessSessionBean.*"/>
+ <include name="org/jboss/test/security/interfaces/StatelessSession*"/>
+ </fileset>
+ <fileset dir="${build.resources}/security">
+ <include name="users.properties"/>
+ <include name="roles.properties"/>
+ </fileset>
+ </jar>
- <!--JASPI WEB Form -->
- <war warfile="${build.lib}/jaspi-web-form.war"
+ <!--JASPI WEB Form -->
+ <war warfile="${build.lib}/jaspi-web-form.war"
webxml="${build.resources}/security/jaspi/jaspi-web-form.war/WEB-INF/web.xml">
- <webinf dir="${build.resources}/security/jaspi/jaspi-web-form.war/WEB-INF">
- <include name="jboss-web.xml"/>
- <include name="context.xml"/>
- </webinf>
- <classes dir="${build.resources}/security/jaspi/jaspi-web-form.war/WEB-INF/classes"/>
- <fileset dir="${build.resources}/security/jaspi/jaspi-web-form.war">
- <include name="*jsp"/>
- <include name="*html"/>
- </fileset>
- </war>
+ <webinf dir="${build.resources}/security/jaspi/jaspi-web-form.war/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="context.xml"/>
+ </webinf>
+ <classes dir="${build.resources}/security/jaspi/jaspi-web-form.war/WEB-INF/classes"/>
+ <fileset dir="${build.resources}/security/jaspi/jaspi-web-form.war">
+ <include name="*jsp"/>
+ <include name="*html"/>
+ </fileset>
+ </war>
- <!--JASPI WEB Basic -->
- <war warfile="${build.lib}/jaspi-web-basic.war"
+ <!--JASPI WEB Basic -->
+ <war warfile="${build.lib}/jaspi-web-basic.war"
webxml="${build.resources}/security/jaspi/jaspi-web-basic.war/WEB-INF/web.xml">
- <webinf dir="${build.resources}/security/jaspi/jaspi-web-basic.war/WEB-INF">
- <include name="jboss-web.xml"/>
- <include name="context.xml"/>
- </webinf>
- <classes dir="${build.resources}/security/jaspi/jaspi-web-basic.war/WEB-INF/classes"/>
- <fileset dir="${build.resources}/security/jaspi/jaspi-web-basic.war">
- <include name="*jsp"/>
- <include name="*html"/>
- </fileset>
- </war>
+ <webinf dir="${build.resources}/security/jaspi/jaspi-web-basic.war/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="context.xml"/>
+ </webinf>
+ <classes dir="${build.resources}/security/jaspi/jaspi-web-basic.war/WEB-INF/classes"/>
+ <fileset dir="${build.resources}/security/jaspi/jaspi-web-basic.war">
+ <include name="*jsp"/>
+ <include name="*html"/>
+ </fileset>
+ </war>
- <!-- JBAS-6060: Tolerate security domain with no java:/jaas prefix -->
- <war warfile="${build.lib}/sdtolerate.war"
+ <!-- JBAS-6060: Tolerate security domain with no java:/jaas prefix -->
+ <war warfile="${build.lib}/sdtolerate.war"
webxml="${build.resources}/security/sdtolerate/web/WEB-INF/web.xml">
- <webinf dir="${build.resources}/security/sdtolerate/web/WEB-INF">
- <include name="jboss-web.xml"/>
- </webinf>
- <fileset dir="${build.resources}/security/sdtolerate/web">
- <include name="*jsp"/>
- <include name="*html"/>
- </fileset>
- </war>
+ <webinf dir="${build.resources}/security/sdtolerate/web/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <fileset dir="${build.resources}/security/sdtolerate/web">
+ <include name="*jsp"/>
+ <include name="*html"/>
+ </fileset>
+ </war>
- <jar destfile="${build.lib}/sdtolerate.jar">
- <metainf dir="${build.resources}/security/sdtolerate/ejb">
- <include name="ejb-jar.xml" />
- <include name="jboss.xml" />
- </metainf>
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/security/ejb/StatelessSessionBean.*"/>
- <include name="org/jboss/test/security/interfaces/StatelessSession*"/>
- </fileset>
- </jar>
+ <jar destfile="${build.lib}/sdtolerate.jar">
+ <metainf dir="${build.resources}/security/sdtolerate/ejb">
+ <include name="ejb-jar.xml" />
+ <include name="jboss.xml" />
+ </metainf>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/ejb/StatelessSessionBean.*"/>
+ <include name="org/jboss/test/security/interfaces/StatelessSession*"/>
+ </fileset>
+ </jar>
- <jar destfile="${build.lib}/sdtolerate-resources.jar">
- <fileset dir="${build.resources}/security/sdtolerate">
- <include name="*.properties" />
- </fileset>
- </jar>
+ <jar destfile="${build.lib}/sdtolerate-resources.jar">
+ <fileset dir="${build.resources}/security/sdtolerate">
+ <include name="*.properties" />
+ </fileset>
+ </jar>
<ear earfile="${build.lib}/sdtolerate.ear"
appxml="${build.resources}/security/sdtolerate/application.xml">
@@ -448,70 +448,77 @@
<include name="sdtolerate.jar"/>
<include name="sdtolerate.war"/>
</fileset>
- <fileset dir="${build.resources}/security/sdtolerate">
- <include name="*-jboss-beans.xml" />
- </fileset>
+ <fileset dir="${build.resources}/security/sdtolerate">
+ <include name="*-jboss-beans.xml" />
+ </fileset>
<zipfileset dir="${build.lib}" prefix="lib">
<include name="sdtolerate-resources.jar" />
</zipfileset>
</ear>
- <!-- acl-integration.jar -->
- <jar destfile="${build.lib}/acl-integration.jar">
- <metainf dir="${build.resources}/security/authorization/acl-ejb/META-INF">
- <include name="jboss-acl-policy.xml" />
- </metainf>
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/security/ejb/ACLSessionImpl.class"/>
- <include name="org/jboss/test/security/interfaces/ACLSession.class"/>
- <include name="org/jboss/test/security/resources/TestResource.class"/>
- </fileset>
- </jar>
+ <!-- acl-integration.jar -->
+ <jar destfile="${build.lib}/acl-integration.jar">
+ <metainf dir="${build.resources}/security/authorization/acl-ejb/META-INF">
+ <include name="jboss-acl-policy.xml" />
+ </metainf>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/ejb/ACLSessionImpl.class"/>
+ <include name="org/jboss/test/security/interfaces/ACLSession.class"/>
+ <include name="org/jboss/test/security/resources/TestResource.class"/>
+ </fileset>
+ </jar>
- <!-- ejb3 security ear -->
- <jar destfile="${build.lib}/security-ejb3.jar">
- <metainf dir="${build.resources}/security/ejb3/META-INF">
- <include name="jboss.xml" />
- </metainf>
- <fileset dir="${build.resources}/security/ejb3/config">
- <include name="ejb3-test-users.properties"/>
- <include name="ejb3-test-roles.properties"/>
- <include name="ejb3-test-jboss-beans.xml"/>
- </fileset>
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/security/ejb3/*.class"/>
- </fileset>
- </jar>
-
- <!-- JBAS-1824:All Star Role jacc(create WebResourcePerm(url,null) -->
- <war warfile="${build.lib}/jacc-allstarrole.war"
+ <!-- ejb3 security ear -->
+ <jar destfile="${build.lib}/security-ejb3.jar">
+ <metainf dir="${build.resources}/security/ejb3/META-INF">
+ <include name="jboss.xml" />
+ </metainf>
+ <fileset dir="${build.resources}/security/ejb3/config">
+ <include name="ejb3-test-users.properties"/>
+ <include name="ejb3-test-roles.properties"/>
+ <include name="ejb3-test-jboss-beans.xml"/>
+ </fileset>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/ejb3/*.class"/>
+ </fileset>
+ </jar>
+
+ <!-- JBAS-1824:All Star Role jacc(create WebResourcePerm(url,null) -->
+ <war warfile="${build.lib}/jacc-allstarrole.war"
webxml="${build.resources}/security/jacc/allStarRole/WEB-INF/web.xml">
- <fileset dir="${build.resources}/security/jacc/allStarRole">
- <include name="*html"/>
- <include name="WEB-INF/classes/*"/>
- <include name="WEB-INF/jboss-web.xml"/>
- </fileset>
- </war>
+ <fileset dir="${build.resources}/security/jacc/allStarRole">
+ <include name="*html"/>
+ <include name="WEB-INF/classes/*"/>
+ <include name="WEB-INF/jboss-web.xml"/>
+ </fileset>
+ </war>
<war warfile="${build.lib}/jacc-allstarrole-noconfig.war"
webxml="${build.resources}/security/jacc/allStarRole/WEB-INF/web.xml">
- <fileset dir="${build.resources}/security/jacc/allStarRole/">
+ <fileset dir="${build.resources}/security/jacc/allStarRole/">
<include name="*html"/>
- </fileset>
+ </fileset>
</war>
- <!--jacc-allStarRolePolicyProvider.jar -->
- <jar destfile="${build.lib}/jacc-allStarRolePolicyProvider.jar">
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/jacc/test/allstarrole/*olicy*"/>
- <include name="org/jboss/test/jacc/test/policy/*olicy*"/>
- </fileset>
- </jar>
+ <!--jacc-allStarRolePolicyProvider.jar -->
+ <jar destfile="${build.lib}/jacc-allStarRolePolicyProvider.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/jacc/test/allstarrole/*olicy*" />
+ <include name="org/jboss/test/jacc/test/policy/*olicy*" />
+ </fileset>
+ </jar>
- <!-- JBAS-6710: Password Masking in XML -->
- <jar destfile="${build.lib}/passwordbean.jar">
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/security/beans/TestPasswordInjectedBean.class"/>
- </fileset>
- </jar>
+ <!-- JBAS-6710: Password Masking in XML -->
+ <jar destfile="${build.lib}/passwordbean.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/beans/TestPasswordInjectedBean.class"/>
+ </fileset>
+ </jar>
+ <!-- RMI over HTTPS test -->
+ <jar destfile="${build.lib}/rmi-over-https-test.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/security/rmi/ejb3/*.class"/>
+ </fileset>
+ </jar>
+
</target>
-</project>
+</project>
\ No newline at end of file
Modified: branches/JBPAPP_5_1/testsuite/imports/sections/tm.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/sections/tm.xml 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/imports/sections/tm.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -35,6 +35,13 @@
<include name="org/jboss/test/tm/interfaces/**"/>
</fileset>
</jar>
+
+ <!-- build txtimeoutanottest.jar -->
+ <jar destfile="${build.lib}/txtimeoutannottest.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/tm/ejb/TxTimeoutAnnot*"/>
+ </fileset>
+ </jar>
<!-- build bmtcleanuptest.jar -->
<jar destfile="${build.lib}/bmtcleanuptest.jar">
Modified: branches/JBPAPP_5_1/testsuite/imports/server-config.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/server-config.xml 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/imports/server-config.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -231,6 +231,28 @@
<sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
<sysproperty key="xb.builder.useUnorderedSequence" value="true" />
</server>
+ <server name="cc" config="cc" host="${node0}">
+ <jvmarg value="${jpda.cmdline}" />
+ <jvmarg value="-Xms128m" />
+ <jvmarg value="-Xmx1024m" />
+ <jvmarg value="-XX:MaxPermSize=512m" />
+ <jvmarg value="-XX:-UseGCOverheadLimit" />
+ <jvmarg value="-Djboss.home.dir=${jboss.dist}" />
+ <jvmarg value="-Djboss.server.home.dir=${jboss.dist}${/}server${/}cc" />
+ <jvmarg value="-Djboss.test.deploy.dir=${jboss.test.deploy.dir}" />
+ <!-- <jvmarg value="-Djava.security.manager"/> -->
+ <!-- <jvmarg value="-Djava.security.policy==${build.resources}/securitymgr/server.policy"/> -->
+ <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.handlers.stub"/>
+ <!-- <jvmarg value="-Djava.security.debug=failure"/> -->
+
+ <!-- Replace for security manager debug verbose info
+ <jvmarg value="-Djava.security.debug=access,failure,policy"/>
+ -->
+
+ <sysproperty key="java.net.preferIPv4Stack" value="true" />
+ <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+ <sysproperty key="xb.builder.useUnorderedSequence" value="true" />
+ </server>
<server name="scoped-aop-jdk50" host="${node0}">
<jvmarg value="-Xms128m" />
<jvmarg value="-Xmx512m" />
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleSession.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleSession.java 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleSession.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -32,6 +32,7 @@
*/
public interface SimpleSession
{
+
/**
* <p>
* This is a method available for regular users and administrators. Implementations must annotate either the class or
@@ -74,4 +75,13 @@
*/
public Principal invokeUnavailableMethod();
-}
+ /**
+ * <p>
+ * This method checks the roles specified as parameters to verify {@code @DeclareRoles} annotation.
+ * </p>
+ *
+ * @return result of the check
+ */
+ public boolean checkDeclaredRoles(String ... rolesToCheck);
+
+}
\ No newline at end of file
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatefulSessionBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatefulSessionBean.java 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatefulSessionBean.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -24,6 +24,7 @@
import java.security.Principal;
import javax.annotation.Resource;
+import javax.annotation.security.DeclareRoles;
import javax.annotation.security.DenyAll;
import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
@@ -40,6 +41,7 @@
*/
@Stateful
@Remote(SimpleSession.class)
+ at DeclareRoles({"RegularUser", "Administrator"})
@RolesAllowed({"RegularUser", "Administrator"})
public class SimpleStatefulSessionBean implements SimpleSession
{
@@ -94,4 +96,32 @@
return this.context.getCallerPrincipal();
}
+
+
+ /* (non-Javadoc)
+ * @see org.jboss.test.security.ejb3.SimpleSession#checkDeclaredRoles(java.lang.String[])
+ */
+ @Override
+ public boolean checkDeclaredRoles(String ... rolesToCheck) {
+
+ if (rolesToCheck.length < 1)
+ throw new IllegalArgumentException("Empty roles. You have to supply at least one role.");
+
+ boolean result = true;
+
+ for (String roleName : rolesToCheck) {
+
+ boolean negative = roleName.substring(0,1).equals("!");
+ if (negative)
+ roleName = roleName.substring(1);
+
+ result = result && (!negative == this.context.isCallerInRole(roleName));
+ }
+
+ return result;
+
+ }
+
+
+
}
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatelessSessionBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatelessSessionBean.java 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/ejb3/SimpleStatelessSessionBean.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -24,6 +24,7 @@
import java.security.Principal;
import javax.annotation.Resource;
+import javax.annotation.security.DeclareRoles;
import javax.annotation.security.DenyAll;
import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
@@ -40,6 +41,7 @@
*/
@Stateless
@Remote(SimpleSession.class)
+ at DeclareRoles({"RegularUser", "Administrator"})
@RolesAllowed({"RegularUser", "Administrator"})
public class SimpleStatelessSessionBean implements SimpleSession
{
@@ -93,4 +95,29 @@
// this method should never be called - it overrides the class roles to deny access to all roles.
return this.context.getCallerPrincipal();
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.test.security.ejb3.SimpleSession#checkDeclaredRoles(java.lang.String[])
+ */
+ @Override
+ public boolean checkDeclaredRoles(String ... rolesToCheck) {
+
+ if (rolesToCheck.length < 1)
+ throw new IllegalArgumentException("Empty roles. You have to supply at least one role.");
+
+ boolean result = true;
+
+ for (String roleName : rolesToCheck) {
+
+ boolean negative = roleName.substring(0,1).equals("!");
+ if (negative)
+ roleName = roleName.substring(1);
+
+ result = result && (!negative == this.context.isCallerInRole(roleName));
+ }
+
+ return result;
+
+ }
+
}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorld.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorld.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorld.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,42 @@
+/*
+ * 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.security.rmi.ejb3;
+
+/**
+ * @author <a href="mailto:pskopekf at redhat.com">Peter Skopek</a>
+ * @version $Revision: $
+ */
+public interface HelloWorld {
+
+ /**
+ * Return always true
+ * @return
+ */
+ public boolean sayHello();
+ /**
+ * Echo the param back to caller.
+ * @param stringToEcho
+ * @return
+ */
+ public String echo(String stringToEcho);
+
+}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorldBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorldBean.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/ejb3/HelloWorldBean.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,59 @@
+/*
+ * 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.security.rmi.ejb3;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+import org.jboss.ejb3.annotation.RemoteBindings;
+
+/**
+ *
+ * @author <a href="mailto:pskopekf at redhat.com">Peter Skopek</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(HelloWorld.class)
+ at RemoteBindings({
+ @RemoteBinding(clientBindUrl = "https://localhost:8443/servlet-invoker/SSLServerInvokerServlet",jndiBinding="HelloWorldBean/remote-https"),
+ @RemoteBinding(clientBindUrl = "http://localhost:8080/servlet-invoker/SSLServerInvokerServlet",jndiBinding="HelloWorldBean/remote-http")
+})
+public class HelloWorldBean implements HelloWorld {
+
+ /* (non-Javadoc)
+ * @see org.jboss.test.security.rmi.ejb3.HelloWorld#echo(java.lang.String)
+ */
+ @Override
+ public String echo(String stringToEcho) {
+ return stringToEcho;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.test.security.rmi.ejb3.HelloWorld#sayHello()
+ */
+ @Override
+ public boolean sayHello() {
+ return true;
+ }
+
+}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/RMIOverHttpsTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/RMIOverHttpsTestCase.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/RMIOverHttpsTestCase.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,116 @@
+/*
+ * 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.security.rmi.test;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.JBossTestSetup;
+import org.jboss.test.security.rmi.ejb3.HelloWorld;
+
+/**
+ * Tests whether server can handle RMI over HTTPS calls to EJB3.
+ *
+ * How to the keys, certificates and keystores were generated:
+ * <code>
+ * keytool -genkey -alias ejb-ssl -keystore ssl.keystore -storepass secsec -keypass secsec -dname "CN=localhost,OU=QE,O=redhat.com,L=Brno,C=CZ"
+ * keytool -export -alias ejb-ssl -file ssl.cer -keystore ssl.keystore -storepass secsec
+ * keytool -import -alias ejb-ssl -file ssl.cer -keystore ssl.truststore -storepass 123456
+ * </code>
+ *
+ * @author <a href="mailto:pskopekf at redhat.com">Peter Skopek</a>
+ * @version $Revision: $
+ */
+public class RMIOverHttpsTestCase extends JBossTestCase {
+
+ public RMIOverHttpsTestCase(String name) {
+ super(name);
+ }
+
+
+ public static Test suite() throws Exception
+ {
+ TestSuite suite = new TestSuite();
+
+ suite.addTest(new JBossTestSetup(new TestSuite(RMIOverHttpsTestCase.class))
+ {
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ deploy ("rmi-over-https-test.jar");
+ }
+ protected void tearDown() throws Exception
+ {
+ undeploy ("rmi-over-https-test.jar");
+ }
+ });
+
+ return suite;
+ }
+
+ /**
+ * Test objective: To test calls to EJB3 over HTTPS transport protocol.
+ * Expected resutl: Test has to pass without any exception. Which means all calls return expected values.
+ *
+ * @throws Exception
+ */
+ public void testCallingEJB3OverHttps() throws Exception {
+
+ Properties env = new Properties();
+ env.put("java.naming.factory.initial", "org.jboss.naming.HttpNamingContextFactory");
+ env.put("java.naming.provider.url", "https://" + getServerHost() + ":8443/invoker/JNDIFactory");
+ env.put("java.naming.factory.url.pkgs", "org.jboss.naming");
+ Context ctx = new InitialContext(env);
+ HelloWorld hwb = (HelloWorld) ctx.lookup("HelloWorldBean/remote-https");
+
+ assertTrue("Call to sayHello should return true", hwb.sayHello());
+ assertEquals("echo_value", hwb.echo("echo_value"));
+
+ }
+
+ /**
+ * Test objective: To test calls to EJB3 over HTTP transport protocol.
+ * Expected resutl: Test has to pass without any exception. Which means all calls return expected values.
+ *
+ * @throws Exception
+ */
+ public void testCallingEJB3OverHttp() throws Exception {
+
+ Properties env = new Properties();
+ env.put("java.naming.factory.initial", "org.jboss.naming.HttpNamingContextFactory");
+ env.put("java.naming.provider.url", "http://" + getServerHost() + ":8080/invoker/JNDIFactory");
+ env.put("java.naming.factory.url.pkgs", "org.jboss.naming");
+ Context ctx = new InitialContext(env);
+ HelloWorld hwb = (HelloWorld) ctx.lookup("HelloWorldBean/remote-http");
+
+ assertTrue("Call to sayHello should return true", hwb.sayHello());
+ assertEquals("echo_value", hwb.echo("echo_value"));
+
+ }
+
+}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/TestClient.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/TestClient.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/rmi/test/TestClient.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,85 @@
+/*
+ * 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.security.rmi.test;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.test.security.rmi.ejb3.HelloWorld;
+
+/**
+ * @author <a href="mailto:pskopekf at redhat.com">Peter Skopek</a>
+ * @version $Revision: $
+ */
+public class TestClient {
+
+ public static TestClient client;
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ client = new TestClient();
+ client.run();
+
+ }
+
+ public void run() {
+
+ System.out.println("Running test client");
+
+
+ Properties env = new Properties();
+ env.put("java.naming.factory.initial", "org.jboss.naming.HttpNamingContextFactory");
+ env.put("java.naming.provider.url", "https://localhost:8443/invoker/JNDIFactory");
+ env.put("java.naming.factory.url.pkgs", "org.jboss.naming");
+
+ /*
+ Properties env = new Properties();
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
+ env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
+ env.setProperty("j2ee.clientName", TestClient.class.getName());
+ */
+ try {
+ Context ctx = new InitialContext(env);
+
+ System.out.println("context:"+ctx.getClass().getName());
+
+ HelloWorld hwb = (HelloWorld) ctx.lookup("HelloWorldBean/remote-https");
+
+ System.out.println("Echo: " + hwb.echo("opakuj"));
+
+
+ } catch (NamingException e) {
+ System.out.println(e);
+ }
+
+ }
+
+}
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/test/EJB3SpecUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/test/EJB3SpecUnitTestCase.java 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/test/EJB3SpecUnitTestCase.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -202,6 +202,51 @@
this.logout();
}
+
+ public void testDeclareRoles() throws Exception
+ {
+ // login with a user that has the RegularUser role.
+ this.login("UserA", "PassA".toCharArray());
+
+ // get a reference to the remote protected stateless session bean.
+ Object obj = getInitialContext().lookup("SimpleStatelessSessionBean/remote");
+ SimpleSession session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);
+
+ if (!session.checkDeclaredRoles("Administrator", "RegularUser", "!negativeRole"))
+ fail("UserA has to have both roles (Administrator, RegularUser, !negativeRole) for SimpleStatelessSessionBean");
+
+ // repeat the tests, this time calling a stateful session bean.
+ obj = getInitialContext().lookup("SimpleStatefulSessionBean/remote");
+ session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);
+
+ if (!session.checkDeclaredRoles("Administrator", "RegularUser", "!negativeRole"))
+ fail("UserA has to have both roles (Administrator, RegularUser, !negativeRole) for SimpleStatelessSessionBean");
+
+ this.logout();
+
+ // login with a user that has the RegularUser role.
+ this.login("UserB", "PassB".toCharArray());
+
+ // get a reference to the remote protected stateless session bean.
+ obj = getInitialContext().lookup("SimpleStatelessSessionBean/remote");
+ session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);
+
+ if (!session.checkDeclaredRoles("!Administrator", "RegularUser", "!negativeRole"))
+ fail("UserB has to have both roles (!Administrator, RegularUser, !negativeRole) for SimpleStatelessSessionBean");
+
+ // repeat the tests, this time calling a stateful session bean.
+ obj = getInitialContext().lookup("SimpleStatefulSessionBean/remote");
+ session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);
+
+ if (!session.checkDeclaredRoles("!Administrator", "RegularUser", "!negativeRole"))
+ fail("UserB has to have both roles (Administrator, RegularUser, !negativeRole) for SimpleStatelessSessionBean");
+
+ this.logout();
+
+
+ }
+
+
/**
* <p>
* Validates the results received when calling all methods on a {@code SimpleSession}.
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnot.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnot.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnot.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,37 @@
+/*
+ * 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.tm.ejb;
+
+import java.rmi.RemoteException;
+
+/**
+ * Transaction Timeout Annotated Test Interface
+ *
+ * @author pskopek at redhat.com
+ * @version $Revision$
+ */
+public interface TxTimeoutAnnot
+{
+ void testDefaultTimeout() throws RemoteException;
+ void testOverriddenTimeoutExpires() throws RemoteException;
+ void testOverriddenTimeoutDoesNotExpire() throws RemoteException;
+}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnotBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnotBean.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutAnnotBean.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.tm.ejb;
+
+import javax.ejb.EJBException;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.naming.InitialContext;
+import javax.transaction.Status;
+import javax.transaction.TransactionManager;
+
+import org.jboss.tm.TxUtils;
+import org.jboss.ejb3.annotation.TransactionTimeout;
+import org.jboss.logging.Logger;
+
+/**
+ * Transaction Timeout Annotated Test Bean
+ *
+ * @author pskopek at redhat.com
+ * @version $Revision$
+ */
+ at Stateless
+ at Remote(TxTimeoutAnnot.class)
+public class TxTimeoutAnnotBean
+{
+
+ public Logger log = Logger.getLogger(getClass());
+
+
+ /**
+ * This method's timeout should be 5 secs
+ */
+ @TransactionAttribute(TransactionAttributeType.REQUIRED)
+ @TransactionTimeout(5)
+ public void testOverriddenTimeoutExpires()
+ {
+ sleep(7000, false);
+ int status = getTxStatus();
+ log.info("testOverriddenTimeoutExpires: " + TxUtils.getStatusAsString(status));
+ if (TxUtils.isRollback(status) == false)
+ {
+ // give it a second chance
+ sleep(2000, false);
+ status = getTxStatus();
+ log.info("testOverriddenTimeoutExpires: " + TxUtils.getStatusAsString(status));
+
+ if (TxUtils.isRollback(status) == false)
+ throw new EJBException("Should be marked rolled back: " + TxUtils.getStatusAsString(status));
+ }
+ }
+
+ /**
+ * This method's timeout should be 20 secs
+ */
+ @TransactionAttribute(TransactionAttributeType.REQUIRED)
+ @TransactionTimeout(20)
+ public void testOverriddenTimeoutDoesNotExpire()
+ {
+ sleep(12000, true);
+ int status = getTxStatus();
+ if (status != Status.STATUS_ACTIVE)
+ throw new EJBException("Should be active: " + TxUtils.getStatusAsString(status));
+ }
+
+ private int getTxStatus()
+ {
+ try
+ {
+ InitialContext ctx = new InitialContext();
+ TransactionManager tm = (TransactionManager) ctx.lookup("java:/TransactionManager");
+ return tm.getStatus();
+ }
+ catch (Exception e)
+ {
+ throw new EJBException(e);
+ }
+ }
+
+
+ private void sleep(int timeout, boolean throwEJBException)
+ {
+ try
+ {
+ Thread.sleep(timeout);
+ }
+ catch (Exception e)
+ {
+ if (throwEJBException)
+ throw new EJBException(e);
+ else
+ log.debug("Ignored", e);
+ }
+ }
+}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/test/TxTimeoutAnnotUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/test/TxTimeoutAnnotUnitTestCase.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/tm/test/TxTimeoutAnnotUnitTestCase.java 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.tm.test;
+
+import javax.ejb.EJBTransactionRolledbackException;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.JBossTestSetup;
+import org.jboss.test.tm.ejb.TxTimeoutAnnot;
+
+/**
+ * Tests for transaction timeout annotation
+ * EJB3 version of TxTimeoutUnitTestCase
+ *
+ * JBAS-4011, the arjuna transaction manager does not allow the
+ * setting of the global default tx timeout after the tx manager
+ * is started, so we won't test the default timeout setting (300secs).
+ *
+ * @author adrian at jboss.com
+ * @author pskopek at redhat.com
+ * @version $Revision: 60502 $
+ */
+public class TxTimeoutAnnotUnitTestCase
+ extends JBossTestCase
+{
+
+ public TxTimeoutAnnotUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Tests whether @TransactionTimeout expires system sends EJBTransactionRolledbackException
+ * and transaction is rolled back.
+ *
+ * @throws Exception
+ */
+ public void testOverriddenTimeoutExpires() throws Exception
+ {
+ TxTimeoutAnnot bean = getBean();
+ try
+ {
+ bean.testOverriddenTimeoutExpires();
+ fail("Expected TransactionRolledbackException");
+ }
+ catch (EJBTransactionRolledbackException expected)
+ {
+ log.debug("Expected exception caught - Hurray!");
+ }
+ }
+
+ /**
+ * Tests whether @TransactionTimeout expires greater that wait time of doesn't make transaction to roll back
+ * or stay in different status that STATUS_ACTIVE.
+ *
+ *
+ * @throws Exception
+ */
+ public void testOverriddenTimeoutDoesNotExpire() throws Exception
+ {
+ TxTimeoutAnnot bean = getBean();
+ bean.testOverriddenTimeoutDoesNotExpire();
+ log.debug("Done: testOverriddenTimeoutDoesNotExpire");
+ }
+
+ public static Test suite() throws Exception
+ {
+ return new JBossTestSetup(getDeploySetup(TxTimeoutAnnotUnitTestCase.class, "txtimeoutannottest.jar"));
+ }
+
+ private TxTimeoutAnnot getBean() throws Exception
+ {
+ return (TxTimeoutAnnot) getInitialContext().lookup("TxTimeoutAnnotBean/remote");
+ }
+}
Added: branches/JBPAPP_5_1/testsuite/src/resources/cc/cc.policy
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/cc/cc.policy (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/cc/cc.policy 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,109 @@
+// The Java2 security policy for EAP5 with signed jars
+// Install with -Djava.security.policy==server.policy.cert
+// and -Djboss.home.dir=path_to_jboss_distribution
+
+//keystore "file:${java.home}/lib/security/cacerts";
+keystore "file:${jboss.home.dir}/cc.keystore";
+keystorePasswordURL "file:${jboss.home.dir}/cc.password";
+
+// ***************************************
+// Trusted core Java code
+//***************************************
+grant codeBase "file:${java.home}/lib/ext/-" {
+ permission java.security.AllPermission;
+};
+grant codeBase "file:${java.home}/lib/*" {
+ permission java.security.AllPermission;
+};
+// For java.home pointing to the JDK jre directory
+grant codeBase "file:${java.home}/../lib/*" {
+ permission java.security.AllPermission;
+};
+
+
+// ***************************************
+// Trusted core JBoss code
+//***************************************
+grant codeBase "file:${jboss.home.dir}/bin/run.jar" {
+ permission java.security.AllPermission;
+};
+
+grant signedBy "jboss" {
+ permission java.security.AllPermission;
+};
+
+//grant codeBase "file:${jboss.server.home.dir}/deploy/quartz-ra.rar/-" {
+// permission java.security.AllPermission;
+//};
+
+grant codeBase "file:${jboss.server.home.dir}/deploy/uuid-key-generator.sar/-" {
+ permission javax.management.MBeanTrustPermission "register";
+ permission javax.management.MBeanPermission "*", "getAttribute";
+ permission org.jboss.naming.JndiPermission "<<ALL BINDINGS>>","lookup,rebind,unbind";
+ permission java.lang.RuntimePermission "getClassLoader";
+};
+
+grant codeBase "file:${jboss.server.home.dir}/deploy/http-invoker.sar/invoker.war/-" {
+ permission javax.management.MBeanPermission "*", "addNotificationListener,getAttribute";
+ permission javax.management.MBeanServerPermission "findMBeanServer";
+ permission java.lang.RuntimePermission "getClassLoader";
+ permission org.jboss.naming.JndiPermission "<<ALL BINDINGS>>","lookup,rebind,unbind";
+};
+
+grant codeBase "file:${jboss.server.home.dir}/deploy/httpha-invoker.sar/invoker.war/-" {
+ permission javax.management.MBeanPermission "*", "addNotificationListener,getAttribute";
+ permission javax.management.MBeanServerPermission "findMBeanServer";
+ permission java.lang.RuntimePermission "getClassLoader";
+ permission org.jboss.naming.JndiPermission "<<ALL BINDINGS>>","lookup,rebind,unbind";
+};
+
+grant codeBase "file:${jboss.server.home.dir}/deploy/admin-console.war/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${jboss.server.home.dir}/deploy/jmx-console.war/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${jboss.server.home.dir}/work/jboss-web/localhost/admin-console/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${jboss.server.home.dir}/work/jboss-web/localhost/invoker/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${jboss.server.home.dir}/work/jboss-web/localhost/jbossws/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${jboss.server.home.dir}/work/jboss-web/localhost/juddi/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${jboss.server.home.dir}/work/jboss-web/localhost/web-console/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${jboss.server.home.dir}/tmp/embjopr/-" {
+ permission javax.management.MBeanServerPermission "findMBeanServer";
+ permission javax.management.MBeanPermission "*", "queryNames";
+ permission java.lang.RuntimePermission "getClassLoader";
+ permission java.lang.RuntimePermission "accessDeclaredMembers";
+};
+
+
+//****************************************************************
+// Default block of permissions
+// Minimal permissions are allowed to everyone else
+//****************************************************************
+grant {
+ permission java.io.FilePermission "${jboss.server.home.dir}/tmp/-", "read";
+ permission java.io.FilePermission "${jboss.home.dir}/common/lib/quartz.jar/org/quartz/quartz.properties", "read";
+ permission java.io.FilePermission "${jboss.home.dir}/common/lib/quartz.jar", "read";
+ permission java.io.FilePermission "${jboss.home.dir}/common/lib", "read";
+ permission org.jboss.naming.JndiPermission "<<ALL BINDINGS>>","lookup";
+ permission java.io.FilePermission "quartz.properties", "read";
+ permission java.util.PropertyPermission "*", "read";
+ permission java.lang.RuntimePermission "queuePrintJob";
+};
Modified: branches/JBPAPP_5_1/testsuite/src/resources/cc/testCaseMapping_2.0.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/cc/testCaseMapping_2.0.xml 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/src/resources/cc/testCaseMapping_2.0.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -92,6 +92,10 @@
<TSFI>tsfi.ann.RunAs</TSFI>
<TSFI>tsfi.ann.RolesAllowed</TSFI>
</test>
+ <test name="testDeclareRoles">
+ <desc></desc>
+ <TSFI>tsfi.ann.DeclareRoles</TSFI>
+ </test>
</testCase>
<testCase name="org.jboss.test.ejb3.jbpapp2473.unit.RunAsUnitTestCase">
<desc></desc>
@@ -1291,6 +1295,21 @@
<TSFI>tsfi.jmx.rmi</TSFI>
</test>
</testCase>
+ <testCase name="org.jboss.test.security.rmi.test.RMIOverHttpsTestCase">
+ <desc>Tests whether server can handle RMI over HTTPS calls to EJB3.</desc>
+ <test name="testCallingEJB3OverHttps">
+ <desc>Test objective: To test calls to EJB3 over HTTPS transport protocol.
+ Expected resutl: Test has to pass without any exception. Which means all calls return expected values.
+ </desc>
+ <TSFI>tsfi.port.rmi.https</TSFI>
+ </test>
+ <test name="testCallingEJB3OverHttp">
+ <desc>Test objective: To test calls to EJB3 over HTTP transport protocol.
+ Expected resutl: Test has to pass without any exception. Which means all calls return expected values.
+ </desc>
+ <TSFI>tsfi.port.rmi.http</TSFI>
+ </test>
+ </testCase>
<testCase name="org.jboss.test.naming.test.SecurityUnitTestCase">
<desc>Tests of secured access to the JNDI naming service. This testsuite will be run with the standard security resources available via the classpath.</desc>
<test name="testSecureHttpInvokerFailure">
@@ -1361,6 +1380,17 @@
<TSFI>tsfi.jms</TSFI>
</test>
</testCase>
+ <testCase name="org.jboss.test.tm.test.TxTimeoutAnnotUnitTestCase">
+ <desc>Tests for transaction timeout annotation EJB3 version of TxTimeoutUnitTestCase.</desc>
+ <test name="testOverriddenTimeoutExpires">
+ <desc>Tests if @TransactionTimeout expires system sends EJBTransactionRolledbackException and transaction is rolled back.</desc>
+ <TSFI>tsfi.ann.TransactionTimeout</TSFI>
+ </test>
+ <test name="testOverriddenTimeoutDoesNotExpire">
+ <desc>Tests whether @TransactionTimeout expires greater that wait time of doesn't make transaction to roll back or stay in different status that STATUS_ACTIVE.</desc>
+ <TSFI>tsfi.ann.TransactionTimeout</TSFI>
+ </test>
+ </testCase>
<testCase name="org.jboss.test.invokers.test.MultiInvokersUnitTestCase">
<desc>Test use of multiple invokers per container</desc>
<test name="testMultiInvokers">
Modified: branches/JBPAPP_5_1/testsuite/src/resources/cc/tsfi_master_data.txt
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/cc/tsfi_master_data.txt 2010-09-21 15:46:54 UTC (rev 108260)
+++ branches/JBPAPP_5_1/testsuite/src/resources/cc/tsfi_master_data.txt 2010-09-21 15:52:45 UTC (rev 108261)
@@ -8,7 +8,7 @@
% Certificates
tsfi.keystore.usercerts
% Ports TCP/UDP
-tsfi.port.rmi.https ?? -- new test needed see: org.jboss.test.naming.test.SecurityUnitTestCase
+tsfi.port.rmi.https
tsfi.port.rmi.http
tsfi.port.rmi.jrmp
tsfi.port.rmi.pooled
@@ -18,7 +18,7 @@
tsfi.port.web.https
% Annotations
tsfi.ann.Clustered ?? - new test case needed
-tsfi.ann.DeclareRoles - new test needed
+tsfi.ann.DeclareRoles
tsfi.ann.DenyAll
tsfi.ann.Exclude
tsfi.ann.Permissions
@@ -28,7 +28,7 @@
tsfi.ann.RunAsPrincipal
tsfi.ann.TransactionAttribute
tsfi.ann.TransactionManagement
-tsfi.ann.TransactionTimeout ?? new test needed - try to copy/clone from EJB3 testsuite
+tsfi.ann.TransactionTimeout
tsfi.ann.Unchecked
tsfi.ann.WebContext
% API
Added: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/ejb3-connectors-jboss-beans.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/ejb3-connectors-jboss-beans.xml (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/ejb3-connectors-jboss-beans.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ EJB3 Connectors
+
+-->
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <!-- We don't want the AOPDependencyBuilder -->
+ <annotation>@org.jboss.aop.microcontainer.annotations.DisableAOP</annotation>
+
+ <!--
+
+ JBoss Remoting Connector
+
+ Note: Bean Name "org.jboss.ejb3.RemotingConnector" is used
+ as a lookup value; alter only after checking java references
+ to this key.
+
+ -->
+ <bean name="org.jboss.ejb3.RemotingConnector"
+ class="org.jboss.remoting.transport.Connector">
+
+ <property name="invokerLocator">
+
+ <value-factory bean="ServiceBindingManager"
+ method="getStringBinding">
+ <parameter>
+ jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3
+ </parameter>
+ <parameter>
+ <null />
+ </parameter>
+ <parameter>socket://${jboss.bind.address}:${port}?timeout=300000</parameter>
+ <parameter>
+ <null />
+ </parameter>
+ <parameter>3873</parameter>
+ </value-factory>
+
+ </property>
+ <property name="serverConfiguration">
+ <inject bean="ServerConfiguration" />
+ </property>
+ </bean>
+
+ <!-- Remoting Server Configuration -->
+ <bean name="ServerConfiguration"
+ class="org.jboss.remoting.ServerConfiguration">
+ <property name="invocationHandlers">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>AOP</key>
+ <value>
+ org.jboss.aspects.remoting.AOPRemotingInvocationHandler
+ </value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+
+ <bean name="EJB3SSLRemotingConnector" class="org.jboss.remoting.transport.Connector">
+ <property name="invokerLocator">sslsocket://${jboss.bind.address}:3843</property>
+ <property name="serverConfiguration">
+ <inject bean="ServerConfiguration" />
+ </property>
+ <property name="serverSocketFactory">
+ <inject bean="sslServerSocketFactory" />
+ </property>
+ </bean>
+
+ <bean name="sslServerSocketFactory" class="org.jboss.security.ssl.DomainServerSocketFactory">
+ <constructor>
+ <parameter><inject bean="EJB3SSLDomain"/></parameter>
+ </constructor>
+ </bean>
+
+
+ <bean name="EJB3SSLDomain" class="org.jboss.security.plugins.JaasSecurityDomain">
+ <constructor>
+ <parameter>EJB3SSLDomain</parameter>
+ </constructor>
+ <property name="keyStoreURL">file:${jboss.server.home.dir}/ssl.keystore</property>
+ <property name="keyStorePass">secsec</property>
+ <property name="keyStoreAlias">ejb-ssl</property>
+ <!-- <property name="keyPassword">secsec</property> -->
+ </bean>
+
+</deployment>
+
Added: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/jbossweb.sar/server.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/jbossweb.sar/server.xml (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/jbossweb.sar/server.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,168 @@
+<Server>
+
+ <!-- Optional listener which ensures correct init and shutdown of APR,
+ and provides information if it is not installed -->
+ <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
+ <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+ <Listener className="org.apache.catalina.core.JasperListener" />
+
+ <Service name="jboss.web">
+
+ <!-- A HTTP/1.1 Connector on port 8080 -->
+ <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
+ connectionTimeout="20000" redirectPort="8443" />
+
+ <!-- Add this option to the connector to avoid problems with
+ .NET clients that don't implement HTTP/1.1 correctly
+ restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"
+ -->
+
+ <!-- A AJP 1.3 Connector on port 8009 -->
+ <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"
+ redirectPort="8443" />
+
+ <!-- SSL/TLS Connector configuration using the admin devl guide keystore -->
+ <Connector protocol="HTTP/1.1" SSLEnabled="true"
+ port="8443" address="${jboss.bind.address}"
+ scheme="https" secure="true" clientAuth="false"
+ keystoreFile="${jboss.server.home.dir}/ssl.keystore"
+ keystorePass="secsec" sslProtocol = "TLS" />
+
+
+ <Engine name="jboss.web" defaultHost="localhost">
+
+ <!-- The JAAS based authentication and authorization realm implementation
+ that is compatible with the jboss 3.2.x realm implementation.
+ - certificatePrincipal : the class name of the
+ org.jboss.security.auth.certs.CertificatePrincipal impl
+ used for mapping X509[] cert chains to a Princpal.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ -->
+ <Realm className="org.jboss.web.tomcat.security.JBossWebRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
+ behavior of JBossSecurityMgrRealm, but overrides the authorization
+ checks to use JACC permissions with the current java.security.Policy
+ to determine authorized access.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ -->
+
+ <Host name="localhost">
+
+ <!-- Uncomment to enable request dumper. This Valve "logs interesting
+ contents from the specified Request (before processing) and the
+ corresponding Response (after processing). It is especially useful
+ in debugging problems related to headers and cookies."
+ -->
+ <!--
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+ -->
+
+ <!-- Access logger -->
+ <!--
+ <Valve className="org.apache.catalina.valves.AccessLogValve"
+ prefix="localhost_access_log." suffix=".log"
+ pattern="common" directory="${jboss.server.log.dir}"
+ resolveHosts="false" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host. Does not provide SSO across a cluster.
+
+ If this valve is used, do not use the JBoss ClusteredSingleSignOn
+ valve shown below.
+
+ A new configuration attribute is available beginning with
+ release 4.0.4:
+
+ cookieDomain configures the domain to which the SSO cookie
+ will be scoped (i.e. the set of hosts to
+ which the cookie will be presented). By default
+ the cookie is scoped to "/", meaning the host
+ that presented it. Set cookieDomain to a
+ wider domain (e.g. "xyz.com") to allow an SSO
+ to span more than one hostname.
+ -->
+ <!--
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host AND to all other hosts in the cluster.
+
+ If this valve is used, do not use the standard Tomcat SingleSignOn
+ valve shown above.
+
+ Valve uses a JBossCache instance to support SSO credential
+ caching and replication across the cluster. The JBossCache
+ instance must be configured separately. See the
+ "jboss-web-clusteredsso-beans.xml" file in the
+ server/all/deploy directory for cache configuration details.
+
+ Besides the attributes supported by the standard Tomcat
+ SingleSignOn valve (see the Tomcat docs), this version also
+ supports the following attributes:
+
+ cookieDomain see non-clustered valve above
+
+ cacheConfig Name of the CacheManager service configuration
+ to use for the clustered SSO cache. See
+ deploy/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml
+ Default is "clustered-sso".
+
+ treeCacheName Deprecated. Use "cacheConfig".
+ JMX ObjectName of the JBoss Cache MBean used to
+ support credential caching and replication across
+ the cluster. Only used if no cache can be located
+ from the CacheManager service using the "cacheConfig"
+ attribute (or its default value). If not set, the
+ default is "jboss.cache:service=TomcatClusteringCache"
+
+ maxEmptyLife The maximum number of seconds an SSO with no
+ active sessions will be usable by a request
+
+ processExpiresInterval The minimum number of seconds between
+ efforts by the valve to find and invalidate
+ SSO's that have exceeded their 'maxEmptyLife'.
+ Does not imply effort will be spent on such
+ cleanup every 'processExpiresInterval'.
+ -->
+ <!--
+ <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
+ -->
+
+ <!-- Check for unclosed connections and transaction terminated checks
+ in servlets/jsps.
+
+ Important: The dependency on the CachedConnectionManager
+ in META-INF/jboss-service.xml must be uncommented, too
+ -->
+
+ <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
+ cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
+ transactionManagerObjectName="jboss:service=TransactionManager" />
+
+ </Host>
+ </Engine>
+
+ </Service>
+
+</Server>
Added: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker-service.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker-service.xml (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker-service.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<server>
+
+
+ <mbean code="org.jboss.remoting.transport.Connector" name="jboss.remoting:service=connector,transport=servlet"
+ display-name="Servlet transport Connector">
+ <attribute name="InvokerLocator">servlet://${jboss.bind.address}:8080/servlet-invoker/ServerInvokerServlet</attribute>
+ <attribute name="Configuration">
+ <handlers>
+ <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+ </handlers>
+ </attribute>
+ </mbean>
+
+
+ <mbean code="org.jboss.remoting.transport.Connector" name="jboss.remoting:service=connector,transport=sslservlet"
+ display-name="Servlet transport Connector">
+ <attribute name="InvokerLocator">sslservlet://${jboss.bind.address}:8443/servlet-invoker/SSLServerInvokerServlet</attribute>
+ <attribute name="Configuration">
+ <handlers>
+ <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+ </handlers>
+ </attribute>
+ </mbean>
+
+
+
+</server>
Added: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker.war/WEB-INF/web.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker.war/WEB-INF/web.xml (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/deploy/servlet-invoker.war/WEB-INF/web.xml 2010-09-21 15:52:45 UTC (rev 108261)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+
+
+<web-app>
+ <servlet>
+ <servlet-name>ServerInvokerServlet</servlet-name>
+ <description>The ServerInvokerServlet receives requests via HTTP
+ protocol from within a web container and passes it onto the
+ ServletServerInvoker for processing.
+ </description>
+ <servlet-class>org.jboss.remoting.transport.servlet.web.ServerInvokerServlet</servlet-class>
+
+ <init-param>
+ <param-name>locatorUrl</param-name>
+ <param-value>servlet://${jboss.bind.address}:8080/servlet-invoker/ServerInvokerServlet</param-value>
+ <description>The servlet server invoker</description>
+ </init-param>
+
+
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+
+ <servlet>
+ <servlet-name>SSLServerInvokerServlet</servlet-name>
+ <description>The ServerInvokerServlet receives requests via HTTPS
+ protocol from within a web container and passes it onto the
+ ServletServerInvoker for processing.
+ </description>
+ <servlet-class>org.jboss.remoting.transport.servlet.web.ServerInvokerServlet</servlet-class>
+
+ <init-param>
+ <param-name>locatorUrl</param-name>
+ <param-value>sslservlet://${jboss.bind.address}:8443/servlet-invoker/SSLServerInvokerServlet</param-value>
+ <description>The servlet server invoker</description>
+ </init-param>
+
+
+ <load-on-startup>2</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ServerInvokerServlet</servlet-name>
+ <url-pattern>/ServerInvokerServlet/*</url-pattern>
+ </servlet-mapping>
+
+
+ <servlet-mapping>
+ <servlet-name>SSLServerInvokerServlet</servlet-name>
+ <url-pattern>/SSLServerInvokerServlet/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
+
+
Added: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.cer
===================================================================
(Binary files differ)
Property changes on: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.cer
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.keystore
===================================================================
(Binary files differ)
Property changes on: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.truststore
===================================================================
(Binary files differ)
Property changes on: branches/JBPAPP_5_1/testsuite/src/resources/test-configs/cc/ssl.truststore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the jboss-cvs-commits
mailing list