cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r764147 - /cxf/branches/2.1.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
Date Sat, 11 Apr 2009 01:56:08 GMT
Author: dkulp
Date: Sat Apr 11 01:56:08 2009
New Revision: 764147

URL: http://svn.apache.org/viewvc?rev=764147&view=rev
Log:
revert the test changes for now so the tests pass.

Modified:
    cxf/branches/2.1.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java

Modified: cxf/branches/2.1.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java?rev=764147&r1=764146&r2=764147&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
Sat Apr 11 01:56:08 2009
@@ -79,8 +79,7 @@
     private Map<String, List<String>> mimeHeaders;
     private Exchange correlatedExchange;
     private boolean expectRelatesTo;
-    private String nonReplyRelationship;
-    
+
     @Before
     public void setUp() {
         codec = new MAPCodec();
@@ -97,7 +96,6 @@
         mimeHeaders = null;
         correlatedExchange = null;
         ContextUtils.setJAXBContext(null);
-        nonReplyRelationship = null;
     }
 
     @Test
@@ -245,25 +243,6 @@
         verifyMessage(message, true, false, false);
     }
 
-    @Test
-    public void testRequestorInboundNonReply() throws Exception {
-        nonReplyRelationship = "wsat:correlatedOneway";
-        SoapMessage message = setUpMessage(true, false);
-        codec.handleMessage(message);
-        control.verify();
-        verifyMessage(message, true, false, true);
-    }
-
-    @Test
-    public void testRequestorInboundNonNativeNonReply() throws Exception {
-        nonReplyRelationship = "wsat:correlatedOneway";
-        String uri = VersionTransformer.Names200408.WSA_NAMESPACE_NAME;
-        SoapMessage message = setUpMessage(true, false, false, false, uri);
-        codec.handleMessage(message);
-        control.verify();
-        verifyMessage(message, true, false, false);
-    }
-
     private SoapMessage setUpMessage(boolean requestor, boolean outbound) throws Exception
{
         return setUpMessage(requestor, outbound, false);
     }
@@ -444,12 +423,8 @@
             relatesTo = new RelatesToType();
             relatesTo.setValue(correlationID);
             maps.setRelatesTo(relatesTo);
-            if (nonReplyRelationship == null) {
-                correlatedExchange = new ExchangeImpl();
-                codec.uncorrelatedExchanges.put(correlationID, correlatedExchange);
-            } else {
-                relatesTo.setRelationshipType(nonReplyRelationship);
-            }
+            correlatedExchange = new ExchangeImpl();
+            codec.uncorrelatedExchanges.put(correlationID, correlatedExchange);
         }
         AttributedURIType action = ContextUtils.getAttributedURI("http://foo/bar/SEI/opRequest");
         maps.setAction(action);
@@ -639,27 +614,18 @@
                                boolean exposedAsNative) {
         if (requestor) {
             if (outbound) {
-                String id = expectedValues[1] instanceof AttributedURIType
-                    ? ((AttributedURIType)expectedValues[1]).getValue()
-                    : expectedValues[0] instanceof AttributedURI 
-                      ? ((AttributedURI)expectedValues[1]).getValue() 
-                      : ((org.apache.cxf.ws.addressing.v200403.AttributedURI)expectedValues[1]).getValue();
-                assertSame("unexpected correlated exchange", 
-                           codec.uncorrelatedExchanges.get(id), 
-                           message.getExchange());
+                String id = expectedValues[0] instanceof AttributedURIType
+                    ? ((AttributedURIType)expectedValues[0]).getValue()
+                    : expectedValues[0] instanceof AttributedURI ? ((AttributedURI)expectedValues[0])
+                        .getValue() : ((org.apache.cxf.ws.addressing.v200403.AttributedURI)expectedValues[0])
+                        .getValue();
+                // assertTrue("expected correlationID : " + id + " in map: " +
+                // codec.uncorrelatedExchanges,
+                // codec.uncorrelatedExchanges.containsKey(id));
+                assertSame("unexpected correlated exchange", codec.uncorrelatedExchanges.get(id),
message
+                    .getExchange());
             } else {
-                if (isReply(exposedAsNative)) {
-                    assertSame("unexpected correlated exchange", 
-                               correlatedExchange, 
-                               message.getExchange());
-                } else {
-                    assertNotSame("unexpected correlated exchange",
-                                  correlatedExchange,
-                                  message.getExchange());
-                }
-                assertEquals("expected empty uncorrelated exchange cache",
-                             0, 
-                             codec.uncorrelatedExchanges.size());
+                assertSame("unexpected correlated exchange", correlatedExchange, message.getExchange());
             }
         }
         if (outbound) {
@@ -672,24 +638,6 @@
             }
         }
         assertTrue("unexpected MAPs", verifyMAPs(message.get(getMAPProperty(requestor, outbound))));
-    }
-
-    private boolean isReply(boolean exposedAsNative) {
-        boolean isReply = false;
-        if (exposedAsNative) {
-            isReply = 
-                Names.WSA_RELATIONSHIP_REPLY.equals(
-                    ((RelatesToType)expectedValues[4]).getRelationshipType());
-        } else {
-            QName relationship = 
-                expectedValues[4] instanceof Relationship
-                ? ((Relationship)expectedValues[4]).getRelationshipType()
-                : ((org.apache.cxf.ws.addressing.v200403.Relationship)expectedValues[4])
-                      .getRelationshipType();
-            isReply = relationship == null 
-                      || Names.WSA_REPLY_NAME.equalsIgnoreCase(relationship.getLocalPart());
-        } 
 
-        return isReply;
     }
 }



Mime
View raw message