You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ga...@apache.org on 2005/01/06 19:49:15 UTC

cvs commit: ws-axis/java/test/RPCDispatch Service.java TestSerializedRPC.java

gawor       2005/01/06 10:49:15

  Modified:    java/test/RPCDispatch Service.java TestSerializedRPC.java
  Log:
  added deserialization tests for wrapped primitive types
  
  Revision  Changes    Path
  1.15      +24 -0     ws-axis/java/test/RPCDispatch/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/RPCDispatch/Service.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Service.java	22 Apr 2003 17:40:06 -0000	1.14
  +++ Service.java	6 Jan 2005 18:49:15 -0000	1.15
  @@ -101,6 +101,30 @@
       }
   
       /**
  +     * Return the Boolean value passed in
  +     */
  +    public Boolean testBoolean(Boolean b)
  +    {
  +        return b;
  +    }
  +
  +    /**
  +     * Return the Float value passed in
  +     */
  +    public Float testFloat(Float b)
  +    {
  +        return b;
  +    }
  +
  +    /**
  +     * Return the Double value passed in
  +     */
  +    public Double testDouble(Double b)
  +    {
  +        return b;
  +    }
  +
  +    /**
        * Return the int passed in (this and the function above test overloaded
        * method dispatch)
        */
  
  
  
  1.43      +55 -0     ws-axis/java/test/RPCDispatch/TestSerializedRPC.java
  
  Index: TestSerializedRPC.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/RPCDispatch/TestSerializedRPC.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- TestSerializedRPC.java	8 Jul 2004 08:51:58 -0000	1.42
  +++ TestSerializedRPC.java	6 Jan 2005 18:49:15 -0000	1.43
  @@ -207,6 +207,61 @@
           assertEquals("Did not echo arg correctly.", arg, rpc("argAsDOM", arg, true));
       }
   
  +    public void testWrappedTypes() throws Exception
  +    {
  +        // boolean
  +        String arg = "<arg0>true</arg0>";
  +        Object expected = Boolean.TRUE;
  +        assertEquals("method test failed with a boolean",
  +                     expected,
  +                     rpc("testBoolean", arg, true));
  +
  +        // boolean
  +        arg = "<arg0>1</arg0>";
  +        expected = Boolean.TRUE;
  +        assertEquals("method test failed with a boolean",
  +                     expected,
  +                     rpc("testBoolean", arg, true));
  +
  +        // float
  +        arg = "<arg0>NaN</arg0>";
  +        expected = new Float(Float.NaN);
  +        assertEquals("method test failed with a float",
  +                     expected,
  +                     rpc("testFloat", arg, true));
  +
  +        arg = "<arg0>INF</arg0>";
  +        expected = new Float(Float.POSITIVE_INFINITY);
  +        assertEquals("method test failed with a float",
  +                     expected,
  +                     rpc("testFloat", arg, true));
  +
  +        arg = "<arg0>-INF</arg0>";
  +        expected = new Float(Float.NEGATIVE_INFINITY);
  +        assertEquals("method test failed with a float",
  +                     expected,
  +                     rpc("testFloat", arg, true));
  +
  +        // double
  +        arg = "<arg0>NaN</arg0>";
  +        expected = new Double(Double.NaN);
  +        assertEquals("method test failed with a double",
  +                     expected,
  +                     rpc("testDouble", arg, true));
  +
  +        arg = "<arg0>INF</arg0>";
  +        expected = new Double(Double.POSITIVE_INFINITY);
  +        assertEquals("method test failed with a double",
  +                     expected,
  +                     rpc("testDouble", arg, true));
  +
  +        arg = "<arg0>-INF</arg0>";
  +        expected = new Double(Double.NEGATIVE_INFINITY);
  +        assertEquals("method test failed with a double",
  +                     expected,
  +                     rpc("testDouble", arg, true));
  +    }
  +
       /**
        * Test overloaded method dispatch without the benefit of xsi:types
        */