From a40e527938d76ba71f211da7e327adb50384ba69 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:26:33 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835157 13f79535-47bb-0310-9956-ffa450edef68 --- .../databinding/jaxb/JAXBDataBindingTestCase.java | 129 +++++++++++++++++ .../jaxb/JAXBExceptionHandlerTestCase.java | 81 +++++++++++ .../tuscany/databinding/jaxb/JAXBTestCase.java | 160 +++++++++++++++++++++ .../jaxb/JAXBWrapperHandlerTestCase.java | 72 ++++++++++ .../jaxb/JAXWSJavaInterfaceProcessorTestCase.java | 102 +++++++++++++ .../databinding/jaxb/fault/InvalidSymbolFault.java | 78 ++++++++++ .../jaxb/fault/InvalidSymbolFault_Exception.java | 64 +++++++++ .../databinding-jaxb/src/test/resources/ipo.xsd | 136 ++++++++++++++++++ 8 files changed, 822 insertions(+) create mode 100644 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java create mode 100644 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java create mode 100755 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java create mode 100644 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java create mode 100644 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessorTestCase.java create mode 100644 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java create mode 100644 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java create mode 100755 sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/resources/ipo.xsd (limited to 'sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test') diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java new file mode 100644 index 0000000000..b121e2c99f --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java @@ -0,0 +1,129 @@ +/* + * 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.tuscany.databinding.jaxb; + +import java.lang.annotation.Annotation; + +import javax.xml.bind.JAXBElement; +import javax.xml.namespace.QName; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding; +import org.apache.tuscany.sca.interfacedef.DataType; +import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; +import org.apache.tuscany.sca.interfacedef.util.XMLType; + +import com.example.ipo.jaxb.ObjectFactory; +import com.example.ipo.jaxb.PurchaseOrderType; +import com.example.ipo.jaxb.USAddress; +import com.example.ipo.jaxb.USState; + +/** + * + */ +public class JAXBDataBindingTestCase extends TestCase { + private JAXBDataBinding binding; + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + binding = new JAXBDataBinding(); + } + + /** + * Test method for + * {@link org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding#introspect(java.lang.Class, Annotation)}. + */ + public final void testIntrospect() { + DataType dataType = new DataTypeImpl(JAXBElement.class, null); + boolean yes = binding.introspect(dataType, null); + assertTrue(yes); + assertTrue(dataType.getDataBinding().equals(binding.getName())); + assertTrue(dataType.getPhysical() == JAXBElement.class && dataType.getLogical() == XMLType.UNKNOWN); + dataType = new DataTypeImpl(MockJAXBElement.class, null); + yes = binding.introspect(dataType, null); + assertTrue(yes); + assertEquals(MockJAXBElement.class, dataType.getPhysical()); + assertEquals(new QName("http://www.example.com/IPO", "PurchaseOrderType"), ((XMLType)dataType.getLogical()) + .getTypeName()); + dataType = new DataTypeImpl(USAddress.class, null); + yes = binding.introspect(dataType, null); + assertTrue(yes); + assertEquals(USAddress.class, dataType.getPhysical()); + assertEquals(new QName("http://www.example.com/IPO", "USAddress"), ((XMLType)dataType.getLogical()) + .getTypeName()); + dataType = new DataTypeImpl(USState.class, null); + yes = binding.introspect(dataType, null); + assertTrue(yes); + assertTrue(dataType.getDataBinding().equals(binding.getName())); + assertEquals(USState.class, dataType.getPhysical()); + assertEquals(new QName("http://www.example.com/IPO", "USState"), ((XMLType)dataType.getLogical()).getTypeName()); + + } + + private static class MockJAXBElement extends JAXBElement { + + private static final long serialVersionUID = -2767569071002707973L; + + /** + * @param elementName + * @param type + * @param value + */ + public MockJAXBElement(QName elementName, Class type, PurchaseOrderType value) { + super(elementName, type, value); + } + + } + + @SuppressWarnings("unchecked") + public void testCopy() { + ObjectFactory factory = new ObjectFactory(); + PurchaseOrderType poType = factory.createPurchaseOrderType(); + JAXBElement po = factory.createPurchaseOrder(poType); + JAXBElement copy = (JAXBElement)binding.copy(po); + assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getName()); + } + + @SuppressWarnings("unchecked") + public void testCopyNonElement() { + ObjectFactory factory = new ObjectFactory(); + PurchaseOrderType poType = factory.createPurchaseOrderType(); + poType.setComment("Comment"); + PurchaseOrderType copy = (PurchaseOrderType)binding.copy(poType); + assertTrue(copy instanceof PurchaseOrderType); + assertEquals("Comment", (copy).getComment()); + } + + @SuppressWarnings("unchecked") + public void testCopyNonRoot() { + ObjectFactory factory = new ObjectFactory(); + USAddress address = factory.createUSAddress(); + address.setCity("San Jose"); + USAddress copy = (USAddress)binding.copy(address); + assertTrue(copy instanceof USAddress); + assertEquals("San Jose", (copy).getCity()); + + } +} diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java new file mode 100644 index 0000000000..9cf40ee9a6 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java @@ -0,0 +1,81 @@ +/* + * 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.tuscany.databinding.jaxb; + +import javax.xml.namespace.QName; + +import junit.framework.TestCase; + +import org.apache.tuscany.databinding.jaxb.fault.InvalidSymbolFault; +import org.apache.tuscany.databinding.jaxb.fault.InvalidSymbolFault_Exception; +import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding; +import org.apache.tuscany.sca.databinding.jaxb.JAXBExceptionHandler; +import org.apache.tuscany.sca.interfacedef.DataType; +import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; +import org.apache.tuscany.sca.interfacedef.util.XMLType; + +/** + * Test case for JAXBExceptionHandler + */ +public class JAXBExceptionHandlerTestCase extends TestCase { + private static final QName ELEMENT = new QName("http://www.example.com/stock", "InvalidSymbolFault"); + private JAXBExceptionHandler handler; + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + this.handler = new JAXBExceptionHandler(); + } + + public void testGetFaultType() { + DataType exType = new DataTypeImpl(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN); + DataType dataType = handler.getFaultType(exType); + assertEquals(InvalidSymbolFault.class, dataType.getPhysical()); + assertEquals(ELEMENT, ((XMLType) dataType.getLogical()).getElementName()); + assertEquals(JAXBDataBinding.NAME, dataType.getDataBinding()); + } + + public void testCreate() { + DataType execType = new DataTypeImpl(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN); + DataType faultType = handler.getFaultType(execType); + InvalidSymbolFault fault = new InvalidSymbolFault(); + fault.setMessage("ABC"); + fault.setSymbol("IBM0"); + DataType exType = new DataTypeImpl(InvalidSymbolFault_Exception.class, faultType); + Exception ex = handler.createException(exType, "Invalid symbol", fault, null); + assertTrue(ex instanceof InvalidSymbolFault_Exception); + InvalidSymbolFault_Exception exception = (InvalidSymbolFault_Exception)ex; + assertEquals("Invalid symbol", exception.getMessage()); + assertSame(fault, exception.getFaultInfo()); + } + + public void testGetFaultInfo() { + InvalidSymbolFault fault = new InvalidSymbolFault(); + fault.setMessage("ABC"); + fault.setSymbol("IBM0"); + InvalidSymbolFault_Exception exception = new InvalidSymbolFault_Exception("Invalid symbol", fault); + Object faultInfo = handler.getFaultInfo(exception); + assertSame(fault, faultInfo); + } + +} diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java new file mode 100755 index 0000000000..05f112aff3 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java @@ -0,0 +1,160 @@ +/* + * 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.tuscany.databinding.jaxb; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; + +import java.io.StringReader; + +import javax.xml.namespace.QName; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.tuscany.sca.databinding.TransformationContext; +import org.apache.tuscany.sca.databinding.jaxb.JAXB2Node; +import org.apache.tuscany.sca.databinding.jaxb.Node2JAXB; +import org.apache.tuscany.sca.databinding.jaxb.Reader2JAXB; +import org.apache.tuscany.sca.interfacedef.DataType; +import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; +import org.apache.tuscany.sca.interfacedef.util.XMLType; +import org.w3c.dom.Node; + +import com.example.ipo.jaxb.ObjectFactory; +import com.example.ipo.jaxb.PurchaseOrderType; + +public class JAXBTestCase extends TestCase { + private static final String IPO_XML = + "" + "" + + " " + + " Helen Zoe" + + " 47 Eden Street" + + " Cambridge" + + " CB1 1JR" + + " " + + " " + + " Robert Smith" + + " 8 Oak Avenue" + + " Old Town" + + " PA" + + " 95819" + + " " + + " " + + " " + + " Lapis necklace" + + " 1" + + " 99.95" + + " Want this for the holidays" + + " 1999-12-05" + + " " + + " " + + ""; + + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + public void testTransform() throws Exception { + Reader2JAXB t0 = new Reader2JAXB(); + + DataType targetDataType = new DataTypeImpl(PurchaseOrderType.class, null); + + TransformationContext tContext = createMock(TransformationContext.class); + expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes(); + replay(tContext); + + Object object1 = t0.transform(new StringReader(IPO_XML), tContext); + + DataType sourceDataType = new DataTypeImpl(PurchaseOrderType.class, null); + + TransformationContext tContext1 = createMock(TransformationContext.class); + expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes(); + replay(tContext1); + + JAXB2Node t1 = new JAXB2Node(); + Node node = t1.transform(object1, tContext1); + + Assert.assertNotNull(node); + + Node2JAXB t2 = new Node2JAXB(); + Object object2 = t2.transform(node, tContext); + Assert.assertNotNull(object2); + + } + + public void testTransform2() throws Exception { + Reader2JAXB t0 = new Reader2JAXB(); + + QName root = new QName("http://www.example.com/IPO", "purchaseOrder"); + DataType targetDataType = new DataTypeImpl(PurchaseOrderType.class, new XMLType(root, null)); + // targetDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath); + + TransformationContext tContext = createMock(TransformationContext.class); + expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes(); + replay(tContext); + + Object object1 = t0.transform(new StringReader(IPO_XML), tContext); + + DataType sourceDataType = new DataTypeImpl(PurchaseOrderType.class, new XMLType(root, null)); + // sourceDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath); + + TransformationContext tContext1 = createMock(TransformationContext.class); + expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes(); + replay(tContext1); + + JAXB2Node t1 = new JAXB2Node(); + Node node = t1.transform(object1, tContext1); + + Assert.assertNotNull(node); + + Node2JAXB t2 = new Node2JAXB(); + Object object2 = t2.transform(node, tContext); + Assert.assertNotNull(object2); + + } + + public void testTransform3() throws Exception { + + DataType sourceDataType = new DataTypeImpl(PurchaseOrderType.class, null); + + TransformationContext tContext1 = createMock(TransformationContext.class); + expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes(); + replay(tContext1); + + JAXB2Node t1 = new JAXB2Node(); + PurchaseOrderType po = new ObjectFactory().createPurchaseOrderType(); + Node node = t1.transform(po, tContext1); + + Assert.assertNotNull(node); + + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } + +} diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java new file mode 100644 index 0000000000..69ed9d81f0 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java @@ -0,0 +1,72 @@ +/* + * 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.tuscany.databinding.jaxb; + +import java.util.List; + +import javax.xml.bind.JAXBElement; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.databinding.jaxb.JAXBWrapperHandler; + +import com.example.ipo.jaxb.ObjectFactory; +import com.example.ipo.jaxb.PurchaseOrderType; + +/** + * Test case for JAXBExceptionHandler + */ +public class JAXBWrapperHandlerTestCase extends TestCase { + // private static final QName ELEMENT = new QName("http://www.example.com/IPO", "purchaseOrder"); + private JAXBWrapperHandler handler; + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + this.handler = new JAXBWrapperHandler(); + } + + public void testCreate() { + // ElementInfo element = new ElementInfo(ELEMENT, null); + // JAXBElement jaxbElement = handler.create(element, null); + } + + public void testSetChild() { + ObjectFactory factory = new ObjectFactory(); + PurchaseOrderType po = factory.createPurchaseOrderType(); + JAXBElement wrapper = factory.createPurchaseOrder(po); + handler.setChild(wrapper, 2, null, "Comment"); + } + + public void testGetChildren() { + ObjectFactory factory = new ObjectFactory(); + PurchaseOrderType po = factory.createPurchaseOrderType(); + po.setComment("Comment"); + JAXBElement wrapper = factory.createPurchaseOrder(po); + List children = handler.getChildren(wrapper); + assertNotNull(children); + assertEquals(4, children.size()); + assertEquals("Comment", children.get(2)); + assertNull(children.get(0)); + } +} diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessorTestCase.java b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessorTestCase.java new file mode 100644 index 0000000000..83abdc29f5 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessorTestCase.java @@ -0,0 +1,102 @@ +/* + * 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.tuscany.databinding.jaxb; + +import javax.jws.WebService; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.databinding.jaxb.JAXWSJavaInterfaceProcessor; +import org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl; +import org.apache.tuscany.sca.interfacedef.java.JavaInterface; + +/** + * + */ +public class JAXWSJavaInterfaceProcessorTestCase extends TestCase { + private JAXWSJavaInterfaceProcessor interfaceProcessor; + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + interfaceProcessor = new JAXWSJavaInterfaceProcessor(); + } + + /** + * Test method for + * {@link org.apache.tuscany.sca.databinding.jaxb.JAXWSJavaInterfaceProcessor#visitInterface(JavaInterface)}. + */ + public final void testProcessor() throws Exception { + JavaInterface contract = new MockJavaInterfaceImpl(); + contract.setJavaClass(WebServiceInterfaceWithoutAnnotation.class); + + interfaceProcessor.visitInterface(contract); + assertFalse(contract.isRemotable()); + + contract.setJavaClass(WebServiceInterfaceWithAnnotation.class); + interfaceProcessor.visitInterface(contract); + assertTrue(contract.isRemotable()); + } + + @WebService + private static interface WebServiceInterfaceWithAnnotation { + + } + + private static interface WebServiceInterfaceWithoutAnnotation { + + } + + private class MockJavaInterfaceImpl extends InterfaceImpl implements JavaInterface { + private Class javaClass; + + public Class getCallbackClass() { + // TODO Auto-generated method stub + return null; + } + + public Class getJavaClass() { + // TODO Auto-generated method stub + return javaClass; + } + + public String getName() { + // TODO Auto-generated method stub + return null; + } + + public void setCallbackClass(Class callbackClass) { + // TODO Auto-generated method stub + + } + + public void setJavaClass(Class javaClass) { + this.javaClass = javaClass; + } + + public void setName(String className) { + // TODO Auto-generated method stub + + } + } +} diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java new file mode 100644 index 0000000000..fd21d72337 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java @@ -0,0 +1,78 @@ +/* + * 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.tuscany.databinding.jaxb.fault; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for anonymous complex type. + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = {"message", "symbol"}) +@XmlRootElement(name = "InvalidSymbolFault") +public class InvalidSymbolFault { + + @XmlElement(required = true) + protected String message; + @XmlElement(required = true) + protected String symbol; + + /** + * Gets the value of the message property. + * + * @return possible object is {@link String } + */ + public String getMessage() { + return message; + } + + /** + * Sets the value of the message property. + * + * @param value allowed object is {@link String } + */ + public void setMessage(String value) { + this.message = value; + } + + /** + * Gets the value of the symbol property. + * + * @return possible object is {@link String } + */ + public String getSymbol() { + return symbol; + } + + /** + * Sets the value of the symbol property. + * + * @param value allowed object is {@link String } + */ + public void setSymbol(String value) { + this.symbol = value; + } + +} diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java new file mode 100644 index 0000000000..e78889aee0 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java @@ -0,0 +1,64 @@ +/* + * 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.tuscany.databinding.jaxb.fault; + +import javax.xml.ws.WebFault; + +/** + * This class was generated by the JAXWS SI. JAX-WS RI 2.1-02/02/2007 09:55 + * AM(vivekp)-FCS Generated source version: 2.1 + */ +@WebFault(name = "InvalidSymbolFault", targetNamespace = "http://www.example.com/stock") +public class InvalidSymbolFault_Exception extends Exception { + private static final long serialVersionUID = -4618497501663457633L; + + /** + * Java type that goes as soapenv:Fault detail element. + */ + private InvalidSymbolFault faultInfo; + + /** + * @param faultInfo + * @param message + */ + public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo) { + super(message); + this.faultInfo = faultInfo; + } + + /** + * @param faultInfo + * @param message + * @param cause + */ + public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo, Throwable cause) { + super(message, cause); + this.faultInfo = faultInfo; + } + + /** + * @return returns fault bean: + * org.apache.tuscany.sca.test.exceptions.impl.jaxb.InvalidSymbolFault + */ + public InvalidSymbolFault getFaultInfo() { + return faultInfo; + } + +} diff --git a/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/resources/ipo.xsd b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/resources/ipo.xsd new file mode 100755 index 0000000000..241ec15d36 --- /dev/null +++ b/sca-java-1.x/tags/0.99-incubating/modules/databinding-jaxb/src/test/resources/ipo.xsd @@ -0,0 +1,136 @@ + + + + + + International Purchase order schema for Example.com + Copyright 2000 Example.com. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3