Author: ron.sigal(a)jboss.com
Date: 2009-05-10 02:38:41 -0400 (Sun, 10 May 2009)
New Revision: 5179
Added:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ResponseCodeTestClient.java
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ServletInvokerNoExceptionTestClient.java
Log:
JBREM-1079: New unit tests.
Added:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ResponseCodeTestClient.java
===================================================================
---
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ResponseCodeTestClient.java
(rev 0)
+++
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ResponseCodeTestClient.java 2009-05-10
06:38:41 UTC (rev 5179)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.remoting.transport.servlet;
+
+import org.jboss.test.remoting.transport.http.headers.ResponseCodeTestCase;
+
+/**
+ * Unit test for JBREM-728.
+ *
+ * @author <a href="mailto:ron.sigal@jboss.com">Ron Sigal</a>
+ * <p>
+ * Copyright (c) November 24, 2007
+ * </p>
+ *
+ */
+public class ResponseCodeTestClient extends ResponseCodeTestCase
+{
+ protected String getTransport()
+ {
+ return "servlet";
+ }
+
+ protected void setupServer()
+ {
+ locatorURI =
"servlet://localhost:8080/servlet-invoker/ServerInvokerServlet";
+ port = 8080;
+ }
+
+ protected void shutdownServer()
+ {
+ }
+}
Added:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ServletInvokerNoExceptionTestClient.java
===================================================================
---
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ServletInvokerNoExceptionTestClient.java
(rev 0)
+++
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/ServletInvokerNoExceptionTestClient.java 2009-05-10
06:38:41 UTC (rev 5179)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.remoting.transport.servlet;
+
+import org.jboss.test.remoting.transport.web.WebInvokerTestClient;
+
+/**
+ * This test is identical to ServletInvokerTestClient except that it, in the case
+ * when an exception is thrown on the server, ServletServerInvoker is explicitly
instructed
+ * not to return the actual exception.
+ *
+ * See JBREM-813 and JBREM-675.
+ *
+ * @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
+ * @author <a href="mailto:ron.sigal@jboss.com">Ron Sigal</a>
+ */
+public class ServletInvokerNoExceptionTestClient extends WebInvokerTestClient
+{
+ public static final Integer ERROR_RESPONSE_CODE = new Integer(500);
+
+ public String getLocatorURI()
+ {
+ return "servlet://localhost:8080/servlet-invoker/ServerInvokerServlet";
+ }
+
+ public static void main(String[] args)
+ {
+ ServletInvokerNoExceptionTestClient client = new
ServletInvokerNoExceptionTestClient();
+ try
+ {
+ client.testPostInvocation();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+}
\ No newline at end of file