From jboss-remoting-commits at lists.jboss.org Tue Sep 1 21:04:21 2009 Content-Type: multipart/mixed; boundary="===============7115384532563456702==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r5426 - in remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet: contenttype and 1 other directory. Date: Tue, 01 Sep 2009 21:04:21 -0400 Message-ID: <200909020104.n8214LUT031393@svn01.web.mwc.hst.phx2.redhat.com> --===============7115384532563456702== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2009-09-01 21:04:21 -0400 (Tue, 01 Sep 2009) New Revision: 5426 Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servl= et/contenttype/ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servl= et/contenttype/ServletContentTypeTestClient.java remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servl= et/contenttype/TestInvocationHandlerCR.java remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servl= et/contenttype/TestInvocationHandlerLF.java remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servl= et/contenttype/TestInvocationHandlerOK.java remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servl= et/contenttype/remoting-servlet-service.xml Log: JBREM-1101: New unit tests. Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/s= ervlet/contenttype/ServletContentTypeTestClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/ServletContentTypeTestClient.java (= rev 0) +++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/ServletContentTypeTestClient.java 2009-09-02 01:04:21 UTC (= rev 5426) @@ -0,0 +1,60 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2009, 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.remoting.transport.servlet.contenttype; + +import org.apache.log4j.Logger; +import org.jboss.test.remoting.transport.http.contenttype.ContentTypeTestC= ase; + +/** + * Unit tests for JBREM-1101. + * = + * @author Ron Sigal + * @version = + *

+ * Copyright Sep 1, 2009 + *

+ */ +public class ServletContentTypeTestClient extends ContentTypeTestCase +{ + protected static Logger log =3D Logger.getLogger(ServletContentTypeTest= Client.class); + = + protected void setupServer(String contentType) throws Exception + { + locatorURI =3D "http://localhost:8080/servlet-invoker/ServerInvokerS= ervlet"; + = + if (CONTENT_TYPE.equals(contentType)) + { + locatorURI +=3D "/OK"; + } + if (INVALID_CONTENT_TYPE_CR.equals(contentType)) + { + locatorURI +=3D "/CR"; + } + else if (INVALID_CONTENT_TYPE_LF.equals(contentType)) + { + locatorURI +=3D "/LF"; + } + = + log.info("setting InvokerLocator to " + locatorURI); + } +} + Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/s= ervlet/contenttype/TestInvocationHandlerCR.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/TestInvocationHandlerCR.java (rev 0) +++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/TestInvocationHandlerCR.java 2009-09-02 01:04:21 UTC (rev 5= 426) @@ -0,0 +1,64 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2009, 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.remoting.transport.servlet.contenttype; + +import java.util.Map; + +import javax.management.MBeanServer; + +import org.jboss.remoting.InvocationRequest; +import org.jboss.remoting.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.InvokerCallbackHandler; + +/** + * For JBREM-1101 unit tests. + * = + * @author Ron Sigal + * @version $Rev$ + *

+ * Copyright Sep 1, 2009 + *

+ */ +public class TestInvocationHandlerCR implements ServerInvocationHandler +{ + public static String CONTENT_TYPE =3D "test/testContentType"; + public static String INVALID_CONTENT_TYPE_CR =3D "test/x" + '\r' + "y"; + public static String INVALID_CONTENT_TYPE_LF =3D "test/x" + '\n' + "y"; + public static String REQUEST =3D "testRequest"; + public static String RESPONSE =3D "testResponse"; + = + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Throwab= le + { + Map response =3D invocation.getReturnPayload(); + if (response !=3D null) + { + response.put("Content-Type", INVALID_CONTENT_TYPE_CR); + } + return RESPONSE; + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} +} Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/s= ervlet/contenttype/TestInvocationHandlerLF.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/TestInvocationHandlerLF.java (rev 0) +++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/TestInvocationHandlerLF.java 2009-09-02 01:04:21 UTC (rev 5= 426) @@ -0,0 +1,64 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2009, 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.remoting.transport.servlet.contenttype; + +import java.util.Map; + +import javax.management.MBeanServer; + +import org.jboss.remoting.InvocationRequest; +import org.jboss.remoting.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.InvokerCallbackHandler; + +/** + * For JBREM-1101 unit tests. + * = + * @author Ron Sigal + * @version $Rev$ + *

+ * Copyright Sep 1, 2009 + *

+ */ +public class TestInvocationHandlerLF implements ServerInvocationHandler +{ + public static String CONTENT_TYPE =3D "test/testContentType"; + public static String INVALID_CONTENT_TYPE_CR =3D "test/x" + '\r' + "y"; + public static String INVALID_CONTENT_TYPE_LF =3D "test/x" + '\n' + "y"; + public static String REQUEST =3D "testRequest"; + public static String RESPONSE =3D "testResponse"; + = + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Throwab= le + { + Map response =3D invocation.getReturnPayload(); + if (response !=3D null) + { + response.put("Content-Type", INVALID_CONTENT_TYPE_CR); + } + return RESPONSE; + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} +} Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/s= ervlet/contenttype/TestInvocationHandlerOK.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/TestInvocationHandlerOK.java (rev 0) +++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/TestInvocationHandlerOK.java 2009-09-02 01:04:21 UTC (rev 5= 426) @@ -0,0 +1,64 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2009, 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.remoting.transport.servlet.contenttype; + +import java.util.Map; + +import javax.management.MBeanServer; + +import org.jboss.remoting.InvocationRequest; +import org.jboss.remoting.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.InvokerCallbackHandler; + +/** + * For JBREM-1101 unit tests. + * = + * @author Ron Sigal + * @version $Rev$ + *

+ * Copyright Sep 1, 2009 + *

+ */ +public class TestInvocationHandlerOK implements ServerInvocationHandler +{ + public static String CONTENT_TYPE =3D "test/testContentType"; + public static String INVALID_CONTENT_TYPE_CR =3D "test/x" + '\r' + "y"; + public static String INVALID_CONTENT_TYPE_LF =3D "test/x" + '\n' + "y"; + public static String REQUEST =3D "testRequest"; + public static String RESPONSE =3D "testResponse"; + = + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Throwab= le + { + Map response =3D invocation.getReturnPayload(); + if (response !=3D null) + { + response.put("Content-Type", CONTENT_TYPE); + } + return RESPONSE; + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} +} Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/s= ervlet/contenttype/remoting-servlet-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/remoting-servlet-service.xml (rev 0) +++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/serv= let/contenttype/remoting-servlet-service.xml 2009-09-02 01:04:21 UTC (rev 5= 426) @@ -0,0 +1,55 @@ + + + + + + + + servlet://localhost:8080/servlet-invoker/ServerInvokerSer= vlet/?version=3DOK + + + + + + org.jboss.test.remoting= .transport.servlet.contenttype.TestInvocationHandlerOK + + + + + = + + + + servlet://localhost:8080/servlet-invoker/ServerInvokerSer= vlet/?version=3DCR + + + + + + org.jboss.test.remoting= .transport.servlet.contenttype.TestInvocationHandlerCR + + + + + + + + + servlet://localhost:8080/servlet-invoker/ServerInvokerSer= vlet/?version=3DLF + + + + + + org.jboss.test.remoting= .transport.servlet.contenttype.TestInvocationHandlerLF + + + + + --===============7115384532563456702==--