Author: jim.ma
Date: 2013-12-05 05:17:37 -0500 (Thu, 05 Dec 2013)
New Revision: 18138
Added:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java
Log:
[JBPAPP-10907]:Ability to set custom JAXB validation event handlers on outgoing responses
in JBossWS-CXF(Review and apply patch from Joe Wertz)
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java 2013-12-05
09:13:56 UTC (rev 18137)
+++
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -50,6 +50,7 @@
public class DataWriterImpl<T> extends JAXBDataBase implements DataWriter<T>
{
private static final Logger LOG = LogUtils.getLogger(JAXBDataBinding.class);
+ ValidationEventHandler veventHandler;
private JAXBDataBinding databinding;
public DataWriterImpl(JAXBDataBinding binding) {
@@ -60,6 +61,18 @@
public void write(Object obj, T output) {
write(obj, null, output);
}
+
+ public void setProperty(String prop, Object value) {
+ if (prop.equals(org.apache.cxf.message.Message.class.getName())) {
+ org.apache.cxf.message.Message m = (org.apache.cxf.message.Message)value;
+ veventHandler = (ValidationEventHandler)m.getContextualProperty(
+ "jaxb-writer-validation-event-handler");
+ if (veventHandler == null) {
+ veventHandler = databinding.getValidationEventHandler();
+ }
+ }
+ }
+
private static class MtomValidationHandler implements ValidationEventHandler {
ValidationEventHandler origHandler;
JAXBAttachmentMarshaller marshaller;
@@ -104,7 +117,8 @@
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE);
marshaller.setListener(databinding.getMarshallerListener());
- if (databinding.getValidationEventHandler() != null) {
+ marshaller.setEventHandler(veventHandler);
+ if (veventHandler == null && databinding.getValidationEventHandler()
!= null) {
marshaller.setEventHandler(databinding.getValidationEventHandler());
}
Added:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jaxb.io;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+
+public class MyCustomHandler implements ValidationEventHandler {
+
+ private boolean used;
+ public boolean getUsed() {
+ return used;
+ }
+
+ public boolean handleEvent(ValidationEvent event) {
+ used = true;
+ return true;
+ }
+
+}
\ No newline at end of file
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/MyCustomHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java 2013-12-05
09:13:56 UTC (rev 18137)
+++
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataReaderTest.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -57,6 +57,33 @@
}
@Test
+ public void testSetProperty() throws Exception {
+ JAXBDataBinding db = getDataBinding(GreetMe.class);
+
+ reader =
getTestReader("../resources/SetPropertyValidationFailureReq.xml");
+ assertNotNull(reader);
+
+ @SuppressWarnings("unchecked")
+ DataReaderImpl<XMLStreamReader> dr =
(DataReaderImpl)db.createReader(XMLStreamReader.class);
+ assertNotNull(dr);
+
+ // Build message to set custom event handler
+ org.apache.cxf.message.Message message = new
org.apache.cxf.message.MessageImpl();
+ message.put("jaxb-validation-event-handler", new MyCustomHandler());
+ message.put("unwrap.jaxb.element", true);
+
+ dr.setProperty("org.apache.cxf.message.Message", message);
+
+ // Should fail if custom handler doesn't skip formatting error
+ Object val = dr.read(reader);
+ assertTrue(val instanceof GreetMe);
+ assertEquals("TestSOAPInputPMessage",
((GreetMe)val).getRequestType());
+
+ // Check handler used
+ assertTrue(((MyCustomHandler)dr.veventHandler).getUsed());
+ }
+
+ @Test
public void testReadWrapper() throws Exception {
JAXBDataBinding db = getDataBinding(GreetMe.class);
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java 2013-12-05
09:13:56 UTC (rev 18137)
+++
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/io/XMLStreamDataWriterTest.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -62,6 +62,36 @@
public void tearDown() throws Exception {
baos.close();
}
+
+ @Test
+ public void testSetProperty() throws Exception {
+ JAXBDataBinding db = getTestWriterFactory();
+
+ @SuppressWarnings("unchecked")
+ DataWriterImpl<XMLStreamWriter> dw =
(DataWriterImpl)db.createWriter(XMLStreamWriter.class);
+ assertNotNull(dw);
+
+ // Build message to set custom event handler
+ org.apache.cxf.message.Message message = new
org.apache.cxf.message.MessageImpl();
+ message.put("jaxb-writer-validation-event-handler", new
MyCustomHandler());
+
+ dw.setProperty("org.apache.cxf.message.Message", message);
+
+ // Write Stuff
+ TradePriceData val = new TradePriceData();
+ val.setTickerSymbol("This is a symbol");
+ val.setTickerPrice(1.0f);
+
+ QName elName = new
QName("http://apache.org/hello_world_doc_lit_bare/types", "inout");
+ MessagePartInfo part = new MessagePartInfo(elName, null);
+ part.setElement(true);
+ part.setElementQName(elName);
+ dw.write(val, part, streamWriter);
+ streamWriter.flush();
+
+ // Test MyCustomHandler
+ assertTrue(((MyCustomHandler)dw.veventHandler).getUsed());
+ }
@Test
public void testWriteRPCLit1() throws Exception {
Added:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,22 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<ns4:greetMe
xmlns:ns4="http://apache.org/hello_world_soap_http/types">
+ <ns4:requestType>TestSOAPInputPMessage</ns4:requestType>
+ <ns4:somethingElse>bla bla bla</ns4:somethingElse>
+</ns4:greetMe>
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/resources/SetPropertyValidationFailureReq.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxb.validators;
+
+import org.apache.cxf.testutil.common.TestUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+@ContextConfiguration(locations = { "classpath:jaxbCustomValidators.xml" })
+public class CustomValidatorJAXBTest extends AbstractJUnit4SpringContextTests {
+ static final String PORT = TestUtil.getPortNumber(CustomValidatorJAXBTest.class);
+
+ @Test
+ public void cleanTest() {
+ HelloWorld client = (HelloWorld)applicationContext
+ .getBean("testClient", HelloWorld.class);
+
+ PassedObject hi = client.sayHi(new PassedObject("John",
"Doe"));
+ Assert.assertTrue("Expected: 'Hello John Doe' Actual: " +
hi.getName(),
+ "Hello John Doe".equals(hi.getName()));
+
+ }
+
+ @Test
+ public void sendNullTest() {
+ HelloWorld client = (HelloWorld)applicationContext
+ .getBean("testClient", HelloWorld.class);
+
+ PassedObject hi = client.sayHi(new PassedObject());
+ Assert.assertTrue("Expected: 'Hello null null' Actual: '" +
hi.getName() + "'",
+ "Hello null null".equals(hi.getName()));
+
+ }
+
+ @Test
+ public void returnNullTest() {
+ HelloWorld client = (HelloWorld)applicationContext
+ .getBean("testClient", HelloWorld.class);
+
+ PassedObject hi = client.returnNull(new PassedObject("John",
"Doe"));
+ Assert.assertTrue("Expected: 'Hello null' Actual: '" +
hi.getName() + "'",
+ "Hello null".equals(hi.getName()));
+
+ }
+}
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/CustomValidatorJAXBTest.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxb.validators;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+
+(a)javax.jws.WebService(targetNamespace = "aNamespace")
+public interface HelloWorld {
+
+ @WebMethod(operationName = "sayHi")
+ PassedObject sayHi(@WebParam(name = "text") PassedObject name);
+
+ @WebMethod(operationName = "returnNull")
+ PassedObject returnNull(@WebParam(name = "text") PassedObject name);
+}
+
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorld.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxb.validators;
+
+(a)javax.jws.WebService(endpointInterface =
"org.apache.cxf.systest.jaxb.validators.HelloWorld")
+public class HelloWorldImpl implements HelloWorld {
+
+ public PassedObject sayHi(PassedObject name) {
+ return new PassedObject("Hello", name.getName());
+ }
+
+ public PassedObject returnNull(PassedObject name) {
+ return new PassedObject("Hello", null);
+ }
+
+}
+
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/HelloWorldImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxb.validators;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+
+public class MyCustomHandler implements ValidationEventHandler {
+
+ private boolean used;
+ public boolean getUsed() {
+ return used;
+ }
+
+ public boolean handleEvent(ValidationEvent event) {
+ used = true;
+ return true;
+ }
+
+}
\ No newline at end of file
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/MyCustomHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxb.validators;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "UserType", propOrder = { "firstName",
"lastName" })
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class PassedObject {
+
+ @XmlElement(required = true, nillable = false)
+ private String firstName;
+
+ @XmlElement(required = true, nillable = false)
+ private String lastName;
+
+ public PassedObject() { }
+
+ public PassedObject(String firstName, String lastName) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getName() {
+ return firstName + " " + lastName;
+ }
+
+}
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/validators/PassedObject.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml
(rev 0)
+++
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml 2013-12-05
10:17:37 UTC (rev 18138)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans
xmlns="http://www.springframework.org/schema/beans"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:jaxws="http://cxf.apache.org/jaxws"
+
xmlns:http="http://cxf.apache.org/transports/http/configuration"
+
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd">
+ <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+ <!-- Services -->
+ <jaxws:server
+ id="testServer"
+ serviceClass="org.apache.cxf.systest.jaxb.validators.HelloWorld"
+ address="http://localhost:${testutil.ports.CustomValidatorJAXBTest}/Hello">
+ <jaxws:serviceBean>
+ <bean class="org.apache.cxf.systest.jaxb.validators.HelloWorldImpl"/>
+ </jaxws:serviceBean>
+ <jaxws:properties>
+ <entry key="schema-validation-enabled" value="true"
/>
+ <entry key="jaxb-validation-event-handler">
+ <bean
class="org.apache.cxf.systest.jaxb.validators.MyCustomHandler"></bean>
+ </entry>
+ <entry key="jaxb-writer-validation-event-handler">
+ <bean
class="org.apache.cxf.systest.jaxb.validators.MyCustomHandler"></bean>
+ </entry>
+ </jaxws:properties>
+ </jaxws:server>
+
+ <!-- Client Proxy -->
+ <jaxws:client
+ id="testClient"
+ serviceClass="org.apache.cxf.systest.jaxb.validators.HelloWorld"
+ address="http://localhost:${testutil.ports.CustomValidatorJAXBTest}/Hello">
+ </jaxws:client>
+
+
+</beans>
Property changes on:
thirdparty/cxf/branches/cxf-2.2.12/systests/databinding/src/test/resources/jaxbCustomValidators.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native