[jboss-svn-commits] JBossWS SVN: r1060 - branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Sep 26 12:04:48 EDT 2006


Author: heiko.braun at jboss.com
Date: 2006-09-26 12:04:46 -0400 (Tue, 26 Sep 2006)
New Revision: 1060

Modified:
   branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/MTOMTestCase.java
   branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/TestService.java
Log:
additional MTOM interop tests

Modified: branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/MTOMTestCase.java
===================================================================
--- branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/MTOMTestCase.java	2006-09-26 15:36:35 UTC (rev 1059)
+++ branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/MTOMTestCase.java	2006-09-26 16:04:46 UTC (rev 1060)
@@ -88,9 +88,74 @@
     */
    public void testScenario_3_1() throws Exception
    {
-      String s = "Hello World";
+      String s = "testScenario_3_1";
       EchoBinaryAsStringResponse response = port.echoBinaryAsString( new EchoBinaryAsString(s.getBytes()));
       assertNotNull(response);
       assertEquals(response.getEchoBinaryAsStringResult(), s);
    }
+
+   /**
+    * Scenario #3.2. Echo String As Binary.
+    *
+    * Request has a string that returned back as XOPed binary blob.
+    */
+   public void testScenario_3_2() throws Exception
+   {
+      String s = "testScenario_3_2";
+      EchoStringAsBinaryResponse response = port.echoStringAsBinary( new EchoStringAsBinary(s));
+      assertNotNull(response);
+      assertEquals( new String(response.getEchoStringAsBinaryResult(), "UTF-8"), s);
+   }
+
+   /**
+    * Scenario #3.3. Echo Array of Binaries As Array Of Strings
+    *
+    * Request contains array, each array element has type base64Binary, XOPed,
+    * contains unique utf-8 encoded strings.
+    * Response has array of strings matching those in the request
+    */
+   public void testScenario_3_3() throws Exception
+   {
+      System.out.println("FIXME: testScenario_3_3");
+   }
+
+   /**
+    * Scenario #3.4. Echo Binary Field As String
+    *
+    * Echo complex type with a binary field Request contains a structure,
+    * one of the fields is binary, contains a string UTF-8 encoded.
+    * Response contains a string from the binary field from the request.
+    */
+   public void testScenario_3_4() throws Exception
+   {
+      String s = "testScenario_3_4";
+      EchoBinaryFieldAsStringResponse response = port.echoBinaryFieldAsString(
+          new EchoBinaryFieldAsString(
+              new MtomTestStruct(s.getBytes(), "Hello World")
+          )
+      );
+      assertNotNull(response);
+      assertEquals( response.getEchoBinaryFieldAsStringResult(), s);
+   }
+
+   /**
+    * Scenario #3.5. Echo Binary Passed In a Header As String
+    *
+    * Request message contains a Header element of the type base64Binary,
+    * content is XOPed. Binary contains utf-8 encoded text.
+    * Response message contains the passed string in the body
+    */
+   public void testScenario_3_5() throws Exception
+   {
+      System.out.println("FIXME: testScenario_3_5");
+   }
+
+   /**
+    * Scenario #3.6. Composition with UTF-16 encoding
+    *
+    */
+   public void testScenario_3_6() throws Exception
+   {
+      System.out.println("FIXME: testScenario_3_6");
+   }
 }

Modified: branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/TestService.java
===================================================================
--- branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/TestService.java	2006-09-26 15:36:35 UTC (rev 1059)
+++ branches/hbraun/jbossws-1.0/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/TestService.java	2006-09-26 16:04:46 UTC (rev 1060)
@@ -48,18 +48,21 @@
    }
 
    public EchoStringAsBinaryResponse echoStringAsBinary(EchoStringAsBinary parameters) throws RemoteException {
-      return null;
+      return new EchoStringAsBinaryResponse(parameters.getS().getBytes());
    }
 
-   public EchoBinaryArrayAsStringArrayResponse echoBinaryArrayAsStringArray(EchoBinaryArrayAsStringArray parameters) throws RemoteException {
-      return null;
+   public EchoBinaryArrayAsStringArrayResponse echoBinaryArrayAsStringArray(EchoBinaryArrayAsStringArray parameters)
+       throws RemoteException {
+      throw new RemoteException("Not implemented");
    }
 
    public EchoBinaryFieldAsStringResponse echoBinaryFieldAsString(EchoBinaryFieldAsString parameters) throws RemoteException {
-      return null;
+      return new EchoBinaryFieldAsStringResponse(
+          new String(parameters.getS().getArray())
+      );
    }
 
    public OutputMessageContract echoBinaryHeaderAsString(InputMessageContract parameters) throws RemoteException {
-      return null;
+      throw new RemoteException("Not implemented");
    }
 }




More information about the jboss-svn-commits mailing list