Author: ropalka
Date: 2012-02-24 05:58:59 -0500 (Fri, 24 Feb 2012)
New Revision: 15724
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-ejb3.xml
Removed:
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-client.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/application-client.xml
Log:
[JBWS-3444] enabling another appclient test - removed testBasicSecuredSLSB() test which is
not valid anymore. All EJBs are secured in AS7
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml 2012-02-24
10:58:44 UTC (rev 15723)
+++
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml 2012-02-24
10:58:59 UTC (rev 15724)
@@ -417,23 +417,32 @@
<include name="webservices.xml"/>
<include name="ejb-jar.xml"/>
<include name="jboss.xml"/>
+ <include name="jboss-ejb3.xml"/>
<include name="jboss-webservices.xml"/>
<include name="wsdl/**"/>
</metainf>
</jar>
- <jar
jarfile="${tests.output.dir}/test-libs/jaxrpc-samples-secureejb-client.jar">
+ <jar
jarfile="${tests.output.dir}/test-libs/jaxrpc-samples-secureejb-appclient.jar">
<fileset dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxrpc/samples/secureejb/OrganizationService.class"/>
<include
name="org/jboss/test/ws/jaxrpc/samples/secureejb/OrganizationHome.class"/>
<include
name="org/jboss/test/ws/jaxrpc/samples/secureejb/OrganizationRemote.class"/>
</fileset>
+ <manifest>
+ <attribute name="main-class"
value="org.jboss.ws.common.appclient.AppclientKiller"/>
+ <attribute name="Dependencies"
value="org.jboss.ws.common"/>
+ </manifest>
<metainf
dir="${tests.output.dir}/test-resources/jaxrpc/samples/secureejb/META-INF">
<include name="application-client.xml"/>
- <include name="jboss-client.xml"/>
<include name="jaxrpc-mapping.xml"/>
<include name="wsdl/**"/>
</metainf>
</jar>
+ <jar
destfile="${tests.output.dir}/test-libs/jaxrpc-samples-secureejb-appclient.ear">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxrpc-samples-secureejb-appclient.jar"/>
+ </fileset>
+ </jar>
<!-- jaxrpc-samples-serviceref -->
<war
warfile="${tests.output.dir}/test-libs/jaxrpc-samples-serviceref.war"
webxml="${tests.output.dir}/test-resources/jaxrpc/samples/serviceref/WEB-INF/web.xml">
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java 2012-02-24
10:58:44 UTC (rev 15723)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/secureejb/SecureEJBTestCase.java 2012-02-24
10:58:59 UTC (rev 15724)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxrpc.samples.secureejb;
-import java.net.URL;
import java.rmi.RemoteException;
import javax.naming.InitialContext;
@@ -47,13 +46,13 @@
public static Test suite() throws Exception
{
- return new JBossWSTestSetup(SecureEJBTestCase.class,
"jaxrpc-samples-secureejb.jar, jaxrpc-samples-secureejb-client.jar");
+ return new JBossWSTestSetup(SecureEJBTestCase.class,
"jaxrpc-samples-secureejb.jar,
jaxrpc-samples-secureejb-appclient.ear#jaxrpc-samples-secureejb-appclient.jar",
true);
}
-
+
public void testRoleSecuredServiceAccess() throws Exception
{
- InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/RoleSecured");
+ InitialContext iniCtx = getAppclientInitialContext();
+ Service service = (Service)iniCtx.lookup("java:service/RoleSecured");
QName portName = new QName("http://org.jboss.ws/samples/secureejb",
"RoleSecuredPort");
OrganizationService port = (OrganizationService)service.getPort(portName,
OrganizationService.class);
@@ -75,22 +74,10 @@
assertEquals("The 'mafia' boss is currently out of office, please call
again.", info);
}
- /** Test that the remote access to this bean is unchecked
- */
- public void testBasicSecuredSLSB() throws Exception
- {
- InitialContext iniCtx = getInitialContext();
- OrganizationHome home =
(OrganizationHome)iniCtx.lookup("ejb:/jaxrpc-samples-secureejb//BasicSecuredSLSB!"
+ OrganizationHome.class.getName());
-
- OrganizationRemote bean = home.create();
- String info = bean.getContactInfo("mafia");
- assertEquals("The 'mafia' boss is currently out of office, please call
again.", info);
- }
-
public void testBasicSecuredServiceAccess() throws Exception
{
- InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/BasicSecured");
+ InitialContext iniCtx = getAppclientInitialContext();
+ Service service = (Service)iniCtx.lookup("java:service/BasicSecured");
QName portName = new QName("http://org.jboss.ws/samples/secureejb",
"BasicSecuredPort");
OrganizationService port = (OrganizationService)service.getPort(portName,
OrganizationService.class);
@@ -114,8 +101,8 @@
public void testConfidentialServiceAccess() throws Exception
{
- InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/ConfidentialSecured");
+ InitialContext iniCtx = getAppclientInitialContext();
+ Service service =
(Service)iniCtx.lookup("java:service/ConfidentialSecured");
QName portName = new QName("http://org.jboss.ws/samples/secureejb",
"ConfidentialPort");
OrganizationService port = (OrganizationService)service.getPort(portName,
OrganizationService.class);
@@ -135,10 +122,5 @@
{
// ignore expected exception
}
-
- // test confidential access
- //stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "https://" +
getServerHost() + ":8443/jaxrpc-samples-ejb/ConfidentialSecured");
- //String info = port.getContactInfo("mafia");
- //assertEquals("The 'mafia' boss is currently out of office, please
call again.", info);
}
}
Modified:
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/application-client.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/application-client.xml 2012-02-24
10:58:44 UTC (rev 15723)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/application-client.xml 2012-02-24
10:58:59 UTC (rev 15724)
@@ -8,19 +8,19 @@
<display-name>webservice client app</display-name>
<service-ref>
- <service-ref-name>service/BasicSecured</service-ref-name>
+
<service-ref-name>java:jboss/exported/service/BasicSecured</service-ref-name>
<service-interface>javax.xml.rpc.Service</service-interface>
<wsdl-file>META-INF/wsdl/OrganizationService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
</service-ref>
<service-ref>
- <service-ref-name>service/RoleSecured</service-ref-name>
+
<service-ref-name>java:jboss/exported/service/RoleSecured</service-ref-name>
<service-interface>javax.xml.rpc.Service</service-interface>
<wsdl-file>META-INF/wsdl/OrganizationService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
</service-ref>
<service-ref>
- <service-ref-name>service/ConfidentialSecured</service-ref-name>
+
<service-ref-name>java:jboss/exported/service/ConfidentialSecured</service-ref-name>
<service-interface>javax.xml.rpc.Service</service-interface>
<wsdl-file>META-INF/wsdl/OrganizationService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
Deleted:
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-client.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-client.xml 2012-02-24
10:58:44 UTC (rev 15723)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-client.xml 2012-02-24
10:58:59 UTC (rev 15724)
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
-
-<jboss-client>
- <jndi-name>jbossws-client</jndi-name>
-</jboss-client>
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-ejb3.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-ejb3.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/secureejb/META-INF/jboss-ejb3.xml 2012-02-24
10:58:59 UTC (rev 15724)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<jboss:jboss
+
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
+
xmlns:spec="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss_5_0.xsd
+
http://java.sun.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd"
+ version="3.1"
+ impl-version="2.0">
+
+ <spec:assembly-descriptor>
+ <security xmlns="urn:security">
+ <spec:ejb-name>RoleSecuredSLSB</spec:ejb-name>
+ <security-domain>JBossWS</security-domain>
+ </security>
+ <security xmlns="urn:security">
+ <spec:ejb-name>BasicSecuredSLSB</spec:ejb-name>
+ <security-domain>JBossWS</security-domain>
+ </security>
+ <security xmlns="urn:security">
+ <spec:ejb-name>ConfidentialSLSB</spec:ejb-name>
+ <security-domain>JBossWS</security-domain>
+ </security>
+ <spec:security-role>
+ <spec:role-name>friend</spec:role-name>
+ </spec:security-role>
+ </spec:assembly-descriptor>
+
+</jboss:jboss>