You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/08/20 04:08:29 UTC
svn commit: r806021 - in /cxf/trunk:
rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/
rt/bindings/http/src/test/java/org/apache/cxf/binding/http/mtom/
rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/
rt/frontend/jaxws/src/te...
Author: dkulp
Date: Thu Aug 20 02:08:28 2009
New Revision: 806021
URL: http://svn.apache.org/viewvc?rev=806021&view=rev
Log:
Call setEventHandler(null); on the jaxb unmarshaller which actually
results in a decent EventHandler being setup. This exposed some bugs in
some of the test cases and in the CORBA binding.
Modified:
cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaStructEventProducer.java
cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaUnionEventProducer.java
cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/mtom/PeopleService.java
cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/sayHiResponse.xml
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java
Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaStructEventProducer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaStructEventProducer.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaStructEventProducer.java (original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaStructEventProducer.java Thu Aug 20 02:08:28 2009
@@ -32,6 +32,11 @@
iterator = handler.members.iterator();
serviceInfo = service;
orb = orbRef;
+ if (handler.members.isEmpty()
+ && handler.getSimpleName().equals(handler.getIdlType().getLocalPart() + "_f")) {
+ state = states.length;
+ }
+
}
public int next() {
@@ -49,11 +54,22 @@
&& (!CorbaHandlerUtils.isOctets(obj.getType()))) {
currentEventProducer =
new CorbaPrimitiveSequenceEventProducer(obj, serviceInfo, orb);
+ } else if (obj.getSimpleName().equals(obj.getIdlType().getLocalPart() + "_f")) {
+ //some "special cases" we need to make sure are mapped correctly
+
+ currentEventProducer =
+ CorbaHandlerUtils.getTypeEventProducer(obj, serviceInfo, orb);
+
} else {
currentEventProducer =
CorbaHandlerUtils.getTypeEventProducer(obj, serviceInfo, orb);
}
- event = currentEventProducer.next();
+ if (currentEventProducer.hasNext()) {
+ event = currentEventProducer.next();
+ } else {
+ currentEventProducer = null;
+ return next();
+ }
} else {
// all done with content, move past state 0
event = states[++state];
Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaUnionEventProducer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaUnionEventProducer.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaUnionEventProducer.java (original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaUnionEventProducer.java Thu Aug 20 02:08:28 2009
@@ -58,6 +58,8 @@
list.add(contents);
iterator = list.iterator();
}
+ } else if (handler.getSimpleName().equals(handler.getIdlType().getLocalPart() + "_f")) {
+ state = states.length;
}
}
}
Modified: cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/mtom/PeopleService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/mtom/PeopleService.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/mtom/PeopleService.java (original)
+++ cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/mtom/PeopleService.java Thu Aug 20 02:08:28 2009
@@ -18,16 +18,24 @@
*/
package org.apache.cxf.binding.http.mtom;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
import javax.jws.WebService;
import org.apache.cxf.person.People;
import org.apache.cxf.person.Person;
-@WebService
+@WebService(targetNamespace = "http://cxf.apache.org/person/")
public interface PeopleService {
+ @WebResult(name = "Person",
+ targetNamespace = "http://cxf.apache.org/person/")
People getPeople();
- void addPerson(Person p);
-
- Person getPerson(String name);
+ void addPerson(@WebParam(name = "Person",
+ targetNamespace = "http://cxf.apache.org/person/")
+ Person p);
+
+ @WebResult(name = "Person",
+ targetNamespace = "http://cxf.apache.org/person/")
+ Person getPerson(@WebParam(name = "name") String name);
}
Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java Thu Aug 20 02:08:28 2009
@@ -66,6 +66,8 @@
}
if (databinding.getValidationEventHandler() != null) {
um.setEventHandler(databinding.getValidationEventHandler());
+ } else {
+ um.setEventHandler(null);
}
if (databinding.getUnmarshallerProperties() != null) {
for (Map.Entry<String, Object> propEntry
Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/sayHiResponse.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/sayHiResponse.xml?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/sayHiResponse.xml (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/sayHiResponse.xml Thu Aug 20 02:08:28 2009
@@ -19,7 +19,7 @@
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<sayHiResponse xmlns="http://apache.org/hello_world_soap_http/types">
- <text>hi</text>
+ <responseType>hi</responseType>
</sayHiResponse>
</soap:Body>
Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java Thu Aug 20 02:08:28 2009
@@ -413,7 +413,11 @@
assertEquals("Hello", echoMsg);
}
private void runDocLitTest(DocLitWrappedCodeFirstService port) throws Exception {
+ Foo foo = new Foo();
+ foo.setName("blah");
+ assertEquals("blah", port.modifyFoo(foo).getName());
+
assertEquals("hello", port.outOnly(new Holder<String>(), new Holder<String>()));
long start = System.currentTimeMillis();
@@ -549,7 +553,26 @@
fail("Expected exception not found");
} catch (ComplexException ex) {
assertEquals("Throw user fault -3", ex.getMessage());
- }
+ }
+
+ try {
+ Foo foo = new Foo();
+ foo.setNameIgnore("DoNoName");
+ port.modifyFoo(foo);
+ fail("Expected exception not found");
+ } catch (SOAPFaultException ex) {
+ assertTrue(ex.getMessage().contains("NoName is not a valid name"));
+ }
+ try {
+ Foo foo = new Foo();
+ foo.setNameIgnore("NoName");
+ port.modifyFoo(foo);
+ fail("Expected exception not found");
+ } catch (SOAPFaultException ex) {
+ assertTrue(ex.getMessage().contains("NoName is not a valid name"));
+ }
+
+
}
Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java Thu Aug 20 02:08:28 2009
@@ -182,6 +182,12 @@
}
public void setName(String n) {
+ if ("NoName".equals(n)) {
+ throw new IllegalArgumentException(n + " is not a valid name");
+ }
+ name = n;
+ }
+ public void setNameIgnore(String n) {
name = n;
}
public String getName() {
@@ -191,6 +197,8 @@
Set<Foo> getFooSet();
+ Foo modifyFoo(Foo foo);
+
@RequestWrapper(className = "org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService$DoFooListRequest")
@WebMethod(operationName = "doFooList")
String doFooList(@WebParam(name = "dbRef") List<Foo> fooList);
Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java Thu Aug 20 02:08:28 2009
@@ -221,5 +221,12 @@
out2.value = "out2";
return "hello";
}
+
+ public Foo modifyFoo(Foo f) {
+ if ("DoNoName".equals(f.getName())) {
+ f.setNameIgnore("NoName");
+ }
+ return f;
+ }
}
Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java?rev=806021&r1=806020&r2=806021&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java Thu Aug 20 02:08:28 2009
@@ -46,119 +46,119 @@
static {
String notWorking[] = new String[] {
- "DerivedChoiceBaseChoice",
- "UnionWithAnonEnum",
- "SimpleAll",
- "OccuringChoiceWithAnyAttribute",
+ "AnonEnumList",
+ "AnonymousType",
+ "AnyURIRestriction",
+ "Base64BinaryRestriction",
"ChoiceArray",
+ "ChoiceOfChoice",
"ChoiceOfSeq",
- "DerivedStructBaseStruct",
- "OccuringChoice2",
- "OccuringStructWithAnyAttribute",
- "OccuringStruct",
- "OccuringStruct2",
- "InheritanceUnboundedArrayDerivedChoice",
- "ComplexTypeWithAttributes",
- "OccuringChoice1",
- "StructWithSubstitutionGroup",
- "StructWithNillableStruct",
- "SimpleContent2",
- "OccuringAll",
- "Document",
"ChoiceWithAnyAttribute",
- "RecursiveUnionData",
- "ExtBase64Binary",
- "RecursiveStructArray",
- "StructWithAnyArray",
- "UnsignedByte",
- "SimpleStruct",
- "RecOuterType",
- "UnionWithStringListRestriction",
- "RecElType",
- "AnonEnumList",
- "DerivedNoContent",
- "StructWithMultipleSubstitutionGroups",
- "StructWithNillableChoice",
- "RestrictedAllBaseAll",
- "NestedStruct",
- "StructWithOccuringStruct",
- "SequenceWithGroups",
- "RecursiveUnion",
- "ExtendsSimpleType",
- "InheritanceEmptyAllDerivedEmpty",
- "HexBinaryRestriction",
- "DerivedStructBaseChoice",
- "UnionSimpleContent",
+ "ChoiceWithGroupChoice",
+ "ChoiceWithGroups",
+ "ChoiceWithGroupSeq",
"ChoiceWithSubstitutionGroup",
- "UnionWithAnonList",
+ "ChoiceWithSubstitutionGroupAbstract",
+ "ChoiceWithSubstitutionGroupNil",
"ComplexRestriction",
- "NMTOKENS",
- "SequenceWithGroupSeq",
- "IDTypeAttribute",
- "SimpleContent3",
- "SimpleUnionList",
- "OccuringChoice",
- "SimpleRestriction2",
- "SimpleContent1",
- "StructWithAnyXsi",
- "InheritanceNestedStruct",
- "StructWithInvalidAny",
- "SimpleRestriction6",
+ "ComplexRestriction2",
+ "ComplexRestriction3",
+ "ComplexRestriction4",
"ComplexRestriction5",
- "ExtendsSimpleContent",
+ "ComplexTypeWithAttributeGroup",
+ "ComplexTypeWithAttributeGroup1",
+ "ComplexTypeWithAttributes",
"DateTime",
- "DerivedChoiceBaseStruct",
- "StringI18N",
- "ChoiceOfChoice",
- "ComplexRestriction3",
- "Base64BinaryRestriction",
- "StructWithList",
- "QNameList",
- "InheritanceSimpleStructDerivedStruct",
- "SimpleRestriction5",
- "ChoiceWithSubstitutionGroupAbstract",
- "ChoiceWithSubstitutionGroupNil",
- "ChoiceWithGroups",
- "SequenceWithGroupChoice",
"DerivedChoiceBaseArray",
- "UnionWithStringList",
- "SimpleRestriction3",
- "ComplexRestriction2",
- "SimpleListRestriction2",
+ "DerivedChoiceBaseChoice",
+ "DerivedChoiceBaseStruct",
+ "DerivedNoContent",
+ "DerivedStructBaseChoice",
"DerivedStructBaseEmpty",
- "RestrictedChoiceBaseChoice",
- "ChoiceWithGroupSeq",
+ "DerivedStructBaseStruct",
+ "Document",
"EmptyStruct",
- "RestrictedStructBaseStruct",
+ "ExtBase64Binary",
+ "ExtColourEnum",
+ "ExtendsSimpleContent",
+ "ExtendsSimpleType",
+ "GroupDirectlyInComplexType",
+ "HexBinaryRestriction",
+ "IDTypeAttribute",
+ "InheritanceEmptyAllDerivedEmpty",
+ "InheritanceNestedStruct",
"InheritanceSimpleChoiceDerivedStruct",
- "RecursiveStruct",
+ "InheritanceSimpleStructDerivedStruct",
+ "InheritanceUnboundedArrayDerivedChoice",
"MRecSeqA",
- "StructWithUnion",
- "StructWithOptionals",
+ "MRecSeqC",
+ "NestedStruct",
+ "NMTOKENS",
+ "NumberList",
+ "Occuri ngStruct2",
+ "OccuringAll",
+ "OccuringChoice",
+ "OccuringChoice1",
+ "OccuringChoice2",
+ "OccuringChoiceWithAnyAttribute",
+ "OccuringStruct",
"OccuringStruct1",
- "ExtColourEnum",
+ "OccuringStruct2",
+ "OccuringStructWithAnyAttribute",
+ "QName",
+ "QNameList",
+ "RecElType",
+ "RecOuterType",
"RecSeqB6918",
- "StructWithSubstitutionGroupNil",
+ "RecursiveStruct",
+ "RecursiveStructArray",
+ "RecursiveUnion",
+ "RecursiveUnionData",
+ "RestrictedAllBaseAll",
+ "RestrictedChoiceBaseChoice",
+ "RestrictedStructBaseStruct",
+ "SequenceWithGroupChoice",
+ "SequenceWithGroups",
+ "SequenceWithGroupSeq",
+ "SequenceWithOccuringGroup",
+ "SimpleAll",
+ "SimpleContent1",
+ "SimpleContent2",
+ "SimpleContent3",
"SimpleContentExtWithAnyAttribute",
- "StructWithAnyAttribute",
+ "SimpleListRestriction2",
+ "SimpleRestriction2",
+ "SimpleRestriction3",
+ "SimpleRestriction5",
+ "SimpleRestriction6",
+ "SimpleStruct",
+ "SimpleUnionList",
+ "StringI18N",
"StringList",
- "StructWithOccuringChoice",
"StructWithAny",
- "SequenceWithOccuringGroup",
- "ComplexTypeWithAttributeGroup1",
- "QName",
- "StructWithOccuringStruct2",
- "Occuri ngStruct2",
- "ChoiceWithGroupChoice",
+ "StructWithAnyArray",
+ "StructWithAnyAttribute",
+ "StructWithAnyXsi",
+ "StructWithInvalidAny",
"StructWithInvalidAnyArray",
- "MRecSeqC",
- "AnonymousType",
- "AnyURIRestriction",
- "NumberList",
+ "StructWithList",
+ "StructWithMultipleSubstitutionGroups",
+ "StructWithNillableChoice",
+ "StructWithNillableStruct",
+ "StructWithOccuringChoice",
+ "StructWithOccuringStruct",
+ "StructWithOccuringStruct2",
+ "StructWithOptionals",
+ "StructWithSubstitutionGroup",
"StructWithSubstitutionGroupAbstract",
- "GroupDirectlyInComplexType",
- "ComplexTypeWithAttributeGroup",
- "ComplexRestriction4",
+ "StructWithSubstitutionGroupNil",
+ "StructWithUnion",
+ "UnionSimpleContent",
+ "UnionWithAnonEnum",
+ "UnionWithAnonList",
+ "UnionWithStringList",
+ "UnionWithStringListRestriction",
+ "UnsignedByte",
};
NOT_WORKING_TESTS.addAll(Arrays.asList(notWorking));
@@ -201,6 +201,7 @@
}
@AfterClass
public static void deleteRefFile() throws Exception {
+ //System.out.println(NOT_WORKING_TESTS.size());
File file = new File("./TypeTest.ref");
file.delete();
//for (String s : RUN_TESTS) {
@@ -209,7 +210,7 @@
//System.out.println(RUN_TESTS.size());
}
- public boolean shouldRunTest(String name) {
+ public boolean shouldRunTest(String name) {
if (!NOT_WORKING_TESTS.contains(name)) {
boolean b = super.shouldRunTest(name);
if (b) {
@@ -217,6 +218,7 @@
}
return b;
}
+ //return true;
return false;
}