Author: tli
Date: Tue Sep 12 18:59:10 2006
New Revision: 442791
URL: http://svn.apache.org/viewvc?view=rev&rev=442791
Log:
fix xml wrap test
Modified:
incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java
incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java
Modified:
incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java?view=diff&rev=442791&r1=442790&r2=442791
==============================================================================
---
incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java
(original)
+++
incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java
Tue Sep 12 18:59:10 2006
@@ -46,7 +46,7 @@
public class XMLMessageInInterceptor extends AbstractInDatabindingInterceptor {
private static final ResourceBundle BUNDLE =
BundleUtils.getBundle(WrappedInInterceptor.class);
-
+
public XMLMessageInInterceptor() {
super();
setPhase(Phase.UNMARSHAL);
@@ -88,6 +88,8 @@
} else {
// processing wrap here
message.getExchange().put(BindingOperationInfo.class,
boi);
+
boi.getOperationInfo().setProperty(WrappedInInterceptor.SINGLE_WRAPPED_PART,
+ Boolean.TRUE);
new WrappedInInterceptor().handleMessage(message);
break;
}
@@ -125,7 +127,7 @@
}
QName paramFirst = null;
if (mi.getMessageParts().size() > 0) {
- MessagePartInfo mpiFirst = mi.getMessagePartByIndex(0);
+ MessagePartInfo mpiFirst = mi.getMessagePartByIndex(0);
if (mpiFirst.isElement()) {
paramFirst = mpiFirst.getElementQName();
} else {
Modified:
incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java?view=diff&rev=442791&r1=442790&r2=442791
==============================================================================
---
incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java
(original)
+++
incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java
Tue Sep 12 18:59:10 2006
@@ -27,6 +27,7 @@
import org.apache.cxf.staxutils.StaxUtils;
import org.apache.hello_world_xml_http.bare.types.MyComplexStructType;
+import org.apache.hello_world_xml_http.wrapped.types.GreetMe;
public class XMLMessageInInterceptorTest extends TestBase {
@@ -46,46 +47,38 @@
String ns = "http://apache.org/hello_world_xml_http/bare";
prepareMessage("/message-bare-multi-param.xml");
common("/wsdl/hello_world_xml_bare.wsdl", new QName(ns, "XMLPort"),
- org.apache.hello_world_xml_http.bare.Greeter.class);
+ org.apache.hello_world_xml_http.bare.Greeter.class);
in.handleMessage(xmlMessage);
List list = xmlMessage.getContent(List.class);
assertNotNull(list);
assertEquals("expect 2 param", 2, list.size());
assertEquals("method input in2 is MyComplexStructType", true,
- list.get(0) instanceof MyComplexStructType);
- assertEquals("method input in1 is String tli", true,
((String)list.get(1)).indexOf("tli") >= 0);
+ list.get(0) instanceof MyComplexStructType);
+ assertEquals("method input in1 is String tli", true, ((String)
list.get(1)).indexOf("tli") >= 0);
}
public void testHandleMessageOnBareSingleChild() throws Exception {
String ns = "http://apache.org/hello_world_xml_http/bare";
prepareMessage("/message-bare-single-param-element.xml");
common("/wsdl/hello_world_xml_bare.wsdl", new QName(ns, "XMLPort"),
- org.apache.hello_world_xml_http.bare.Greeter.class);
+ org.apache.hello_world_xml_http.bare.Greeter.class);
in.handleMessage(xmlMessage);
List list = xmlMessage.getContent(List.class);
assertNotNull(list);
assertEquals("expect 1 param", 1, list.size());
- assertEquals("method input me is String tli", true,
((String)list.get(0)).indexOf("tli") >= 0);
- // prepareMessage("/message-bare-single-param-type.xml");
- // common();
- // assertNotNull(list);
- // assertEquals("expect 1 param", 1, list.size());
- // assertEquals("method input in2 is MyComplexStructType", true,
- // list.get(0) instanceof MyComplexStructType);
+ assertEquals("method input me is String tli", true, ((String)
list.get(0)).indexOf("tli") >= 0);
}
public void testHandleMessageWrapped() throws Exception {
String ns = "http://apache.org/hello_world_xml_http/wrapped";
prepareMessage("/message-wrap.xml");
common("/wsdl/hello_world_xml_wrapped.wsdl", new QName(ns, "XMLPort"),
- org.apache.hello_world_xml_http.wrapped.Greeter.class);
-
- // FIXME
- // in.handleMessage(xmlMessage);
- // List list = xmlMessage.getContent(List.class);
- // assertNotNull(list);
- // assertEquals("expect 1 param", 1, list.size());
- // assertEquals("method input me is String tli", true,
list.get(0) instanceof GreetMe);
+ org.apache.hello_world_xml_http.wrapped.Greeter.class);
+ in.handleMessage(xmlMessage);
+ List list = xmlMessage.getContent(List.class);
+ assertNotNull(list);
+ assertEquals("expect 1 param", 1, list.size());
+ assertEquals("method input me is String tli", true, list.get(0)
instanceof GreetMe);
}
private void prepareMessage(String messageFileName) throws Exception {