[jboss-remoting-commits] JBoss Remoting SVN: r6028 - remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Aug 4 21:48:11 EDT 2010


Author: ron.sigal at jboss.com
Date: 2010-08-04 21:48:10 -0400 (Wed, 04 Aug 2010)
New Revision: 6028

Modified:
   remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/ContentTypeTestClient.java
   remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestInvocationHandler.java
   remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestMarshaller.java
   remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestUnMarshaller.java
Log:
JBREM-1241: Added svn:eol-style subversion property.

Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/ContentTypeTestClient.java
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/ContentTypeTestClient.java	2010-08-05 01:46:03 UTC (rev 6027)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/ContentTypeTestClient.java	2010-08-05 01:48:10 UTC (rev 6028)
@@ -1,132 +1,132 @@
-/*
-* 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.marshal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-import org.jboss.test.remoting.transport.http.marshal.HttpContentTypeTestCase;
-
-
-/**
- * Unit tests for JBREM-1145.
- * 
- * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1 $
- * <p>
- * Copyright August 17, 2009
- * </p>
- */
-public class ContentTypeTestClient extends HttpContentTypeTestCase
-{
-   private static Logger log = Logger.getLogger(ContentTypeTestClient.class);
-   
-   
-   protected void validateOrdinaryInvocation(Client client) throws Throwable
-   {
-      // Local tests
-      log.info("TestMarshaller.marshallers.size(): " + TestMarshaller.marshallers.size());
-      log.info("TestMarshaller.unmarshallers.size(): " + TestUnMarshaller.unmarshallers.size());
-      assertEquals(2, TestMarshaller.marshallers.size());
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, ((TestMarshaller)TestMarshaller.marshallers.get(1)).type);
-      assertEquals(2, TestUnMarshaller.unmarshallers.size());
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, ((TestUnMarshaller)TestUnMarshaller.unmarshallers.get(1)).type);
-
-      // Remote tests
-      int serverMarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_MARSHALLERS)).intValue();
-      log.info("server side marshallers: " + serverMarshallerCount);
-      int serverUnmarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_UNMARSHALLERS)).intValue();
-      log.info("server side unmarshallers: " + serverUnmarshallerCount);
-      Map metadata = new HashMap();
-      metadata.put(TestInvocationHandler.N, Integer.toString(serverMarshallerCount - 1));
-      String type = (String) client.invoke(TestInvocationHandler.GET_NTH_MARSHALLER_TYPE, metadata);
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, type);
-      metadata.put(TestInvocationHandler.N, Integer.toString(serverUnmarshallerCount - 1));
-      type = (String) client.invoke(TestInvocationHandler.GET_NTH_UNMARSHALLER_TYPE, metadata);
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, type);
-      client.invoke(TestInvocationHandler.RESET);
-   }
-   
-   
-   protected void validateRawStringMessage(Client client) throws Throwable
-   {
-      // Local tests
-      log.info("TestMarshaller.marshallers.size(): " + TestMarshaller.marshallers.size());
-      log.info("TestMarshaller.unmarshallers.size(): " + TestUnMarshaller.unmarshallers.size());
-      assertEquals(2, TestMarshaller.marshallers.size());
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, ((TestMarshaller)TestMarshaller.marshallers.get(1)).type);
-      assertEquals(2, TestUnMarshaller.unmarshallers.size());
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, ((TestUnMarshaller)TestUnMarshaller.unmarshallers.get(1)).type);
-
-      // Remote tests
-      int serverMarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_MARSHALLERS)).intValue();
-      log.info("server side marshallers: " + serverMarshallerCount);
-      int serverUnmarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_UNMARSHALLERS)).intValue();
-      log.info("server side unmarshallers: " + serverUnmarshallerCount);
-      assertEquals(4, serverMarshallerCount);
-      assertEquals(6, serverUnmarshallerCount);
-      Map metadata = new HashMap();
-      metadata.put(TestInvocationHandler.N, "3");
-      String type = (String) client.invoke(TestInvocationHandler.GET_NTH_MARSHALLER_TYPE, metadata);
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, type);
-      metadata.put(TestInvocationHandler.N, "1");
-      type = (String) client.invoke(TestInvocationHandler.GET_NTH_UNMARSHALLER_TYPE, metadata);
-      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, type);
-      client.invoke(TestInvocationHandler.RESET);
-   }
-   
-   protected String getTransport()
-   {
-      return "servlet";
-   }
-   
-   protected void setupServer(boolean addUseRemotingContentType, boolean useRemotingContentType) throws Exception
-   {
-      String path = null;
-      String useRemotingContentTypeAttribute = null;
-      if (addUseRemotingContentType)
-      {
-         if (useRemotingContentType)
-         {
-            path = "servlet-invoker/ServerInvokerServlet/true";
-            useRemotingContentTypeAttribute = "&useRemotingContentType=true";         
-         }
-         else
-         {
-            path = "servlet-invoker/ServerInvokerServlet/false";
-            useRemotingContentTypeAttribute = "&useRemotingContentType=false";
-         }
-      }
-      else
-      {
-         path = "servlet-invoker/ServerInvokerServlet/default";
-         useRemotingContentTypeAttribute = "";
-      }
-      
-      String locatorURI = "servlet://127.0.0.1:8080/" + path + "/?datatype=test&marshaller=org.jboss.test.remoting.marshall.TestMarshaller&unmarshaller=org.jboss.test.remoting.marshall.TestUnmarshaller" + useRemotingContentTypeAttribute;
-      serverLocator = new InvokerLocator(locatorURI);
-   }
+/*
+* 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.marshal;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+import org.jboss.test.remoting.transport.http.marshal.HttpContentTypeTestCase;
+
+
+/**
+ * Unit tests for JBREM-1145.
+ * 
+ * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright August 17, 2009
+ * </p>
+ */
+public class ContentTypeTestClient extends HttpContentTypeTestCase
+{
+   private static Logger log = Logger.getLogger(ContentTypeTestClient.class);
+   
+   
+   protected void validateOrdinaryInvocation(Client client) throws Throwable
+   {
+      // Local tests
+      log.info("TestMarshaller.marshallers.size(): " + TestMarshaller.marshallers.size());
+      log.info("TestMarshaller.unmarshallers.size(): " + TestUnMarshaller.unmarshallers.size());
+      assertEquals(2, TestMarshaller.marshallers.size());
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, ((TestMarshaller)TestMarshaller.marshallers.get(1)).type);
+      assertEquals(2, TestUnMarshaller.unmarshallers.size());
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, ((TestUnMarshaller)TestUnMarshaller.unmarshallers.get(1)).type);
+
+      // Remote tests
+      int serverMarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_MARSHALLERS)).intValue();
+      log.info("server side marshallers: " + serverMarshallerCount);
+      int serverUnmarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_UNMARSHALLERS)).intValue();
+      log.info("server side unmarshallers: " + serverUnmarshallerCount);
+      Map metadata = new HashMap();
+      metadata.put(TestInvocationHandler.N, Integer.toString(serverMarshallerCount - 1));
+      String type = (String) client.invoke(TestInvocationHandler.GET_NTH_MARSHALLER_TYPE, metadata);
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, type);
+      metadata.put(TestInvocationHandler.N, Integer.toString(serverUnmarshallerCount - 1));
+      type = (String) client.invoke(TestInvocationHandler.GET_NTH_UNMARSHALLER_TYPE, metadata);
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING, type);
+      client.invoke(TestInvocationHandler.RESET);
+   }
+   
+   
+   protected void validateRawStringMessage(Client client) throws Throwable
+   {
+      // Local tests
+      log.info("TestMarshaller.marshallers.size(): " + TestMarshaller.marshallers.size());
+      log.info("TestMarshaller.unmarshallers.size(): " + TestUnMarshaller.unmarshallers.size());
+      assertEquals(2, TestMarshaller.marshallers.size());
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, ((TestMarshaller)TestMarshaller.marshallers.get(1)).type);
+      assertEquals(2, TestUnMarshaller.unmarshallers.size());
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, ((TestUnMarshaller)TestUnMarshaller.unmarshallers.get(1)).type);
+
+      // Remote tests
+      int serverMarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_MARSHALLERS)).intValue();
+      log.info("server side marshallers: " + serverMarshallerCount);
+      int serverUnmarshallerCount = ((Integer) client.invoke(TestInvocationHandler.GET_NUMBER_OF_UNMARSHALLERS)).intValue();
+      log.info("server side unmarshallers: " + serverUnmarshallerCount);
+      assertEquals(4, serverMarshallerCount);
+      assertEquals(6, serverUnmarshallerCount);
+      Map metadata = new HashMap();
+      metadata.put(TestInvocationHandler.N, "3");
+      String type = (String) client.invoke(TestInvocationHandler.GET_NTH_MARSHALLER_TYPE, metadata);
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, type);
+      metadata.put(TestInvocationHandler.N, "1");
+      type = (String) client.invoke(TestInvocationHandler.GET_NTH_UNMARSHALLER_TYPE, metadata);
+      assertEquals(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING, type);
+      client.invoke(TestInvocationHandler.RESET);
+   }
+   
+   protected String getTransport()
+   {
+      return "servlet";
+   }
+   
+   protected void setupServer(boolean addUseRemotingContentType, boolean useRemotingContentType) throws Exception
+   {
+      String path = null;
+      String useRemotingContentTypeAttribute = null;
+      if (addUseRemotingContentType)
+      {
+         if (useRemotingContentType)
+         {
+            path = "servlet-invoker/ServerInvokerServlet/true";
+            useRemotingContentTypeAttribute = "&useRemotingContentType=true";         
+         }
+         else
+         {
+            path = "servlet-invoker/ServerInvokerServlet/false";
+            useRemotingContentTypeAttribute = "&useRemotingContentType=false";
+         }
+      }
+      else
+      {
+         path = "servlet-invoker/ServerInvokerServlet/default";
+         useRemotingContentTypeAttribute = "";
+      }
+      
+      String locatorURI = "servlet://127.0.0.1:8080/" + path + "/?datatype=test&marshaller=org.jboss.test.remoting.marshall.TestMarshaller&unmarshaller=org.jboss.test.remoting.marshall.TestUnmarshaller" + useRemotingContentTypeAttribute;
+      serverLocator = new InvokerLocator(locatorURI);
+   }
 }
\ No newline at end of file


Property changes on: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/ContentTypeTestClient.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestInvocationHandler.java
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestInvocationHandler.java	2010-08-05 01:46:03 UTC (rev 6027)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestInvocationHandler.java	2010-08-05 01:48:10 UTC (rev 6028)
@@ -1,114 +1,114 @@
-/*
-* 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.marshal;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.ServerInvocationHandler;
-import org.jboss.remoting.ServerInvoker;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
-import org.jboss.remoting.marshal.MarshalFactory;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-
-
-/**
- * For JBREM-1145.
- * 
- * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1 $
- * <p>
- * Copyright August 17, 2009
- * </p>
- */
-public class TestInvocationHandler implements ServerInvocationHandler
-{
-   public static String GET_NUMBER_OF_MARSHALLERS = "getNumberOfMarshallers";
-   public static String GET_NUMBER_OF_UNMARSHALLERS = "getNumberOfUnmarshallers";  
-   public static String GET_NTH_MARSHALLER_TYPE = "getNthMarshallerType";
-   public static String GET_NTH_UNMARSHALLER_TYPE = "getNthUnarshallerType";
-   public static String RESET = "reset";
-   public static String N = "n";
-   
-   private static Logger log = Logger.getLogger(TestInvocationHandler.class);
-   
-   static
-   {
-      MarshalFactory.addMarshaller("test", new TestMarshaller(), new TestUnMarshaller());
-   }
-   
-   public void addListener(InvokerCallbackHandler callbackHandler) {}
-
-   public Object invoke(final InvocationRequest invocation) throws Throwable
-   {
-      String s = (String) invocation.getParameter();
-      log.info("command: " + s);
-      if (RESET.equals(s))
-      {
-         log.info("doing reset");
-         TestMarshaller.marshallers.clear();
-         TestUnMarshaller.unmarshallers.clear();
-         log.info("TestMarshaller.marshallers: " + TestMarshaller.marshallers);
-         log.info("TestUnMarshaller.unmarshallers: " + TestUnMarshaller.unmarshallers);
-      }
-      else if (GET_NUMBER_OF_MARSHALLERS.equals(s))
-      {
-         return new Integer(TestMarshaller.marshallers.size());
-      }
-      else if (GET_NUMBER_OF_UNMARSHALLERS.equals(s))
-      {
-         return new Integer(TestUnMarshaller.unmarshallers.size());
-      }
-      else if (GET_NTH_MARSHALLER_TYPE.equals(s))
-      {
-         int n = Integer.valueOf((String)invocation.getRequestPayload().get(N)).intValue();
-         return ((TestMarshaller)TestMarshaller.marshallers.get(n)).type;
-      }
-      else if (GET_NTH_UNMARSHALLER_TYPE.equals(s))
-      {
-         int n = Integer.valueOf((String)invocation.getRequestPayload().get(N)).intValue();
-         return ((TestUnMarshaller)TestUnMarshaller.unmarshallers.get(n)).type;
-      }
-      else if ("abc".equals(s))
-      {
-         Map responseMap = invocation.getReturnPayload();
-         if (responseMap == null)
-         {
-            responseMap = new HashMap();
-            invocation.setReturnPayload(responseMap);
-         }
-         responseMap.put(HTTPMetadataConstants.CONTENTTYPE, "text/html");
-         return invocation.getParameter();
-      }
-      
-      return invocation.getParameter();
-   }
-   
-   public void removeListener(InvokerCallbackHandler callbackHandler) {}
-   public void setMBeanServer(MBeanServer server) {}
-   public void setInvoker(ServerInvoker invoker) {}
+/*
+* 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.marshal;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.marshal.MarshalFactory;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+
+
+/**
+ * For JBREM-1145.
+ * 
+ * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright August 17, 2009
+ * </p>
+ */
+public class TestInvocationHandler implements ServerInvocationHandler
+{
+   public static String GET_NUMBER_OF_MARSHALLERS = "getNumberOfMarshallers";
+   public static String GET_NUMBER_OF_UNMARSHALLERS = "getNumberOfUnmarshallers";  
+   public static String GET_NTH_MARSHALLER_TYPE = "getNthMarshallerType";
+   public static String GET_NTH_UNMARSHALLER_TYPE = "getNthUnarshallerType";
+   public static String RESET = "reset";
+   public static String N = "n";
+   
+   private static Logger log = Logger.getLogger(TestInvocationHandler.class);
+   
+   static
+   {
+      MarshalFactory.addMarshaller("test", new TestMarshaller(), new TestUnMarshaller());
+   }
+   
+   public void addListener(InvokerCallbackHandler callbackHandler) {}
+
+   public Object invoke(final InvocationRequest invocation) throws Throwable
+   {
+      String s = (String) invocation.getParameter();
+      log.info("command: " + s);
+      if (RESET.equals(s))
+      {
+         log.info("doing reset");
+         TestMarshaller.marshallers.clear();
+         TestUnMarshaller.unmarshallers.clear();
+         log.info("TestMarshaller.marshallers: " + TestMarshaller.marshallers);
+         log.info("TestUnMarshaller.unmarshallers: " + TestUnMarshaller.unmarshallers);
+      }
+      else if (GET_NUMBER_OF_MARSHALLERS.equals(s))
+      {
+         return new Integer(TestMarshaller.marshallers.size());
+      }
+      else if (GET_NUMBER_OF_UNMARSHALLERS.equals(s))
+      {
+         return new Integer(TestUnMarshaller.unmarshallers.size());
+      }
+      else if (GET_NTH_MARSHALLER_TYPE.equals(s))
+      {
+         int n = Integer.valueOf((String)invocation.getRequestPayload().get(N)).intValue();
+         return ((TestMarshaller)TestMarshaller.marshallers.get(n)).type;
+      }
+      else if (GET_NTH_UNMARSHALLER_TYPE.equals(s))
+      {
+         int n = Integer.valueOf((String)invocation.getRequestPayload().get(N)).intValue();
+         return ((TestUnMarshaller)TestUnMarshaller.unmarshallers.get(n)).type;
+      }
+      else if ("abc".equals(s))
+      {
+         Map responseMap = invocation.getReturnPayload();
+         if (responseMap == null)
+         {
+            responseMap = new HashMap();
+            invocation.setReturnPayload(responseMap);
+         }
+         responseMap.put(HTTPMetadataConstants.CONTENTTYPE, "text/html");
+         return invocation.getParameter();
+      }
+      
+      return invocation.getParameter();
+   }
+   
+   public void removeListener(InvokerCallbackHandler callbackHandler) {}
+   public void setMBeanServer(MBeanServer server) {}
+   public void setInvoker(ServerInvoker invoker) {}
 }
\ No newline at end of file


Property changes on: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestInvocationHandler.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestMarshaller.java
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestMarshaller.java	2010-08-05 01:46:03 UTC (rev 6027)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestMarshaller.java	2010-08-05 01:48:10 UTC (rev 6028)
@@ -1,66 +1,66 @@
-/*
- * 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.marshal;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.http.HTTPMarshaller;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-
-
-/**
- * Part of unit tests for JBREM-1145
- * 
- * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Rev$
- * <p>
- * Copyright Aug 20, 2009
- * </p>
- */
-public class TestMarshaller extends HTTPMarshaller
-{
-   private static Logger log = Logger.getLogger(TestMarshaller.class);
-
-   public static ArrayList marshallers = new ArrayList();
-   private static final long serialVersionUID = -7528137229006015488L;
-   public String type;
-
-   public void write(Object dataObject, OutputStream output, int version) throws IOException
-   {
-      log.info(this + " writing " + dataObject);
-      type = (dataObject instanceof String) ? HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING : HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING;
-      super.write(dataObject, output, version);
-   }
-
-   public Marshaller cloneMarshaller() throws CloneNotSupportedException
-   {
-      TestMarshaller marshaller = new TestMarshaller();
-      marshallers.add(marshaller);
-      log.info("returning " + marshaller);
-      return marshaller;
-   }
-}
+/*
+ * 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.marshal;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.http.HTTPMarshaller;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+
+
+/**
+ * Part of unit tests for JBREM-1145
+ * 
+ * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
+ * @version $Rev$
+ * <p>
+ * Copyright Aug 20, 2009
+ * </p>
+ */
+public class TestMarshaller extends HTTPMarshaller
+{
+   private static Logger log = Logger.getLogger(TestMarshaller.class);
+
+   public static ArrayList marshallers = new ArrayList();
+   private static final long serialVersionUID = -7528137229006015488L;
+   public String type;
+
+   public void write(Object dataObject, OutputStream output, int version) throws IOException
+   {
+      log.info(this + " writing " + dataObject);
+      type = (dataObject instanceof String) ? HTTPMetadataConstants.REMOTING_CONTENT_TYPE_STRING : HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING;
+      super.write(dataObject, output, version);
+   }
+
+   public Marshaller cloneMarshaller() throws CloneNotSupportedException
+   {
+      TestMarshaller marshaller = new TestMarshaller();
+      marshallers.add(marshaller);
+      log.info("returning " + marshaller);
+      return marshaller;
+   }
+}


Property changes on: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestMarshaller.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestUnMarshaller.java
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestUnMarshaller.java	2010-08-05 01:46:03 UTC (rev 6027)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestUnMarshaller.java	2010-08-05 01:48:10 UTC (rev 6028)
@@ -1,93 +1,93 @@
-/*
- * 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.marshal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.marshal.http.HTTPUnMarshaller;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-
-
-/**
- * Part of unit tests for JBREM-1145.
- * 
- * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Rev$
- * <p>
- * Copyright Aug 20, 2009
- * </p>
- */
-public class TestUnMarshaller extends HTTPUnMarshaller
-{
-   public static ArrayList unmarshallers = new ArrayList();
-   private static final long serialVersionUID = -6422222480047910351L;
-   public String type;
-   
-   public Object read(InputStream inputStream, Map metadata, int version) throws IOException, ClassNotFoundException
-   {
-      Object o = metadata.get(HTTPMetadataConstants.REMOTING_CONTENT_TYPE);
-      if (o instanceof List)
-      {
-         type = (String) ((List) o).get(0);
-      }
-      else if (o instanceof String)
-      {
-         type = (String) o;
-      }
-      else 
-      {
-         o = metadata.get(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_LC);
-         log.info("remotingcontenttype: " + o);
-         if (o instanceof List)
-         {
-            type = (String) ((List) o).get(0);
-         }
-         else if (o instanceof String)
-         {
-            type = (String) o;
-         }
-         else 
-         {
-            log.warn(this + " unrecognized remotingContentType: " + o);
-         } 
-      }
-      
-      o = super.read(inputStream, metadata, version);
-      log.info(this + " read " + o);
-      return o;
-   }
-   
-   public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
-   {
-      TestUnMarshaller unmarshaller = new TestUnMarshaller();
-      unmarshallers.add(unmarshaller);
-      unmarshaller.setClassLoader(this.customClassLoader);
-      log.info("returning " + unmarshaller, new Exception());
-      return unmarshaller;
-   }
-}
+/*
+ * 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.marshal;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.remoting.marshal.http.HTTPUnMarshaller;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+
+
+/**
+ * Part of unit tests for JBREM-1145.
+ * 
+ * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
+ * @version $Rev$
+ * <p>
+ * Copyright Aug 20, 2009
+ * </p>
+ */
+public class TestUnMarshaller extends HTTPUnMarshaller
+{
+   public static ArrayList unmarshallers = new ArrayList();
+   private static final long serialVersionUID = -6422222480047910351L;
+   public String type;
+   
+   public Object read(InputStream inputStream, Map metadata, int version) throws IOException, ClassNotFoundException
+   {
+      Object o = metadata.get(HTTPMetadataConstants.REMOTING_CONTENT_TYPE);
+      if (o instanceof List)
+      {
+         type = (String) ((List) o).get(0);
+      }
+      else if (o instanceof String)
+      {
+         type = (String) o;
+      }
+      else 
+      {
+         o = metadata.get(HTTPMetadataConstants.REMOTING_CONTENT_TYPE_LC);
+         log.info("remotingcontenttype: " + o);
+         if (o instanceof List)
+         {
+            type = (String) ((List) o).get(0);
+         }
+         else if (o instanceof String)
+         {
+            type = (String) o;
+         }
+         else 
+         {
+            log.warn(this + " unrecognized remotingContentType: " + o);
+         } 
+      }
+      
+      o = super.read(inputStream, metadata, version);
+      log.info(this + " read " + o);
+      return o;
+   }
+   
+   public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
+   {
+      TestUnMarshaller unmarshaller = new TestUnMarshaller();
+      unmarshallers.add(unmarshaller);
+      unmarshaller.setClassLoader(this.customClassLoader);
+      log.info("returning " + unmarshaller, new Exception());
+      return unmarshaller;
+   }
+}


Property changes on: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/servlet/marshal/TestUnMarshaller.java
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the jboss-remoting-commits mailing list