[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/servlet ...
Tom Elrod
tom.elrod at jboss.com
Sat Jul 15 00:40:13 EDT 2006
User: telrod
Date: 06/07/15 00:40:13
Modified: src/tests/org/jboss/test/remoting/transport/servlet
ServletInvokerTestClient.java
Added: src/tests/org/jboss/test/remoting/transport/servlet
readme.txt
remoting-servlet-server-invoker-service.xml
Log:
JBREM-543 & JBREM-542 & JBREM-539 - fixed servlet invoker and added sslservlet invoker.
Revision Changes Path
1.4 +18 -3 JBossRemoting/src/tests/org/jboss/test/remoting/transport/servlet/ServletInvokerTestClient.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServletInvokerTestClient.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/transport/servlet/ServletInvokerTestClient.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ServletInvokerTestClient.java 30 Dec 2005 05:26:49 -0000 1.3
+++ ServletInvokerTestClient.java 15 Jul 2006 04:40:13 -0000 1.4
@@ -22,18 +22,33 @@
package org.jboss.test.remoting.transport.servlet;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+import org.jboss.test.remoting.transport.web.WebInvocationHandler;
import org.jboss.test.remoting.transport.web.WebInvokerTestClient;
+import java.util.Map;
+
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
*/
public class ServletInvokerTestClient extends WebInvokerTestClient
{
+ public static final Integer ERROR_RESPONSE_CODE = new Integer(500);
public String getLocatorURI()
{
- //return "servlet://localhost:8080/servlet-invoker/ServerInvokerServlet";
- return "http://localhost:8080/servlet-invoker/ServerInvokerServlet";
+ return "servlet://localhost:8080/servlet-invoker/ServerInvokerServlet";
+ //return "http://localhost:8080/servlet-invoker/ServerInvokerServlet";
+ }
+
+ protected void makeExceptionInvocation(Client remotingClient, Map metadata) throws Throwable
+ {
+ Object response = remotingClient.invoke(WebInvocationHandler.THROW_EXCEPTION_PARAM, metadata);
+ Integer responseCode = (Integer) metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
+ assertEquals("Metadata value for " + HTTPMetadataConstants.RESPONSE_CODE + " should be " + ERROR_RESPONSE_CODE +
+ " and was " + responseCode, ERROR_RESPONSE_CODE, responseCode);
+
}
public static void main(String[] args)
@@ -43,7 +58,7 @@
{
client.testPostInvocation();
}
- catch(Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
1.1 date: 2006/07/15 04:40:13; author: telrod; state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/transport/servlet/readme.txt
Index: readme.txt
===================================================================
The servlet (and sslservlet) transport tests require a web container. Currently, these tests have to be run
manually (JBREM-139 has been created to automate this). Until then, here are the instructions for running
the tests manually.
servlet
1. Get JBossAS and copy remoting's servlet-invoker.war (from distro or build) to the deploy directory.
2. Copy the WEB-INF/web.xml under this directory into the that of the servlet-invoker.war/WEB-INF directory.
3. Copy remoting-servlet-invoker-service.xml to deploy directory.
4. Copy jboss-remoting-tests.jar to server lib directory
5. Start web container (JBossAS).
6. Run ServletInvokerTestClient.
sslservlet
1. Steps 1-4 above, except use the WEB-INF/web.xml and remoting-servlet-invoker-service.xml that is under the
servlet/ssl directory.
2. Copy the servlet/ssl/.keystore file to the server conf directory
3. Edit jbossweb-tomcat55.sar/server.xml to enable ssl connector. It should look like following:
<!-- SSL/TLS Connector configuration using the admin devl guide keystore -->
<Connector port="8443" address="${jboss.bind.address}"
maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
scheme="https" secure="true" clientAuth="false"
keystoreFile="${jboss.server.home.dir}/conf/.keystore"
keystorePass="unit-tests-server" sslProtocol = "TLS" />
4. Start web container (JBossAS).
5. Run SSLServletInvokerTestClient.
1.1 date: 2006/07/15 04:40:13; author: telrod; state: Exp;JBossRemoting/src/tests/org/jboss/test/remoting/transport/servlet/remoting-servlet-server-invoker-service.xml
Index: remoting-servlet-server-invoker-service.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.remoting.transport.Connector"
name="jboss.remoting:service=Connector,transport=SSLServlet"
display-name="Servlet transport Connector">
<attribute name="InvokerLocator">
servlet://localhost:8080/servlet-invoker/ServerInvokerServlet
</attribute>
<attribute name="Configuration">
<config>
<handlers>
<handler subsystem="test">org.jboss.test.remoting.transport.web.WebInvocationHandler</handler>
</handlers>
</config>
</attribute>
</mbean>
</server>
More information about the jboss-cvs-commits
mailing list