[jbossws-commits] JBossWS SVN: r2303 - branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Feb 8 06:44:40 EST 2007


Author: thomas.diesler at jboss.com
Date: 2007-02-08 06:44:40 -0500 (Thu, 08 Feb 2007)
New Revision: 2303

Modified:
   branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
Log:
FIXME: [JBWS-1511] MessageFactory does not preserve comments


Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java	2007-02-08 09:40:29 UTC (rev 2302)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java	2007-02-08 11:44:40 UTC (rev 2303)
@@ -81,8 +81,7 @@
       assertEquals("urn:uddi-org:api_v2", soapBodyElement.getNamespaceURI());
    }
 
-   // http://jira.jboss.org/jira/browse/JBWS-745
-   // SAAJ:SOAPBodyElement.addNamespaceDeclaration should allow empty prefix
+   // [JBWS-745] SAAJ:SOAPBodyElement.addNamespaceDeclaration should allow empty prefix
    public void testAddNamespaceDeclaration() throws Exception
    {
       MessageFactory factory = new MessageFactoryImpl();
@@ -108,8 +107,7 @@
       assertEquals(expEnv, env);
    }
    
-   // http://jira.jboss.org/jira/browse/JBWS-1407
-   // Premature end of File exception on createMessage
+   // [JBWS-1407] Premature end of File exception on createMessage
    public void testPrematureEndOfFile() throws Exception
    {
       File envFile = new File("resources/common/soap/MessageFactory/jbws1407.xml");
@@ -150,4 +148,33 @@
       
       assertEquals(DOMUtils.parse(expMsg), DOMUtils.parse(wasMsg));
    }
-}
+   
+   // [JBWS-1511] MessageFactory does not preserve comments
+   public void testPreserveComments() throws Exception
+   {
+      String expMsg = 
+         "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
+         " <!-- header -->" +
+         " <soapenv:Header>" +
+         "  <!-- header element -->" +
+         "  <header>kermit</header>" +
+         " </soapenv:Header>" +
+         " <!-- body -->" +
+         " <soapenv:Body>" +
+         "  <!-- body element -->" +
+         "  <Hello>" +
+         "   <!-- element -->" +
+         "   <argument>kermit</argument>" +
+         "  </Hello>" +
+         " </soapenv:Body>" +
+         "</soapenv:Envelope>";
+      
+      MessageFactory factory = new MessageFactoryImpl();
+      ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
+      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+      SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();
+      
+      System.out.println("FIXME: [JBWS-1511] MessageFactory does not preserve comments");
+      //assertEquals(DOMUtils.parse(expMsg), (Element)env);
+   }
+}
\ No newline at end of file




More information about the jbossws-commits mailing list