You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/02/10 11:26:07 UTC

svn commit: r376620 - in /incubator/servicemix/trunk/servicemix-http/src/test: java/org/apache/servicemix/http/HttpAddressingTest.java resources/org/apache/servicemix/http/bad-addressing-request.xml

Author: gnodet
Date: Fri Feb 10 02:26:05 2006
New Revision: 376620

URL: http://svn.apache.org/viewcvs?rev=376620&view=rev
Log:
Add addressing test with no wsa:To specified

Added:
    incubator/servicemix/trunk/servicemix-http/src/test/resources/org/apache/servicemix/http/bad-addressing-request.xml
Modified:
    incubator/servicemix/trunk/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java

Modified: incubator/servicemix/trunk/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java?rev=376620&r1=376619&r2=376620&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java (original)
+++ incubator/servicemix/trunk/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java Fri Feb 10 02:26:05 2006
@@ -34,7 +34,7 @@
 
     private static Log logger =  LogFactory.getLog(HttpAddressingTest.class);
 
-    public void test() throws Exception {
+    public void testOk() throws Exception {
         DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
         InOut me = client.createInOutExchange();
         me.setService(new QName("http://test", "MyProviderService"));
@@ -52,6 +52,18 @@
         } else {
             logger.info(new SourceTransformer().toString(me.getOutMessage().getContent()));
         }
+    }
+    
+    public void testBad() throws Exception {
+        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+        InOut me = client.createInOutExchange();
+        me.setService(new QName("http://test", "MyProviderService"));
+        InputStream fis = getClass().getResourceAsStream("bad-addressing-request.xml");
+        me.getInMessage().setContent(new StreamSource(fis));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.ERROR, me.getStatus());
+        assertNotNull(me.getFault());
+        logger.info(new SourceTransformer().toString(me.getFault().getContent()));
     }
     
     protected AbstractXmlApplicationContext createBeanFactory() {

Added: incubator/servicemix/trunk/servicemix-http/src/test/resources/org/apache/servicemix/http/bad-addressing-request.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-http/src/test/resources/org/apache/servicemix/http/bad-addressing-request.xml?rev=376620&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-http/src/test/resources/org/apache/servicemix/http/bad-addressing-request.xml (added)
+++ incubator/servicemix/trunk/servicemix-http/src/test/resources/org/apache/servicemix/http/bad-addressing-request.xml Fri Feb 10 02:26:05 2006
@@ -0,0 +1,11 @@
+<soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope'
+               xmlns:wsa='http://schemas.xmlsoap.org/ws/2003/03/addressing'
+               xmlns:test='http://test'>
+  <soap:Header>
+  </soap:Header>
+  <soap:Body>
+    <echo xmlns='http://test'>
+      <echoin0>world</echoin0>
+    </echo>
+  </soap:Body>
+</soap:Envelope>