wise SVN: r537 - core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 20:03:54 -0500 (Tue, 26 Feb 2013)
New Revision: 537
Modified:
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java
Log:
Modified: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java 2013-02-27 01:00:33 UTC (rev 536)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java 2013-02-27 01:03:54 UTC (rev 537)
@@ -140,16 +140,13 @@
Map<String, Element> elementsMap = new HashMap<String, Element>();
for (Entry<String, ? extends WebParameter> par : pars.entrySet()) {
String parName = par.getKey();
- WebParameter parameter = par.getValue();
- Element parElement = builder.buildTree(parameter.getType(), parName, null, true);
+ Element parElement = builder.buildTree(par.getValue().getType(), parName, null, true);
populateElement(parElement, 1);
elementsMap.put(parName, parElement);
}
Map<String, Object> args = new java.util.HashMap<String, Object>();
for (Entry<String, Element> elem : elementsMap.entrySet()) {
- String parName = elem.getKey();
- Element element = elem.getValue();
- args.put(parName, element.toObject());
+ args.put(elem.getKey(), elem.getValue().toObject());
}
ByteArrayOutputStream bos = new ByteArrayOutputStream();
11 years, 10 months
wise SVN: r536 - core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 20:00:33 -0500 (Tue, 26 Feb 2013)
New Revision: 536
Added:
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java
Log:
Adding integration test demonstrating how to use tree view for easily building a soap request message previewer
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/MessagePreviewIntegrationTest.java 2013-02-27 01:00:33 UTC (rev 536)
@@ -0,0 +1,228 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.tree;
+
+import java.io.ByteArrayOutputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.WebParameter;
+import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.exception.InvocationException;
+import org.jboss.wise.core.test.WiseTest;
+import org.jboss.wise.core.utils.JavaUtils;
+import org.jboss.wise.tree.Element;
+import org.jboss.wise.tree.ElementBuilder;
+import org.jboss.wise.tree.ElementBuilderFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class MessagePreviewIntegrationTest extends WiseTest {
+
+ private static URL warUrl = null;
+ private static WSDynamicClient client;
+ private final String registerOpRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
+ "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
+ " <soap:Header/>\n" +
+ " <soap:Body>\n" +
+ " <ns2:Register xmlns=\"http://complex.jaxws.ws.test.jboss.org/\" xmlns:ns2=\"http://types.complex.jaxws.ws.test.jboss.org/\" xmlns:ns3=\"http://extra.complex.jaxws.ws.test.jboss.org/\">\n" +
+ " <ns2:Customer>\n" +
+ " <address>\n" +
+ " <city>?</city>\n" +
+ " <state>?</state>\n" +
+ " <street>?</street>\n" +
+ " <zip>?</zip>\n" +
+ " </address>\n" +
+ " <contactNumbers>\n" +
+ " <areaCode>?</areaCode>\n" +
+ " <exchange>?</exchange>\n" +
+ " <line>?</line>\n" +
+ " </contactNumbers>\n" +
+ " <id>0</id>\n" +
+ " <name>\n" +
+ " <firstName>?</firstName>\n" +
+ " <lastName>?</lastName>\n" +
+ " <middleName>?</middleName>\n" +
+ " </name>\n" +
+ " <referredCustomers>\n" +
+ " <address>\n" +
+ " <city>?</city>\n" +
+ " <state>?</state>\n" +
+ " <street>?</street>\n" +
+ " <zip>?</zip>\n" +
+ " </address>\n" +
+ " <contactNumbers>\n" +
+ " <areaCode>?</areaCode>\n" +
+ " <exchange>?</exchange>\n" +
+ " <line>?</line>\n" +
+ " </contactNumbers>\n" +
+ " <contactNumbers>\n" +
+ " <areaCode>?</areaCode>\n" +
+ " <exchange>?</exchange>\n" +
+ " <line>?</line>\n" +
+ " </contactNumbers>\n" +
+ " <id>0</id>\n" +
+ " <name>\n" +
+ " <firstName>?</firstName>\n" +
+ " <lastName>?</lastName>\n" +
+ " <middleName>?</middleName>\n" +
+ " </name>\n" +
+ " <referredCustomers xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\"/>\n" +
+ " <referredCustomers xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\"/>\n" +
+ " </referredCustomers>\n" +
+ " </ns2:Customer>\n" +
+ " <ns2:When xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"xs:string\"/>\n" +
+ " </ns2:Register>\n" +
+ " </soap:Body>\n" +
+ "</soap:Envelope>\n";
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ warUrl = MessagePreviewIntegrationTest.class.getClassLoader().getResource("complex.war");
+ deployWS(warUrl);
+
+ URL wsdlURL = new URL(getServerHostAndPort() + "/complex/RegistrationService?wsdl");
+
+ WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
+ client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true).wsdlURL(wsdlURL
+ .toString()).build();
+ }
+
+ @Test
+ public void shouldPreviewRegisterOperation() throws Exception {
+ WSMethod method = client.getWSMethod("RegistrationServiceImplService", "RegistrationServiceImplPort", "Register");
+ String messagePreview = previewMessage(method);
+ Assert.assertEquals(registerOpRequest, messagePreview); //TODO improve check...
+ }
+
+ @Test
+ public void shouldPreviewEchoOperation() throws Exception {
+ WSMethod method = client.getWSMethod("RegistrationServiceImplService", "RegistrationServiceImplPort", "Echo");
+ String messagePreview = previewMessage(method);
+// System.out.println("--> " + messagePreview); //TODO check...
+ }
+
+ private String previewMessage(WSMethod method) throws InvocationException {
+ Map<String, ? extends WebParameter> pars = method.getWebParams();
+ ElementBuilder builder = ElementBuilderFactory.getElementBuilder().client(client).request(true).useDefautValuesForNullLeaves(false);
+ Map<String, Element> elementsMap = new HashMap<String, Element>();
+ for (Entry<String, ? extends WebParameter> par : pars.entrySet()) {
+ String parName = par.getKey();
+ WebParameter parameter = par.getValue();
+ Element parElement = builder.buildTree(parameter.getType(), parName, null, true);
+ populateElement(parElement, 1);
+ elementsMap.put(parName, parElement);
+ }
+ Map<String, Object> args = new java.util.HashMap<String, Object>();
+ for (Entry<String, Element> elem : elementsMap.entrySet()) {
+ String parName = elem.getKey();
+ Element element = elem.getValue();
+ args.put(parName, element.toObject());
+ }
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ method.writeRequestPreview(args, bos);
+ return bos.toString();
+ }
+
+ private void populateElement(Element element, int remainingLazyExpansions) {
+ if (element.isLazy()) {
+ if (!element.isResolved()) {
+ if (remainingLazyExpansions > 0) {
+ element.getChildrenCount(); // force resolution
+ populateElement(element, --remainingLazyExpansions);
+ } else {
+ return;
+ }
+ }
+ }
+ element.setNil(false);
+ if (element.isLeaf()) {
+ element.setValue(getDefaultValue((Class<?>) element.getClassType()));
+ } else {
+ if (element.isGroup()) {
+ element.incrementChildren();
+ }
+ for (Iterator<? extends Element> it = element.getChildren(); it.hasNext();) {
+ populateElement(it.next(), remainingLazyExpansions);
+ }
+ }
+ }
+
+ protected static String getDefaultValue(Class<?> cl) {
+ if (cl.isPrimitive()) {
+ cl = JavaUtils.getWrapperType(cl);
+ }
+ String cn = cl.getName();
+ if ("java.lang.Boolean".equals(cn)) {
+ return "false";
+ } else if ("java.lang.String".equals(cn)) {
+ return "?";
+ } else if ("java.lang.Byte".equals(cn)) {
+ return "0";
+ } else if ("java.lang.Double".equals(cn)) {
+ return "0.0";
+ } else if ("java.lang.Float".equals(cn)) {
+ return "0.0";
+ } else if ("java.lang.Integer".equals(cn)) {
+ return "0";
+ } else if ("java.lang.Long".equals(cn)) {
+ return "0";
+ } else if ("java.lang.Short".equals(cn)) {
+ return "0";
+ } else if ("java.math.BigDecimal".equals(cn)) {
+ return "0.0";
+ } else if ("java.math.BigInteger".equals(cn)) {
+ return "0";
+ } else if ("javax.xml.datatype.Duration".equals(cn)) {
+ return "0";
+ } else if ("javax.xml.datatype.XMLGregorianCalendar".equals(cn)) {
+ return "1970-01-01T00:00:00.000Z";
+ } else {
+ return "";
+ }
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ try {
+ undeployWS(warUrl);
+ } finally {
+ warUrl = null;
+ client.close();
+ client = null;
+ }
+ }
+}
11 years, 10 months
wise SVN: r535 - core/trunk/core/src/main/java/org/jboss/wise/tree.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 18:44:07 -0500 (Tue, 26 Feb 2013)
New Revision: 535
Added:
core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilder.java
core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilderFactory.java
Log:
[WISE-195] Adding ElementBuilder interface
Added: core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilder.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilder.java (rev 0)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilder.java 2013-02-26 23:44:07 UTC (rev 535)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed 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.jboss.wise.tree;
+
+import java.lang.reflect.Type;
+
+import org.jboss.wise.core.client.WSDynamicClient;
+
+/**
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface ElementBuilder {
+
+ public ElementBuilder client(WSDynamicClient client);
+
+ public ElementBuilder request(boolean request);
+
+ public ElementBuilder useDefautValuesForNullLeaves(boolean useDefValuesForNullLeaves);
+
+ public Element buildTree(Type type, String name, Object value, boolean nillable);
+
+}
Added: core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilderFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilderFactory.java (rev 0)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/ElementBuilderFactory.java 2013-02-26 23:44:07 UTC (rev 535)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed 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.jboss.wise.tree;
+
+import org.jboss.wise.core.client.SpiLoader;
+
+/**
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public abstract class ElementBuilderFactory {
+
+ public static ElementBuilder getElementBuilder() {
+ return (ElementBuilder) SpiLoader.loadService("org.jboss.wise.tree.ElementBuilder", "org.jboss.wise.tree.impl.ElementBuilderImpl");
+ }
+}
11 years, 10 months
wise SVN: r534 - in core/trunk: core/src/test/java/org/jboss/wise/tree and 1 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-26 18:43:25 -0500 (Tue, 26 Feb 2013)
New Revision: 534
Modified:
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java
Log:
[WISE-195] Adding ElementBuilder interface
Modified: core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java 2013-02-25 10:00:50 UTC (rev 533)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java 2013-02-26 23:43:25 UTC (rev 534)
@@ -38,25 +38,45 @@
import org.jboss.wise.core.utils.JavaUtils;
import org.jboss.wise.core.utils.ReflectionUtils;
import org.jboss.wise.tree.Element;
+import org.jboss.wise.tree.ElementBuilder;
/**
* @author alessio.soldano(a)jboss.com
*
*/
-public class ElementBuilderImpl {
+public class ElementBuilderImpl implements ElementBuilder {
private WSDynamicClient client;
- private final boolean request;
- private final boolean useDefautValuesForNullLeaves;
+ private boolean request = true;
+ private boolean useDefautValuesForNullLeaves = true;
- public ElementBuilderImpl(WSDynamicClient client, boolean request, boolean useDefautValuesForNullLeaves) {
+ public ElementBuilderImpl() {
+ }
+
+ @Override
+ public ElementBuilder client(WSDynamicClient client) {
this.client = client;
+ return this;
+ }
+
+ @Override
+ public ElementBuilder request(boolean request) {
this.request = request;
+ return this;
+ }
+
+ @Override
+ public ElementBuilder useDefautValuesForNullLeaves(boolean useDefautValuesForNullLeaves) {
this.useDefautValuesForNullLeaves = useDefautValuesForNullLeaves;
+ return this;
}
+ @Override
public Element buildTree(Type type, String name, Object value, boolean nillable) {
+ if (client == null) {
+ throw new IllegalStateException("WSDynamicClient reference is not set!");
+ }
return buildTree(type, name, value, nillable, null, null, Collections.synchronizedMap(new HashMap<Type, ElementImpl>()), new HashSet<Type>());
}
@@ -249,4 +269,7 @@
protected String generateNewID() {
return IDGenerator.nextVal();
}
+
+
+
}
Modified: core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java 2013-02-25 10:00:50 UTC (rev 533)
+++ core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java 2013-02-26 23:43:25 UTC (rev 534)
@@ -62,7 +62,7 @@
@Test
public void shouldBuildTreeOfStringElement() throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
final String name = "myString";
final String value = "foo";
@@ -133,7 +133,7 @@
@Test
public void shouldBuildTreeOfQNameElement() throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
final String name = "myQName";
final String value = "{org.jboss.wise}foo";
@@ -188,7 +188,7 @@
@Test
public void shouldBuildTreeOfDurationElement() throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
final String name = "myDuration";
final long longVal = 345678;
final String value = String.valueOf(DatatypeFactory.newInstance().newDuration(longVal).getTimeInMillis(new GregorianCalendar()));
@@ -240,7 +240,7 @@
@Test
public void shouldBuildTreeOfXMLGregorianCalendarElement() throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
final String name = "myXMLGregorianCalendar";
final String value = "2013-02-13T12:12:10.000Z";
final String refCal = "1970-01-01T00:00:00.000Z";
@@ -291,7 +291,7 @@
}
private static <T> void shouldBuildTreeOfNumberElement(Class<T> clazz, String name, String value, String expDefValue, T expObj, T expDefObj) throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(clazz, name, null, true);
assertElementProps(el, true, false, false, true, true, false, false, 0);
assertEquals(clazz, el.getClassType());
@@ -338,7 +338,7 @@
}
private static <T> void shouldBuildTreeOfPrimitiveNumberElement(Class<T> clazz, String name, String value, String expDefValue, T expObj, T expDefObj) throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(clazz, name, null, true);
assertElementProps(el, true, false, false, false, false, false, false, 0);
assertEquals(clazz, el.getClassType());
@@ -382,7 +382,7 @@
@Test
public void shouldBuildTreeOfComplexElement() throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(MyTest.class, "myTest", null, true);
assertElementProps(el, false, false, false, false, true, false, false, 1);
assertEquals(MyTest.class, el.getClassType());
@@ -429,7 +429,7 @@
@SuppressWarnings("unchecked")
@Test
public void shouldBuildTreeOfGroupElement() throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
ParameterizedType type = getTestCollectionType();
Element el = builder.buildTree(type, "myTests", null, true);
@@ -506,7 +506,7 @@
@Test
public void shouldBuildTreeOfLazyElement() throws Exception {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(MyLazyTest.class, "myLazyTest", null, true);
assertElementProps(el, false, false, false, false, true, false, false, 2);
assertEquals(MyLazyTest.class, el.getClassType());
@@ -564,14 +564,14 @@
@Test(expected = UnsupportedOperationException.class)
public void incrementChildOperationOnNotGroupElementShouldCauseExceptionThrown() {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(MyTest.class, "myTest", null, true);
el.incrementChildren();
}
@Test(expected = WiseRuntimeException.class)
public void removeChildOperationOfUnremovableElementShouldCauseExceptionThrown() {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(MyTest.class, "myTest", null, true);
Element child = el.getChildren().next();
el.removeChild(child.getId());
@@ -579,23 +579,23 @@
@Test(expected = UnsupportedOperationException.class)
public void incrementChildOperationOnLeafElementShouldCauseExceptionThrown() {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(String.class, "myString", null, true);
el.incrementChildren();
}
@Test(expected = UnsupportedOperationException.class)
public void setValueOperationsOnNotLeafElementShouldCauseExceptionThrown() {
- ElementBuilderImpl builder = getElementBuilder(true, false);
+ ElementBuilder builder = getElementBuilder(true, false);
Element el = builder.buildTree(MyTest.class, "myTest", null, true);
el.setValue("Foo");
}
- private static ElementBuilderImpl getElementBuilder(boolean request, boolean useDefaults) {
+ private static ElementBuilder getElementBuilder(boolean request, boolean useDefaults) {
WSDynamicClientImpl mock = mock(WSDynamicClientImpl.class);
mock.setClassLoader(ElementTest.class.getClassLoader());
// when(mock.getClassLoaderInternal()).thenReturn();
- return new TestElementBuilder(mock, request, useDefaults);
+ return new TestElementBuilder().client(mock).request(request).useDefautValuesForNullLeaves(useDefaults);
}
private static void assertElementProps(Element el, boolean leaf, boolean group, boolean lazy, boolean nil, boolean nillable, boolean removable, boolean resolved, int childrenCount) {
@@ -614,10 +614,6 @@
private static class TestElementBuilder extends ElementBuilderImpl {
- public TestElementBuilder(WSDynamicClient client, boolean request, boolean useDefautValuesForNulls) {
- super(client, request, useDefautValuesForNulls);
- }
-
protected boolean isSimpleType(Class<?> cl, WSDynamicClient client) {
if (cl.isEnum() || cl.isPrimitive()) {
return true;
Modified: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java 2013-02-25 10:00:50 UTC (rev 533)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java 2013-02-26 23:43:25 UTC (rev 534)
@@ -36,7 +36,8 @@
import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
import org.jboss.wise.core.test.WiseTest;
import org.jboss.wise.tree.Element;
-import org.jboss.wise.tree.impl.ElementBuilderImpl;
+import org.jboss.wise.tree.ElementBuilder;
+import org.jboss.wise.tree.ElementBuilderFactory;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -70,7 +71,8 @@
Map<String, ? extends WebParameter> pars = method.getWebParams();
WebParameter customerPar = pars.get("Customer");
- Element customerElement = new ElementBuilderImpl(client, true, true).buildTree(customerPar.getType(), customerPar.getName(), null, true);
+ ElementBuilder builder = ElementBuilderFactory.getElementBuilder().client(client).request(true).useDefautValuesForNullLeaves(true);
+ Element customerElement = builder.buildTree(customerPar.getType(), customerPar.getName(), null, true);
customerElement.getChildByName("id").setValue("1234");
customerElement.getChildByName("name").getChildByName("firstName").setValue("Foo");
customerElement.getChildByName("name").getChildByName("lastName").setValue("Bar");
@@ -96,7 +98,8 @@
WebParameter customerPar = pars.get("Customer");
Assert.assertEquals(WebParam.Mode.INOUT, customerPar.getMode());
- Element element = new ElementBuilderImpl(client, true, true).buildTree(customerPar.getType(), customerPar.getName(), null, true);
+ ElementBuilder builder = ElementBuilderFactory.getElementBuilder().client(client).request(true).useDefautValuesForNullLeaves(true);
+ Element element = builder.buildTree(customerPar.getType(), customerPar.getName(), null, true);
Element customerElement = element.getChildren().next();
customerElement.getChildByName("id").setValue("1235");
customerElement.getChildByName("name").getChildByName("firstName").setValue("Foo");
@@ -114,7 +117,7 @@
Assert.assertEquals(void.class, test.get("type.result"));
final String key = "Customer";
- Element returnElement = new ElementBuilderImpl(client, false, false).buildTree((Type)test.get("type." + key), key, test.get(key), true);
+ Element returnElement = builder.request(false).useDefautValuesForNullLeaves(false).buildTree((Type)test.get("type." + key), key, test.get(key), true);
Element returnCustomerElement = returnElement.getChildren().next();
Assert.assertEquals("1235", returnCustomerElement.getChildByName("id").getValue());
Assert.assertEquals("Foo", returnCustomerElement.getChildByName("name").getChildByName("firstName").getValue());
11 years, 10 months
wise SVN: r533 - in core/trunk: core/src/main/java/org/jboss/wise/tree/impl and 3 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-25 05:00:50 -0500 (Mon, 25 Feb 2013)
New Revision: 533
Added:
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java
Modified:
core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java
Log:
[WISE-195] Adding initial integration test demonstrating usage
Modified: core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java 2013-02-25 09:26:24 UTC (rev 532)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java 2013-02-25 10:00:50 UTC (rev 533)
@@ -52,12 +52,8 @@
public Iterator<String> getChildrenIDs();
-// public Iterator<String> getChildrenIDs(boolean resolve);
-
public Iterator<? extends Element> getChildren();
-// public Iterator<? extends Element> getChildren(boolean resolve);
-
public String getValue();
public void setValue(String value);
Modified: core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java 2013-02-25 09:26:24 UTC (rev 532)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java 2013-02-25 10:00:50 UTC (rev 533)
@@ -94,7 +94,6 @@
return removable;
}
-// @Override
protected void setRemovable(boolean removable) {
this.removable = removable;
}
@@ -250,7 +249,6 @@
return this.getChildren(true);
}
-// @Override
protected Iterator<String> getChildrenIDs(boolean resolve) {
if (resolve) {
resolveReference();
@@ -258,7 +256,6 @@
return unmodifiableIterator(children.keySet().iterator());
}
-// @Override
protected Iterator<? extends Element> getChildren(boolean resolve) {
return this.getChildrenInternal(resolve);
}
Modified: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java 2013-02-25 09:26:24 UTC (rev 532)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java 2013-02-25 10:00:50 UTC (rev 533)
@@ -97,8 +97,7 @@
Map<String, ? extends WebParameter> pars = method.getWebParams();
WebParameter customerPar = pars.get("Customer");
Assert.assertEquals(WebParam.Mode.INOUT, customerPar.getMode());
- Class<?> holderClass = (Class<?>)((ParameterizedType)customerPar.getType()).getRawType();
- Assert.assertEquals(Holder.class, holderClass);
+ Assert.assertEquals(Holder.class, (Class<?>)((ParameterizedType)customerPar.getType()).getRawType());
Class<?> customerClass = (Class<?>)((ParameterizedType)customerPar.getType()).getActualTypeArguments()[0];
Object customer = customerClass.newInstance();
customerClass.getMethod("setId", long.class).invoke(customer, new Long(1235));
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/tree/WiseIntegrationTreeTest.java 2013-02-25 10:00:50 UTC (rev 533)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.tree;
+
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.Type;
+import java.net.URL;
+import java.util.Map;
+
+import javax.jws.WebParam;
+
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.WebParameter;
+import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.test.WiseTest;
+import org.jboss.wise.tree.Element;
+import org.jboss.wise.tree.impl.ElementBuilderImpl;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class WiseIntegrationTreeTest extends WiseTest {
+
+ private static URL warUrl = null;
+ private static WSDynamicClient client;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ warUrl = WiseIntegrationTreeTest.class.getClassLoader().getResource("complex.war");
+ deployWS(warUrl);
+
+ URL wsdlURL = new URL(getServerHostAndPort() + "/complex/RegistrationService?wsdl");
+
+ WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
+ client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true).wsdlURL(wsdlURL
+ .toString()).build();
+ }
+
+ @Test
+ public void shouldInvokeRegisterOperation() throws Exception {
+ WSMethod method = client.getWSMethod("RegistrationServiceImplService", "RegistrationServiceImplPort", "Register");
+ Map<String, ? extends WebParameter> pars = method.getWebParams();
+ WebParameter customerPar = pars.get("Customer");
+
+ Element customerElement = new ElementBuilderImpl(client, true, true).buildTree(customerPar.getType(), customerPar.getName(), null, true);
+ customerElement.getChildByName("id").setValue("1234");
+ customerElement.getChildByName("name").getChildByName("firstName").setValue("Foo");
+ customerElement.getChildByName("name").getChildByName("lastName").setValue("Bar");
+ customerElement.getChildByName("name").getChildByName("middleName").setValue("The");
+
+ Map<String, Object> args = new java.util.HashMap<String, Object>();
+ args.put(customerElement.getName(), customerElement.toObject());
+ args.put("When", null);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ method.writeRequestPreview(args, bos);
+ Assert.assertTrue(bos.toString().contains("<id>1234</id>"));
+ InvocationResult result = method.invoke(args, null);
+ Map<String, Object> res = result.getMapRequestAndResult(null, null);
+ Map<String, Object> test = (Map<String, Object>) res.get("results");
+ Assert.assertEquals(new Long(1234).longValue(), test.get("result"));
+ Assert.assertEquals(long.class, test.get("type.result"));
+ }
+
+ @Test
+ public void shouldInvokeEchoOperation() throws Exception {
+ WSMethod method = client.getWSMethod("RegistrationServiceImplService", "RegistrationServiceImplPort", "Echo");
+ Map<String, ? extends WebParameter> pars = method.getWebParams();
+ WebParameter customerPar = pars.get("Customer");
+ Assert.assertEquals(WebParam.Mode.INOUT, customerPar.getMode());
+
+ Element element = new ElementBuilderImpl(client, true, true).buildTree(customerPar.getType(), customerPar.getName(), null, true);
+ Element customerElement = element.getChildren().next();
+ customerElement.getChildByName("id").setValue("1235");
+ customerElement.getChildByName("name").getChildByName("firstName").setValue("Foo");
+ customerElement.getChildByName("name").getChildByName("lastName").setValue("Bar");
+ customerElement.getChildByName("name").getChildByName("middleName").setValue("The");
+
+ Map<String, Object> args = new java.util.HashMap<String, Object>();
+ args.put(element.getName(), element.toObject());
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ method.writeRequestPreview(args, bos);
+ Assert.assertTrue(bos.toString().contains("<firstName>Foo</firstName>"));
+ InvocationResult result = method.invoke(args, null);
+ Map<String, Object> res = result.getMapRequestAndResult(null, null);
+ Map<String, Object> test = (Map<String, Object>) res.get("results");
+ Assert.assertEquals(void.class, test.get("type.result"));
+
+ final String key = "Customer";
+ Element returnElement = new ElementBuilderImpl(client, false, false).buildTree((Type)test.get("type." + key), key, test.get(key), true);
+ Element returnCustomerElement = returnElement.getChildren().next();
+ Assert.assertEquals("1235", returnCustomerElement.getChildByName("id").getValue());
+ Assert.assertEquals("Foo", returnCustomerElement.getChildByName("name").getChildByName("firstName").getValue());
+ Assert.assertEquals("Bar", returnCustomerElement.getChildByName("name").getChildByName("lastName").getValue());
+ Assert.assertEquals("The", returnCustomerElement.getChildByName("name").getChildByName("middleName").getValue());
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ try {
+ undeployWS(warUrl);
+ } finally {
+ warUrl = null;
+ client.close();
+ client = null;
+ }
+ }
+}
11 years, 10 months
wise SVN: r532 - in core/trunk: integration-testsuite/common and 4 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-25 04:26:24 -0500 (Mon, 25 Feb 2013)
New Revision: 532
Added:
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Address.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault_Exception.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegister.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegisterResponse.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Customer.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Echo.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/EchoResponse.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatistics.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatisticsResponse.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/InvoiceCustomer.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Name.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ObjectFactory.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/PhoneNumber.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Register.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoice.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoiceResponse.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterResponse.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Registration.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationFault.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationServiceImpl.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Statistics.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault_Exception.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java
core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/package-info.java
core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/complex/
core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/complex/web.xml
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java
core/trunk/integration-testsuite/common/pom.xml
Log:
[WISE-27] Adding a bit more advanced test, featuring invocation of a not so trivial endpoint with complex types, etc.
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java 2013-02-24 18:25:23 UTC (rev 531)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/test/WiseTest.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -108,7 +108,7 @@
*
* @return http://server-hostname:port
*/
- public String getServerHostAndPort() {
+ public static String getServerHostAndPort() {
final String host = System.getProperty(SYSPROP_JBOSS_BIND_ADDRESS, "localhost");
final String port = System.getProperty(SYSPROP_JBOSS_HTTP_PORT, "8080");
final StringBuilder sb = new StringBuilder("http://");
Modified: core/trunk/integration-testsuite/common/pom.xml
===================================================================
--- core/trunk/integration-testsuite/common/pom.xml 2013-02-24 18:25:23 UTC (rev 531)
+++ core/trunk/integration-testsuite/common/pom.xml 2013-02-25 09:26:24 UTC (rev 532)
@@ -84,6 +84,33 @@
</configuration>
</execution>
<execution>
+ <id>war-it-complex</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webXml>${basedir}/src/test/resources/WEB-INF/complex/web.xml</webXml>
+ <warName>complex</warName>
+ <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ <webappDirectory>${project.build.directory}/complex</webappDirectory>
+ <warSourceExcludes>**/lib/**</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
+ <webResources>
+ <webResource>
+ <targetPath>WEB-INF/classes</targetPath>
+ <directory>${basedir}/target/test-classes/</directory>
+ <includes>
+ <include>**/complex/*.class</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.class</exclude>
+ </excludes>
+ </webResource>
+ </webResources>
+ </configuration>
+ </execution>
+ <execution>
<id>war-it-incontainer</id>
<phase>pre-integration-test</phase>
<goals>
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Address.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Address.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Address.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,146 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Address complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Address">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="city" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * <element name="state" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * <element name="street" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * <element name="zip" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Address", namespace = "http://complex.jaxws.ws.test.jboss.org/", propOrder = {
+ "city",
+ "state",
+ "street",
+ "zip"
+})
+public class Address {
+
+ @XmlElement(required = true, nillable = true)
+ protected String city;
+ @XmlElement(required = true, nillable = true)
+ protected String state;
+ @XmlElement(required = true, nillable = true)
+ protected String street;
+ @XmlElement(required = true, nillable = true)
+ protected String zip;
+
+ /**
+ * Gets the value of the city property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCity() {
+ return city;
+ }
+
+ /**
+ * Sets the value of the city property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCity(String value) {
+ this.city = value;
+ }
+
+ /**
+ * Gets the value of the state property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ * Sets the value of the state property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setState(String value) {
+ this.state = value;
+ }
+
+ /**
+ * Gets the value of the street property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStreet() {
+ return street;
+ }
+
+ /**
+ * Sets the value of the street property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStreet(String value) {
+ this.street = value;
+ }
+
+ /**
+ * Gets the value of the zip property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getZip() {
+ return zip;
+ }
+
+ /**
+ * Sets the value of the zip property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setZip(String value) {
+ this.zip = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,54 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for AlreadyRegisteredFault complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="AlreadyRegisteredFault">
+ * <complexContent>
+ * <extension base="{http://complex.jaxws.ws.test.jboss.org/}RegistrationFault">
+ * <sequence>
+ * <element name="existingId" type="{http://www.w3.org/2001/XMLSchema}long"/>
+ * </sequence>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "AlreadyRegisteredFault", propOrder = {
+ "existingId"
+})
+public class AlreadyRegisteredFault
+ extends RegistrationFault
+{
+
+ protected long existingId;
+
+ /**
+ * Gets the value of the existingId property.
+ *
+ */
+ public long getExistingId() {
+ return existingId;
+ }
+
+ /**
+ * Sets the value of the existingId property.
+ *
+ */
+ public void setExistingId(long value) {
+ this.existingId = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault_Exception.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault_Exception.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/AlreadyRegisteredFault_Exception.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,43 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.ws.WebFault;
+
+
+/**
+ * This class was generated by Apache CXF 2.7.3-SNAPSHOT (1439267)
+ * 2013-02-20T16:44:23.116+01:00
+ * Generated source version: 2.7.3-SNAPSHOT
+ */
+
+@WebFault(name = "AlreadyRegisteredFault", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+public class AlreadyRegisteredFault_Exception extends Exception {
+
+ private org.jboss.wise.test.integration.complex.AlreadyRegisteredFault alreadyRegisteredFault;
+
+ public AlreadyRegisteredFault_Exception() {
+ super();
+ }
+
+ public AlreadyRegisteredFault_Exception(String message) {
+ super(message);
+ }
+
+ public AlreadyRegisteredFault_Exception(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public AlreadyRegisteredFault_Exception(String message, org.jboss.wise.test.integration.complex.AlreadyRegisteredFault alreadyRegisteredFault) {
+ super(message);
+ this.alreadyRegisteredFault = alreadyRegisteredFault;
+ }
+
+ public AlreadyRegisteredFault_Exception(String message, org.jboss.wise.test.integration.complex.AlreadyRegisteredFault alreadyRegisteredFault, Throwable cause) {
+ super(message, cause);
+ this.alreadyRegisteredFault = alreadyRegisteredFault;
+ }
+
+ public org.jboss.wise.test.integration.complex.AlreadyRegisteredFault getFaultInfo() {
+ return this.alreadyRegisteredFault;
+ }
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegister.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegister.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegister.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,99 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for BulkRegister complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="BulkRegister">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Customers" type="{http://complex.jaxws.ws.test.jboss.org/}Customer" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="When" type="{http://www.w3.org/2001/XMLSchema}anySimpleType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "BulkRegister", propOrder = {
+ "customers",
+ "when"
+})
+public class BulkRegister {
+
+ @XmlElement(name = "Customers", nillable = true)
+ protected List<Customer> customers;
+ @XmlElement(name = "When", required = true, nillable = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected Object when;
+
+ /**
+ * Gets the value of the customers property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the customers property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getCustomers().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Customer }
+ *
+ *
+ */
+ public List<Customer> getCustomers() {
+ if (customers == null) {
+ customers = new ArrayList<Customer>();
+ }
+ return this.customers;
+ }
+
+ /**
+ * Gets the value of the when property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getWhen() {
+ return when;
+ }
+
+ /**
+ * Sets the value of the when property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setWhen(Object value) {
+ this.when = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegisterResponse.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegisterResponse.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/BulkRegisterResponse.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,69 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for BulkRegisterResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="BulkRegisterResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="RegisteredIDs" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "BulkRegisterResponse", propOrder = {
+ "registeredIDs"
+})
+public class BulkRegisterResponse {
+
+ @XmlElement(name = "RegisteredIDs", type = Long.class)
+ protected List<Long> registeredIDs;
+
+ /**
+ * Gets the value of the registeredIDs property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the registeredIDs property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getRegisteredIDs().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Long }
+ *
+ *
+ */
+ public List<Long> getRegisteredIDs() {
+ if (registeredIDs == null) {
+ registeredIDs = new ArrayList<Long>();
+ }
+ return this.registeredIDs;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Customer.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Customer.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Customer.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,181 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Customer complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Customer">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="address" type="{http://complex.jaxws.ws.test.jboss.org/}Address" form="qualified"/>
+ * <element name="contactNumbers" type="{http://complex.jaxws.ws.test.jboss.org/}PhoneNumber" maxOccurs="unbounded" minOccurs="0" form="qualified"/>
+ * <element name="id" type="{http://www.w3.org/2001/XMLSchema}long" form="qualified"/>
+ * <element name="name" type="{http://complex.jaxws.ws.test.jboss.org/}Name" form="qualified"/>
+ * <element name="referredCustomers" type="{http://complex.jaxws.ws.test.jboss.org/}Customer" maxOccurs="unbounded" minOccurs="0" form="qualified"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Customer", namespace = "http://complex.jaxws.ws.test.jboss.org/", propOrder = {
+ "address",
+ "contactNumbers",
+ "id",
+ "name",
+ "referredCustomers"
+})
+@XmlSeeAlso({
+ InvoiceCustomer.class
+})
+public class Customer {
+
+ @XmlElement(required = true, nillable = true)
+ protected Address address;
+ @XmlElement(nillable = true)
+ protected List<PhoneNumber> contactNumbers;
+ protected long id;
+ @XmlElement(required = true, nillable = true)
+ protected Name name;
+ @XmlElement(nillable = true)
+ protected List<Customer> referredCustomers;
+
+ /**
+ * Gets the value of the address property.
+ *
+ * @return
+ * possible object is
+ * {@link Address }
+ *
+ */
+ public Address getAddress() {
+ return address;
+ }
+
+ /**
+ * Sets the value of the address property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Address }
+ *
+ */
+ public void setAddress(Address value) {
+ this.address = value;
+ }
+
+ /**
+ * Gets the value of the contactNumbers property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the contactNumbers property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getContactNumbers().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link PhoneNumber }
+ *
+ *
+ */
+ public List<PhoneNumber> getContactNumbers() {
+ if (contactNumbers == null) {
+ contactNumbers = new ArrayList<PhoneNumber>();
+ }
+ return this.contactNumbers;
+ }
+
+ /**
+ * Gets the value of the id property.
+ *
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ */
+ public void setId(long value) {
+ this.id = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link Name }
+ *
+ */
+ public Name getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Name }
+ *
+ */
+ public void setName(Name value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the referredCustomers property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the referredCustomers property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getReferredCustomers().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Customer }
+ *
+ *
+ */
+ public List<Customer> getReferredCustomers() {
+ if (referredCustomers == null) {
+ referredCustomers = new ArrayList<Customer>();
+ }
+ return this.referredCustomers;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Echo.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Echo.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Echo.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,62 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Echo complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Echo">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Customer" type="{http://complex.jaxws.ws.test.jboss.org/}Customer"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Echo", propOrder = {
+ "customer"
+})
+public class Echo {
+
+ @XmlElement(name = "Customer", required = true, nillable = true)
+ protected Customer customer;
+
+ /**
+ * Gets the value of the customer property.
+ *
+ * @return
+ * possible object is
+ * {@link Customer }
+ *
+ */
+ public Customer getCustomer() {
+ return customer;
+ }
+
+ /**
+ * Sets the value of the customer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Customer }
+ *
+ */
+ public void setCustomer(Customer value) {
+ this.customer = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/EchoResponse.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/EchoResponse.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/EchoResponse.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,62 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for EchoResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="EchoResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Customer" type="{http://complex.jaxws.ws.test.jboss.org/}Customer"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EchoResponse", propOrder = {
+ "customer"
+})
+public class EchoResponse {
+
+ @XmlElement(name = "Customer", required = true, nillable = true)
+ protected Customer customer;
+
+ /**
+ * Gets the value of the customer property.
+ *
+ * @return
+ * possible object is
+ * {@link Customer }
+ *
+ */
+ public Customer getCustomer() {
+ return customer;
+ }
+
+ /**
+ * Sets the value of the customer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Customer }
+ *
+ */
+ public void setCustomer(Customer value) {
+ this.customer = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatistics.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatistics.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatistics.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,62 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for GetStatistics complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="GetStatistics">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Customer" type="{http://complex.jaxws.ws.test.jboss.org/}Customer"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "GetStatistics", propOrder = {
+ "customer"
+})
+public class GetStatistics {
+
+ @XmlElement(name = "Customer", required = true, nillable = true)
+ protected Customer customer;
+
+ /**
+ * Gets the value of the customer property.
+ *
+ * @return
+ * possible object is
+ * {@link Customer }
+ *
+ */
+ public Customer getCustomer() {
+ return customer;
+ }
+
+ /**
+ * Sets the value of the customer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Customer }
+ *
+ */
+ public void setCustomer(Customer value) {
+ this.customer = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatisticsResponse.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatisticsResponse.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/GetStatisticsResponse.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,62 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for GetStatisticsResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="GetStatisticsResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Statistics" type="{http://extra.complex.jaxws.ws.test.jboss.org/}Statistics"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "GetStatisticsResponse", propOrder = {
+ "statistics"
+})
+public class GetStatisticsResponse {
+
+ @XmlElement(name = "Statistics", required = true, nillable = true)
+ protected Statistics statistics;
+
+ /**
+ * Gets the value of the statistics property.
+ *
+ * @return
+ * possible object is
+ * {@link Statistics }
+ *
+ */
+ public Statistics getStatistics() {
+ return statistics;
+ }
+
+ /**
+ * Sets the value of the statistics property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Statistics }
+ *
+ */
+ public void setStatistics(Statistics value) {
+ this.statistics = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/InvoiceCustomer.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/InvoiceCustomer.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/InvoiceCustomer.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,54 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for InvoiceCustomer complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="InvoiceCustomer">
+ * <complexContent>
+ * <extension base="{http://complex.jaxws.ws.test.jboss.org/}Customer">
+ * <sequence>
+ * <element name="cycleDay" type="{http://www.w3.org/2001/XMLSchema}int" form="qualified"/>
+ * </sequence>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "InvoiceCustomer", namespace = "http://complex.jaxws.ws.test.jboss.org/", propOrder = {
+ "cycleDay"
+})
+public class InvoiceCustomer
+ extends Customer
+{
+
+ protected int cycleDay;
+
+ /**
+ * Gets the value of the cycleDay property.
+ *
+ */
+ public int getCycleDay() {
+ return cycleDay;
+ }
+
+ /**
+ * Sets the value of the cycleDay property.
+ *
+ */
+ public void setCycleDay(int value) {
+ this.cycleDay = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Name.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Name.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Name.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,118 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Name complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Name">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="firstName" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * <element name="lastName" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * <element name="middleName" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Name", namespace = "http://complex.jaxws.ws.test.jboss.org/", propOrder = {
+ "firstName",
+ "lastName",
+ "middleName"
+})
+public class Name {
+
+ @XmlElement(required = true, nillable = true)
+ protected String firstName;
+ @XmlElement(required = true, nillable = true)
+ protected String lastName;
+ @XmlElement(required = true, nillable = true)
+ protected String middleName;
+
+ /**
+ * Gets the value of the firstName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * Sets the value of the firstName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFirstName(String value) {
+ this.firstName = value;
+ }
+
+ /**
+ * Gets the value of the lastName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLastName() {
+ return lastName;
+ }
+
+ /**
+ * Sets the value of the lastName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLastName(String value) {
+ this.lastName = value;
+ }
+
+ /**
+ * Gets the value of the middleName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMiddleName() {
+ return middleName;
+ }
+
+ /**
+ * Sets the value of the middleName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMiddleName(String value) {
+ this.middleName = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ObjectFactory.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ObjectFactory.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ObjectFactory.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,307 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.ws.jaxws.complex package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _EchoResponse_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "EchoResponse");
+ private final static QName _RegisterResponse_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "RegisterResponse");
+ private final static QName _Register_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "Register");
+ private final static QName _AlreadyRegisteredFault_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "AlreadyRegisteredFault");
+ private final static QName _RegisterForInvoiceResponse_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "RegisterForInvoiceResponse");
+ private final static QName _GetStatistics_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "GetStatistics");
+ private final static QName _GetStatisticsResponse_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "GetStatisticsResponse");
+ private final static QName _BulkRegister_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "BulkRegister");
+ private final static QName _BulkRegisterResponse_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "BulkRegisterResponse");
+ private final static QName _RegisterForInvoice_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "RegisterForInvoice");
+ private final static QName _ValidationFault_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "ValidationFault");
+ private final static QName _Echo_QNAME = new QName("http://types.complex.jaxws.ws.test.jboss.org/", "Echo");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.complex
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link ValidationFault }
+ *
+ */
+ public ValidationFault createValidationFault() {
+ return new ValidationFault();
+ }
+
+ /**
+ * Create an instance of {@link RegisterForInvoice }
+ *
+ */
+ public RegisterForInvoice createRegisterForInvoice() {
+ return new RegisterForInvoice();
+ }
+
+ /**
+ * Create an instance of {@link BulkRegisterResponse }
+ *
+ */
+ public BulkRegisterResponse createBulkRegisterResponse() {
+ return new BulkRegisterResponse();
+ }
+
+ /**
+ * Create an instance of {@link BulkRegister }
+ *
+ */
+ public BulkRegister createBulkRegister() {
+ return new BulkRegister();
+ }
+
+ /**
+ * Create an instance of {@link Echo }
+ *
+ */
+ public Echo createEcho() {
+ return new Echo();
+ }
+
+ /**
+ * Create an instance of {@link Register }
+ *
+ */
+ public Register createRegister() {
+ return new Register();
+ }
+
+ /**
+ * Create an instance of {@link RegisterResponse }
+ *
+ */
+ public RegisterResponse createRegisterResponse() {
+ return new RegisterResponse();
+ }
+
+ /**
+ * Create an instance of {@link EchoResponse }
+ *
+ */
+ public EchoResponse createEchoResponse() {
+ return new EchoResponse();
+ }
+
+ /**
+ * Create an instance of {@link GetStatisticsResponse }
+ *
+ */
+ public GetStatisticsResponse createGetStatisticsResponse() {
+ return new GetStatisticsResponse();
+ }
+
+ /**
+ * Create an instance of {@link GetStatistics }
+ *
+ */
+ public GetStatistics createGetStatistics() {
+ return new GetStatistics();
+ }
+
+ /**
+ * Create an instance of {@link RegisterForInvoiceResponse }
+ *
+ */
+ public RegisterForInvoiceResponse createRegisterForInvoiceResponse() {
+ return new RegisterForInvoiceResponse();
+ }
+
+ /**
+ * Create an instance of {@link AlreadyRegisteredFault }
+ *
+ */
+ public AlreadyRegisteredFault createAlreadyRegisteredFault() {
+ return new AlreadyRegisteredFault();
+ }
+
+ /**
+ * Create an instance of {@link Name }
+ *
+ */
+ public Name createName() {
+ return new Name();
+ }
+
+ /**
+ * Create an instance of {@link Customer }
+ *
+ */
+ public Customer createCustomer() {
+ return new Customer();
+ }
+
+ /**
+ * Create an instance of {@link Address }
+ *
+ */
+ public Address createAddress() {
+ return new Address();
+ }
+
+ /**
+ * Create an instance of {@link InvoiceCustomer }
+ *
+ */
+ public InvoiceCustomer createInvoiceCustomer() {
+ return new InvoiceCustomer();
+ }
+
+ /**
+ * Create an instance of {@link RegistrationFault }
+ *
+ */
+ public RegistrationFault createRegistrationFault() {
+ return new RegistrationFault();
+ }
+
+ /**
+ * Create an instance of {@link PhoneNumber }
+ *
+ */
+ public PhoneNumber createPhoneNumber() {
+ return new PhoneNumber();
+ }
+
+ /**
+ * Create an instance of {@link Statistics }
+ *
+ */
+ public Statistics createStatistics() {
+ return new Statistics();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link EchoResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "EchoResponse")
+ public JAXBElement<EchoResponse> createEchoResponse(EchoResponse value) {
+ return new JAXBElement<EchoResponse>(_EchoResponse_QNAME, EchoResponse.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link RegisterResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "RegisterResponse")
+ public JAXBElement<RegisterResponse> createRegisterResponse(RegisterResponse value) {
+ return new JAXBElement<RegisterResponse>(_RegisterResponse_QNAME, RegisterResponse.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Register }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "Register")
+ public JAXBElement<Register> createRegister(Register value) {
+ return new JAXBElement<Register>(_Register_QNAME, Register.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AlreadyRegisteredFault }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "AlreadyRegisteredFault")
+ public JAXBElement<AlreadyRegisteredFault> createAlreadyRegisteredFault(AlreadyRegisteredFault value) {
+ return new JAXBElement<AlreadyRegisteredFault>(_AlreadyRegisteredFault_QNAME, AlreadyRegisteredFault.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link RegisterForInvoiceResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "RegisterForInvoiceResponse")
+ public JAXBElement<RegisterForInvoiceResponse> createRegisterForInvoiceResponse(RegisterForInvoiceResponse value) {
+ return new JAXBElement<RegisterForInvoiceResponse>(_RegisterForInvoiceResponse_QNAME, RegisterForInvoiceResponse.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link GetStatistics }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "GetStatistics")
+ public JAXBElement<GetStatistics> createGetStatistics(GetStatistics value) {
+ return new JAXBElement<GetStatistics>(_GetStatistics_QNAME, GetStatistics.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link GetStatisticsResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "GetStatisticsResponse")
+ public JAXBElement<GetStatisticsResponse> createGetStatisticsResponse(GetStatisticsResponse value) {
+ return new JAXBElement<GetStatisticsResponse>(_GetStatisticsResponse_QNAME, GetStatisticsResponse.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link BulkRegister }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "BulkRegister")
+ public JAXBElement<BulkRegister> createBulkRegister(BulkRegister value) {
+ return new JAXBElement<BulkRegister>(_BulkRegister_QNAME, BulkRegister.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link BulkRegisterResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "BulkRegisterResponse")
+ public JAXBElement<BulkRegisterResponse> createBulkRegisterResponse(BulkRegisterResponse value) {
+ return new JAXBElement<BulkRegisterResponse>(_BulkRegisterResponse_QNAME, BulkRegisterResponse.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link RegisterForInvoice }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "RegisterForInvoice")
+ public JAXBElement<RegisterForInvoice> createRegisterForInvoice(RegisterForInvoice value) {
+ return new JAXBElement<RegisterForInvoice>(_RegisterForInvoice_QNAME, RegisterForInvoice.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link ValidationFault }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "ValidationFault")
+ public JAXBElement<ValidationFault> createValidationFault(ValidationFault value) {
+ return new JAXBElement<ValidationFault>(_ValidationFault_QNAME, ValidationFault.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Echo }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "Echo")
+ public JAXBElement<Echo> createEcho(Echo value) {
+ return new JAXBElement<Echo>(_Echo_QNAME, Echo.class, null, value);
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/PhoneNumber.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/PhoneNumber.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/PhoneNumber.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,118 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PhoneNumber complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="PhoneNumber">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="areaCode" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * <element name="exchange" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * <element name="line" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PhoneNumber", namespace = "http://complex.jaxws.ws.test.jboss.org/", propOrder = {
+ "areaCode",
+ "exchange",
+ "line"
+})
+public class PhoneNumber {
+
+ @XmlElement(required = true, nillable = true)
+ protected String areaCode;
+ @XmlElement(required = true, nillable = true)
+ protected String exchange;
+ @XmlElement(required = true, nillable = true)
+ protected String line;
+
+ /**
+ * Gets the value of the areaCode property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAreaCode() {
+ return areaCode;
+ }
+
+ /**
+ * Sets the value of the areaCode property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAreaCode(String value) {
+ this.areaCode = value;
+ }
+
+ /**
+ * Gets the value of the exchange property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getExchange() {
+ return exchange;
+ }
+
+ /**
+ * Sets the value of the exchange property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setExchange(String value) {
+ this.exchange = value;
+ }
+
+ /**
+ * Gets the value of the line property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLine() {
+ return line;
+ }
+
+ /**
+ * Sets the value of the line property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLine(String value) {
+ this.line = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Register.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Register.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Register.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,92 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Register complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Register">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Customer" type="{http://complex.jaxws.ws.test.jboss.org/}Customer"/>
+ * <element name="When" type="{http://www.w3.org/2001/XMLSchema}anySimpleType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Register", propOrder = {
+ "customer",
+ "when"
+})
+public class Register {
+
+ @XmlElement(name = "Customer", required = true, nillable = true)
+ protected Customer customer;
+ @XmlElement(name = "When", required = true, nillable = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected Object when;
+
+ /**
+ * Gets the value of the customer property.
+ *
+ * @return
+ * possible object is
+ * {@link Customer }
+ *
+ */
+ public Customer getCustomer() {
+ return customer;
+ }
+
+ /**
+ * Sets the value of the customer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Customer }
+ *
+ */
+ public void setCustomer(Customer value) {
+ this.customer = value;
+ }
+
+ /**
+ * Gets the value of the when property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getWhen() {
+ return when;
+ }
+
+ /**
+ * Sets the value of the when property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setWhen(Object value) {
+ this.when = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoice.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoice.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoice.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,62 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RegisterForInvoice complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="RegisterForInvoice">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="InvoiceCustomer" type="{http://complex.jaxws.ws.test.jboss.org/}InvoiceCustomer"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RegisterForInvoice", propOrder = {
+ "invoiceCustomer"
+})
+public class RegisterForInvoice {
+
+ @XmlElement(name = "InvoiceCustomer", required = true, nillable = true)
+ protected InvoiceCustomer invoiceCustomer;
+
+ /**
+ * Gets the value of the invoiceCustomer property.
+ *
+ * @return
+ * possible object is
+ * {@link InvoiceCustomer }
+ *
+ */
+ public InvoiceCustomer getInvoiceCustomer() {
+ return invoiceCustomer;
+ }
+
+ /**
+ * Sets the value of the invoiceCustomer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link InvoiceCustomer }
+ *
+ */
+ public void setInvoiceCustomer(InvoiceCustomer value) {
+ this.invoiceCustomer = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoiceResponse.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoiceResponse.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterForInvoiceResponse.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,52 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RegisterForInvoiceResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="RegisterForInvoiceResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="done" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RegisterForInvoiceResponse", propOrder = {
+ "done"
+})
+public class RegisterForInvoiceResponse {
+
+ protected boolean done;
+
+ /**
+ * Gets the value of the done property.
+ *
+ */
+ public boolean isDone() {
+ return done;
+ }
+
+ /**
+ * Sets the value of the done property.
+ *
+ */
+ public void setDone(boolean value) {
+ this.done = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterResponse.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterResponse.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegisterResponse.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,54 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RegisterResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="RegisterResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="RegisteredID" type="{http://www.w3.org/2001/XMLSchema}long"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RegisterResponse", propOrder = {
+ "registeredID"
+})
+public class RegisterResponse {
+
+ @XmlElement(name = "RegisteredID")
+ protected long registeredID;
+
+ /**
+ * Gets the value of the registeredID property.
+ *
+ */
+ public long getRegisteredID() {
+ return registeredID;
+ }
+
+ /**
+ * Sets the value of the registeredID property.
+ *
+ */
+ public void setRegisteredID(long value) {
+ this.registeredID = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Registration.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Registration.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Registration.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,68 @@
+package org.jboss.wise.test.integration.complex;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+/**
+ * This class was generated by Apache CXF 2.7.3-SNAPSHOT (1439267)
+ * 2013-02-20T16:44:23.123+01:00
+ * Generated source version: 2.7.3-SNAPSHOT
+ *
+ */
+@WebService(targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", name = "Registration")
+(a)XmlSeeAlso({ObjectFactory.class})
+public interface Registration {
+
+ @WebResult(name = "RegisteredID", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ @RequestWrapper(localName = "Register", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.Register")
+ @WebMethod(operationName = "Register")
+ @ResponseWrapper(localName = "RegisterResponse", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.RegisterResponse")
+ public long register(
+ @WebParam(name = "Customer", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ org.jboss.wise.test.integration.complex.Customer customer,
+ @WebParam(name = "When", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ java.lang.Object when
+ ) throws ValidationFault_Exception, AlreadyRegisteredFault_Exception;
+
+ @WebResult(name = "Statistics", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ @RequestWrapper(localName = "GetStatistics", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.GetStatistics")
+ @WebMethod(operationName = "GetStatistics")
+ @ResponseWrapper(localName = "GetStatisticsResponse", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.GetStatisticsResponse")
+ public org.jboss.wise.test.integration.complex.Statistics getStatistics(
+ @WebParam(name = "Customer", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ org.jboss.wise.test.integration.complex.Customer customer
+ );
+
+ @RequestWrapper(localName = "Echo", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.Echo")
+ @WebMethod(operationName = "Echo")
+ @ResponseWrapper(localName = "EchoResponse", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.EchoResponse")
+ public void echo(
+ @WebParam(mode = WebParam.Mode.INOUT, name = "Customer", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ javax.xml.ws.Holder<Customer> customer
+ );
+
+ @WebResult(name = "done", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ @RequestWrapper(localName = "RegisterForInvoice", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.RegisterForInvoice")
+ @WebMethod(operationName = "RegisterForInvoice")
+ @ResponseWrapper(localName = "RegisterForInvoiceResponse", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.RegisterForInvoiceResponse")
+ public boolean registerForInvoice(
+ @WebParam(name = "InvoiceCustomer", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ org.jboss.wise.test.integration.complex.InvoiceCustomer invoiceCustomer
+ ) throws ValidationFault_Exception, AlreadyRegisteredFault_Exception;
+
+ @WebResult(name = "RegisteredIDs", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ @RequestWrapper(localName = "BulkRegister", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.BulkRegister")
+ @WebMethod(operationName = "BulkRegister")
+ @ResponseWrapper(localName = "BulkRegisterResponse", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/", className = "org.jboss.wise.test.integration.complex.BulkRegisterResponse")
+ public java.util.List<java.lang.Long> bulkRegister(
+ @WebParam(name = "Customers", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ java.util.List<org.jboss.wise.test.integration.complex.Customer> customers,
+ @WebParam(name = "When", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+ java.lang.Object when
+ ) throws ValidationFault_Exception, AlreadyRegisteredFault_Exception;
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationFault.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationFault.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationFault.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,67 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RegistrationFault complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="RegistrationFault">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RegistrationFault", namespace = "http://complex.jaxws.ws.test.jboss.org/", propOrder = {
+ "message"
+})
+@XmlSeeAlso({
+ ValidationFault.class,
+ AlreadyRegisteredFault.class
+})
+public class RegistrationFault {
+
+ @XmlElement(required = true, nillable = true)
+ protected String message;
+
+ /**
+ * 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;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationServiceImpl.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationServiceImpl.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/RegistrationServiceImpl.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.complex;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.WebService;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A mock registration service that exercises the use of complex types, arrays, inheritence,
+ * and exceptions.
+ *
+ */
+@WebService(endpointInterface = "org.jboss.wise.test.integration.complex.Registration", targetNamespace = "http://complex.jaxws.ws.test.jboss.org")
+public class RegistrationServiceImpl implements Registration
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(RegistrationServiceImpl.class);
+
+ public long register(Customer customer, Object when) throws AlreadyRegisteredFault_Exception, ValidationFault_Exception
+ {
+ Name name = customer.getName();
+ if (name == null)
+ {
+ ValidationFault fault = new ValidationFault();
+ fault.getFailedCustomers().add(customer.getId());
+ throw new ValidationFault_Exception("No name!", fault);
+ }
+
+ if ("al".equalsIgnoreCase(name.getFirstName()) && "capone".equalsIgnoreCase(name.getLastName()))
+ {
+ AlreadyRegisteredFault fault = new AlreadyRegisteredFault();
+ fault.setExistingId(456);
+ throw new AlreadyRegisteredFault_Exception("Al Capone is already registered", fault);
+ }
+
+ for (Customer c : customer.getReferredCustomers())
+ {
+ log.info("Refered customer: " + c.getName());
+ }
+
+ log.info("registering customer: " + customer);
+ return customer.getId();
+ }
+
+ public void echo(javax.xml.ws.Holder<org.jboss.wise.test.integration.complex.Customer> customer) {
+ log.info("customer: " + customer);
+ }
+
+ public List<Long> bulkRegister(List<Customer> customers, Object when) throws AlreadyRegisteredFault_Exception, ValidationFault_Exception
+ {
+ List<Long> registered = new ArrayList<Long>(customers.size());
+ List<Long> failed = new ArrayList<Long>(customers.size());
+
+ for (Customer c : customers)
+ {
+ try
+ {
+ registered.add(register(c, when));
+ }
+ catch (ValidationFault_Exception e)
+ {
+ failed.add(e.getFaultInfo().getFailedCustomers().get(0));
+ }
+ }
+
+ if (failed.size() > 0)
+ {
+ ValidationFault fault = new ValidationFault();
+ fault.getFailedCustomers().addAll(failed);
+ throw new ValidationFault_Exception("Validation errors on bulk registering customers", fault);
+ }
+
+ return registered;
+ }
+
+ public boolean registerForInvoice(InvoiceCustomer invoiceCustomer) throws AlreadyRegisteredFault_Exception, ValidationFault_Exception
+ {
+ log.info("registerForInvoice: " + invoiceCustomer.getCycleDay());
+ return true;
+ }
+
+ public Statistics getStatistics(Customer customer)
+ {
+ Statistics stats = new Statistics();
+ stats.setHits(10);
+ stats.setActivationTime(getCalendar());
+ return stats;
+ }
+
+ private XMLGregorianCalendar getCalendar()
+ {
+ try
+ {
+ DatatypeFactory calFactory = DatatypeFactory.newInstance();
+ XMLGregorianCalendar cal = calFactory.newXMLGregorianCalendar(2002, 4, 5, 0, 0, 0, 0, 0);
+ return cal;
+ }
+ catch (DatatypeConfigurationException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Statistics.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Statistics.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/Statistics.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,83 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Statistics complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Statistics">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="activationTime" type="{http://www.w3.org/2001/XMLSchema}anySimpleType"/>
+ * <element name="hits" type="{http://www.w3.org/2001/XMLSchema}long"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Statistics", namespace = "http://extra.complex.jaxws.ws.test.jboss.org/", propOrder = {
+ "activationTime",
+ "hits"
+})
+public class Statistics {
+
+ @XmlElement(required = true, nillable = true)
+ @XmlSchemaType(name = "anySimpleType")
+ protected Object activationTime;
+ protected long hits;
+
+ /**
+ * Gets the value of the activationTime property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getActivationTime() {
+ return activationTime;
+ }
+
+ /**
+ * Sets the value of the activationTime property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setActivationTime(Object value) {
+ this.activationTime = value;
+ }
+
+ /**
+ * Gets the value of the hits property.
+ *
+ */
+ public long getHits() {
+ return hits;
+ }
+
+ /**
+ * Sets the value of the hits property.
+ *
+ */
+ public void setHits(long value) {
+ this.hits = value;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,71 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ValidationFault complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ValidationFault">
+ * <complexContent>
+ * <extension base="{http://complex.jaxws.ws.test.jboss.org/}RegistrationFault">
+ * <sequence>
+ * <element name="failedCustomers" type="{http://www.w3.org/2001/XMLSchema}long" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ValidationFault", propOrder = {
+ "failedCustomers"
+})
+public class ValidationFault
+ extends RegistrationFault
+{
+
+ @XmlElement(type = Long.class)
+ protected List<Long> failedCustomers;
+
+ /**
+ * Gets the value of the failedCustomers property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the failedCustomers property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getFailedCustomers().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Long }
+ *
+ *
+ */
+ public List<Long> getFailedCustomers() {
+ if (failedCustomers == null) {
+ failedCustomers = new ArrayList<Long>();
+ }
+ return this.failedCustomers;
+ }
+
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault_Exception.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault_Exception.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/ValidationFault_Exception.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,43 @@
+
+package org.jboss.wise.test.integration.complex;
+
+import javax.xml.ws.WebFault;
+
+
+/**
+ * This class was generated by Apache CXF 2.7.3-SNAPSHOT (1439267)
+ * 2013-02-20T16:44:23.088+01:00
+ * Generated source version: 2.7.3-SNAPSHOT
+ */
+
+@WebFault(name = "ValidationFault", targetNamespace = "http://types.complex.jaxws.ws.test.jboss.org/")
+public class ValidationFault_Exception extends Exception {
+
+ private org.jboss.wise.test.integration.complex.ValidationFault validationFault;
+
+ public ValidationFault_Exception() {
+ super();
+ }
+
+ public ValidationFault_Exception(String message) {
+ super(message);
+ }
+
+ public ValidationFault_Exception(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ValidationFault_Exception(String message, org.jboss.wise.test.integration.complex.ValidationFault validationFault) {
+ super(message);
+ this.validationFault = validationFault;
+ }
+
+ public ValidationFault_Exception(String message, org.jboss.wise.test.integration.complex.ValidationFault validationFault, Throwable cause) {
+ super(message, cause);
+ this.validationFault = validationFault;
+ }
+
+ public org.jboss.wise.test.integration.complex.ValidationFault getFaultInfo() {
+ return this.validationFault;
+ }
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/WiseIntegrationComplexTest.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,140 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.complex;
+
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.ParameterizedType;
+import java.net.URL;
+import java.util.Map;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.WebParameter;
+import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.test.WiseTest;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class WiseIntegrationComplexTest extends WiseTest {
+
+ private static URL warUrl = null;
+ private static WSDynamicClient client;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ warUrl = WiseIntegrationComplexTest.class.getClassLoader().getResource("complex.war");
+ deployWS(warUrl);
+
+ URL wsdlURL = new URL(getServerHostAndPort() + "/complex/RegistrationService?wsdl");
+
+ WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
+ client = clientBuilder.tmpDir("target/temp/wise").verbose(true).keepSource(true).wsdlURL(wsdlURL
+ .toString()).build();
+ }
+
+ @Test
+ public void shouldInvokeRegisterOperation() throws Exception {
+ WSMethod method = client.getWSMethod("RegistrationServiceImplService", "RegistrationServiceImplPort", "Register");
+ Map<String, ? extends WebParameter> pars = method.getWebParams();
+ WebParameter customerPar = pars.get("Customer");
+ Class<?> customerClass = (Class<?>)customerPar.getType();
+ Object customer = customerClass.newInstance();
+ customerClass.getMethod("setId", long.class).invoke(customer, new Long(1234));
+ Class<?> nameClass = (Class<?>)customerClass.getDeclaredField("name").getType();
+ Object name = nameClass.newInstance();
+ nameClass.getMethod("setFirstName", String.class).invoke(name, "Foo");
+ nameClass.getMethod("setLastName", String.class).invoke(name, "Bar");
+ nameClass.getMethod("setMiddleName", String.class).invoke(name, "The");
+ customerClass.getMethod("setName", nameClass).invoke(customer, name);
+
+ Map<String, Object> args = new java.util.HashMap<String, Object>();
+ args.put("Customer", customer);
+ args.put("When", null);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ method.writeRequestPreview(args, bos);
+ Assert.assertTrue(bos.toString().contains("<id>1234</id>"));
+ InvocationResult result = method.invoke(args, null);
+ Map<String, Object> res = result.getMapRequestAndResult(null, null);
+ Map<String, Object> test = (Map<String, Object>) res.get("results");
+ Assert.assertEquals(new Long(1234).longValue(), test.get("result"));
+ Assert.assertEquals(long.class, test.get("type.result"));
+ }
+
+ @Test
+ public void shouldInvokeEchoOperation() throws Exception {
+ WSMethod method = client.getWSMethod("RegistrationServiceImplService", "RegistrationServiceImplPort", "Echo");
+ Map<String, ? extends WebParameter> pars = method.getWebParams();
+ WebParameter customerPar = pars.get("Customer");
+ Assert.assertEquals(WebParam.Mode.INOUT, customerPar.getMode());
+ Class<?> holderClass = (Class<?>)((ParameterizedType)customerPar.getType()).getRawType();
+ Assert.assertEquals(Holder.class, holderClass);
+ Class<?> customerClass = (Class<?>)((ParameterizedType)customerPar.getType()).getActualTypeArguments()[0];
+ Object customer = customerClass.newInstance();
+ customerClass.getMethod("setId", long.class).invoke(customer, new Long(1235));
+ Class<?> nameClass = (Class<?>)customerClass.getDeclaredField("name").getType();
+ Object name = nameClass.newInstance();
+ nameClass.getMethod("setFirstName", String.class).invoke(name, "Foo");
+ nameClass.getMethod("setLastName", String.class).invoke(name, "Bar");
+ nameClass.getMethod("setMiddleName", String.class).invoke(name, "The");
+ customerClass.getMethod("setName", nameClass).invoke(customer, name);
+
+ Map<String, Object> args = new java.util.HashMap<String, Object>();
+ args.put("Customer", new Holder(customer));
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ method.writeRequestPreview(args, bos);
+ Assert.assertTrue(bos.toString().contains("<firstName>Foo</firstName>"));
+ InvocationResult result = method.invoke(args, null);
+ Map<String, Object> res = result.getMapRequestAndResult(null, null);
+ Map<String, Object> test = (Map<String, Object>) res.get("results");
+ Assert.assertEquals(void.class, test.get("type.result"));
+ ParameterizedType returnType = (ParameterizedType)test.get("type.Customer");
+ Assert.assertEquals(Holder.class, returnType.getRawType());
+ Assert.assertEquals(customerClass, returnType.getActualTypeArguments()[0]);
+ Assert.assertNull(test.get("result"));
+ Object returnObj = ((Holder<?>)test.get("Customer")).value;
+ Object returnNameObj = customerClass.getMethod("getName").invoke(returnObj);
+ Assert.assertEquals("Foo", nameClass.getMethod("getFirstName").invoke(returnNameObj));
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ try {
+ undeployWS(warUrl);
+ } finally {
+ warUrl = null;
+ client.close();
+ client = null;
+ }
+ }
+}
Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/package-info.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/package-info.java (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/complex/package-info.java 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,2 @@
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://types.complex.jaxws.ws.test.jboss.org/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.wise.test.integration.complex;
Added: core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/complex/web.xml
===================================================================
--- core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/complex/web.xml (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/complex/web.xml 2013-02-25 09:26:24 UTC (rev 532)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>RegistrationService</servlet-name>
+ <servlet-class>org.jboss.wise.test.integration.complex.RegistrationServiceImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>RegistrationService</servlet-name>
+ <url-pattern>/RegistrationService</url-pattern>
+ </servlet-mapping>
+</web-app>
11 years, 10 months
wise SVN: r531 - in core/trunk/core/src/test/java/org/jboss/wise: tree and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-24 13:25:23 -0500 (Sun, 24 Feb 2013)
New Revision: 531
Added:
core/trunk/core/src/test/java/org/jboss/wise/tree/
core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java
Log:
[WISE-195] A bunch of unit tests for the tree view
Added: core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java
===================================================================
--- core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java (rev 0)
+++ core/trunk/core/src/test/java/org/jboss/wise/tree/ElementTest.java 2013-02-24 18:25:23 UTC (rev 531)
@@ -0,0 +1,668 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.tree;
+
+import static org.hamcrest.collection.IsCollectionContaining.hasItems;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
+
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.impl.reflection.WSDynamicClientImpl;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+import org.jboss.wise.tree.impl.ElementBuilderImpl;
+import org.junit.Test;
+
+/**
+ * Unit testing of Wise Tree Element
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+public class ElementTest {
+
+ @Test
+ public void shouldBuildTreeOfStringElement() throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ final String name = "myString";
+ final String value = "foo";
+
+ Element el = builder.buildTree(String.class, name, null, true);
+ assertElementProps(el, true, false, false, true, true, false, false, 0);
+ assertEquals(String.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(null, el.getValue());
+ Object obj = el.toObject();
+ assertEquals(null, obj);
+
+ el = getElementBuilder(true, true).buildTree(String.class, name, null, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(String.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals("", el.getValue());
+ obj = el.toObject();
+ assertEquals(String.class, obj.getClass());
+ assertEquals("", obj);
+
+ el = builder.buildTree(String.class, name, value, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(String.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(String.class, obj.getClass());
+ assertEquals(value, obj);
+
+ el = builder.buildTree(String.class, name, null, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(String.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals("", el.getValue());
+ obj = el.toObject();
+ assertEquals(String.class, obj.getClass());
+ assertEquals("", obj);
+
+ el = builder.buildTree(String.class, name, value, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(String.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(String.class, obj.getClass());
+ assertEquals(value, obj);
+ }
+
+ @Test
+ public void shouldBuildTreeOfNumberElement() throws Exception {
+ shouldBuildTreeOfNumberElement(Integer.class, "myInteger", "234", "0", new Integer(234), new Integer(0));
+ shouldBuildTreeOfNumberElement(Long.class, "myLong", "-87532478", "0", new Long(-87532478), new Long(0));
+ shouldBuildTreeOfNumberElement(Short.class, "myShort", "27", "0", new Short("27"), new Short("0"));
+ shouldBuildTreeOfNumberElement(Float.class, "myFloat", "-234.58", "0.0", new Float(-234.58), new Float(0.0));
+ shouldBuildTreeOfNumberElement(Double.class, "myDouble", "87532478.48", "0.0", new Double(87532478.48), new Double("0.0"));
+ shouldBuildTreeOfNumberElement(BigDecimal.class, "myBigDecimal", "87532478.48", "0.0", new BigDecimal("87532478.48"), new BigDecimal("0.0"));
+ shouldBuildTreeOfNumberElement(BigInteger.class, "myBigInteger", "87532478", "0", new BigInteger("87532478"), new BigInteger("0"));
+ }
+
+ @Test
+ public void shouldBuildTreeOfPrimitiveNumberElement() throws Exception {
+ shouldBuildTreeOfPrimitiveNumberElement(int.class, "my-int", "-234", "0", -234, 0);
+ shouldBuildTreeOfPrimitiveNumberElement(long.class, "my-long", "87532478", "0", 87532478l, 0l);
+ shouldBuildTreeOfPrimitiveNumberElement(short.class, "my-short", "-27", "0", (short)-27, (short)0);
+ shouldBuildTreeOfPrimitiveNumberElement(float.class, "my-float", "234.58", "0.0", 234.58f, 0.0f);
+ shouldBuildTreeOfPrimitiveNumberElement(double.class, "my-double", "-87532478.48", "0.0", -87532478.48, 0.0);
+ }
+
+ @Test
+ public void shouldBuildTreeOfQNameElement() throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ final String name = "myQName";
+ final String value = "{org.jboss.wise}foo";
+
+ Element el = builder.buildTree(QName.class, name, null, true);
+ assertElementProps(el, true, false, false, true, true, false, false, 0);
+ assertEquals(QName.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(null, el.getValue());
+ Object obj = el.toObject();
+ assertEquals(null, obj);
+
+ el = getElementBuilder(true, true).buildTree(QName.class, name, null, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(QName.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals("", el.getValue());
+ obj = el.toObject();
+ assertEquals(QName.class, obj.getClass());
+ assertEquals("", ((QName)obj).getNamespaceURI());
+ assertEquals("", ((QName)obj).getLocalPart());
+
+ el = builder.buildTree(QName.class, name, value, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(QName.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(QName.class, obj.getClass());
+ assertEquals("org.jboss.wise", ((QName)obj).getNamespaceURI());
+ assertEquals("foo", ((QName)obj).getLocalPart());
+
+ el = builder.buildTree(QName.class, name, null, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(QName.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals("", el.getValue());
+ obj = el.toObject();
+ assertEquals(QName.class, obj.getClass());
+ assertEquals("", ((QName)obj).getNamespaceURI());
+ assertEquals("", ((QName)obj).getLocalPart());
+
+ el = builder.buildTree(QName.class, name, value, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(QName.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(QName.class, obj.getClass());
+ assertEquals("org.jboss.wise", ((QName)obj).getNamespaceURI());
+ assertEquals("foo", ((QName)obj).getLocalPart());
+ }
+
+ @Test
+ public void shouldBuildTreeOfDurationElement() throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ final String name = "myDuration";
+ final long longVal = 345678;
+ final String value = String.valueOf(DatatypeFactory.newInstance().newDuration(longVal).getTimeInMillis(new GregorianCalendar()));
+
+ Element el = builder.buildTree(Duration.class, name, null, true);
+ assertElementProps(el, true, false, false, true, true, false, false, 0);
+ assertEquals(Duration.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(null, el.getValue());
+ Object obj = el.toObject();
+ assertEquals(null, obj);
+
+ el = getElementBuilder(true, true).buildTree(Duration.class, name, null, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(Duration.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals("0", el.getValue());
+ obj = el.toObject();
+ assertTrue(Duration.class.isAssignableFrom(obj.getClass()));
+ assertEquals(0, ((Duration)obj).getTimeInMillis(new GregorianCalendar()));
+
+ el = builder.buildTree(Duration.class, name, value, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(Duration.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertTrue(Duration.class.isAssignableFrom(obj.getClass()));
+ assertEquals(longVal, ((Duration)obj).getTimeInMillis(new GregorianCalendar()));
+
+ el = builder.buildTree(Duration.class, name, null, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(Duration.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals("0", el.getValue());
+ obj = el.toObject();
+ assertTrue(Duration.class.isAssignableFrom(obj.getClass()));
+ assertEquals(0, ((Duration)obj).getTimeInMillis(new GregorianCalendar()));
+
+ el = builder.buildTree(Duration.class, name, value, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(Duration.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertTrue(Duration.class.isAssignableFrom(obj.getClass()));
+ assertEquals(longVal, ((Duration)obj).getTimeInMillis(new GregorianCalendar()));
+ }
+
+ @Test
+ public void shouldBuildTreeOfXMLGregorianCalendarElement() throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ final String name = "myXMLGregorianCalendar";
+ final String value = "2013-02-13T12:12:10.000Z";
+ final String refCal = "1970-01-01T00:00:00.000Z";
+
+ Element el = builder.buildTree(XMLGregorianCalendar.class, name, null, true);
+ assertElementProps(el, true, false, false, true, true, false, false, 0);
+ assertEquals(XMLGregorianCalendar.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(null, el.getValue());
+ Object obj = el.toObject();
+ assertEquals(null, obj);
+
+ el = getElementBuilder(true, true).buildTree(XMLGregorianCalendar.class, name, null, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(XMLGregorianCalendar.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(refCal, el.getValue());
+ obj = el.toObject();
+ assertTrue(XMLGregorianCalendar.class.isAssignableFrom(obj.getClass()));
+ assertEquals(refCal, obj.toString());
+
+ el = builder.buildTree(XMLGregorianCalendar.class, name, value, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(XMLGregorianCalendar.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertTrue(XMLGregorianCalendar.class.isAssignableFrom(obj.getClass()));
+ assertEquals(value, obj.toString());
+
+ el = builder.buildTree(XMLGregorianCalendar.class, name, null, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(XMLGregorianCalendar.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(refCal, el.getValue());
+ obj = el.toObject();
+ assertTrue(XMLGregorianCalendar.class.isAssignableFrom(obj.getClass()));
+ assertEquals(refCal, obj.toString());
+
+ el = builder.buildTree(XMLGregorianCalendar.class, name, value, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(XMLGregorianCalendar.class, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertTrue(XMLGregorianCalendar.class.isAssignableFrom(obj.getClass()));
+ assertEquals(value, obj.toString());
+ }
+
+ private static <T> void shouldBuildTreeOfNumberElement(Class<T> clazz, String name, String value, String expDefValue, T expObj, T expDefObj) throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(clazz, name, null, true);
+ assertElementProps(el, true, false, false, true, true, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(null, el.getValue());
+ Object obj = el.toObject();
+ assertEquals(null, obj);
+
+ el = getElementBuilder(true, true).buildTree(clazz, name, null, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(expDefValue, el.getValue());
+ obj = el.toObject();
+ assertEquals(clazz, obj.getClass());
+ assertEquals(expDefObj, obj);
+
+ el = builder.buildTree(clazz, name, value, true);
+ assertElementProps(el, true, false, false, false, true, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(clazz, obj.getClass());
+ assertEquals(expObj, obj);
+
+ el = builder.buildTree(clazz, name, null, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(expDefValue, el.getValue());
+ obj = el.toObject();
+ assertEquals(clazz, obj.getClass());
+ assertEquals(expDefObj, obj);
+
+ el = builder.buildTree(clazz, name, value, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(clazz, obj.getClass());
+ assertEquals(expObj, obj);
+ }
+
+ private static <T> void shouldBuildTreeOfPrimitiveNumberElement(Class<T> clazz, String name, String value, String expDefValue, T expObj, T expDefObj) throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(clazz, name, null, true);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(expDefValue, el.getValue());
+ Object obj = el.toObject();
+ assertEquals(expDefObj, obj);
+
+ el = getElementBuilder(true, true).buildTree(clazz, name, null, true);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(expDefValue, el.getValue());
+ obj = el.toObject();
+ assertEquals(expDefObj, obj);
+
+ el = builder.buildTree(clazz, name, value, true);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(expObj, obj);
+
+ el = builder.buildTree(clazz, name, null, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(expDefValue, el.getValue());
+ obj = el.toObject();
+ assertEquals(expDefObj, obj);
+
+ el = builder.buildTree(clazz, name, value, false);
+ assertElementProps(el, true, false, false, false, false, false, false, 0);
+ assertEquals(clazz, el.getClassType());
+ assertEquals(name, el.getName());
+ assertEquals(value, el.getValue());
+ obj = el.toObject();
+ assertEquals(expObj, obj);
+ }
+
+ @Test
+ public void shouldBuildTreeOfComplexElement() throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(MyTest.class, "myTest", null, true);
+ assertElementProps(el, false, false, false, false, true, false, false, 1);
+ assertEquals(MyTest.class, el.getClassType());
+ assertEquals("myTest", el.getName());
+ assertEquals(null, el.getValue());
+ Object obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof MyTest);
+ assertEquals(null, ((MyTest)obj).getPar());
+
+ el = getElementBuilder(true, true).buildTree(MyTest.class, "myTest", null, true);
+ assertElementProps(el, false, false, false, false, true, false, false, 1);
+ assertEquals(MyTest.class, el.getClassType());
+ assertEquals("myTest", el.getName());
+ assertEquals(null, el.getValue());
+ obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof MyTest);
+ assertEquals("", ((MyTest)obj).getPar());
+
+ el = builder.buildTree(MyTest.class, "myTest", null, false);
+ assertElementProps(el, false, false, false, false, false, false, false, 1);
+ assertEquals(MyTest.class, el.getClassType());
+ assertEquals("myTest", el.getName());
+ assertEquals(null, el.getValue());
+ obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof MyTest);
+ assertEquals(null, ((MyTest)obj).getPar());
+
+ MyTest t = new MyTest();
+ t.setPar("myPar");
+ el = builder.buildTree(MyTest.class, "myTest", t, true);
+ assertElementProps(el, false, false, false, false, true, false, false, 1);
+ assertEquals(MyTest.class, el.getClassType());
+ assertEquals("myTest", el.getName());
+ assertEquals(null, el.getValue());
+ obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof MyTest);
+ assertEquals("myPar", ((MyTest)obj).getPar());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void shouldBuildTreeOfGroupElement() throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ ParameterizedType type = getTestCollectionType();
+
+ Element el = builder.buildTree(type, "myTests", null, true);
+ assertElementProps(el, false, true, false, false, true, false, false, 0);
+ assertEquals(type, el.getClassType());
+ assertEquals("myTests", el.getName());
+ assertEquals(null, el.getValue());
+ assertEquals(0, el.getChildrenCount());
+ assertFalse(el.getChildren().hasNext());
+ assertFalse(el.getChildrenIDs().hasNext());
+ Element prototype = el.getPrototype();
+ assertEquals(MyTest.class, prototype.getClassType());
+ assertElementProps(prototype, false, false, false, false, true, false, false, 1);
+ Object obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof Collection);
+ assertTrue(((Collection<?>)obj).isEmpty());
+ Element addedChild = el.incrementChildren();
+ assertEquals(1, el.getChildrenCount());
+ assertTrue(el.getChildren().hasNext());
+ assertTrue(el.getChildrenIDs().hasNext());
+ assertEquals(addedChild, el.getChild(addedChild.getId()));
+ assertElementProps(addedChild, false, false, false, false, true, true, false, 1);
+ obj = el.toObject();
+ assertFalse(((Collection<?>)obj).isEmpty());
+ assertNull(((Collection<MyTest>)obj).iterator().next().getPar());
+ Element addedChild2 = el.incrementChildren();
+ assertEquals(2, el.getChildrenCount());
+ assertEquals(addedChild, el.getChild(addedChild.getId()));
+ assertEquals(addedChild2, el.getChild(addedChild2.getId()));
+ assertNotSame(addedChild.getId(), addedChild2.getId());
+ assertNotSame(addedChild, addedChild2);
+ Collection<String> ids = new LinkedList<String>();
+ for (Iterator<String> it = el.getChildrenIDs(); it.hasNext(); ) {
+ ids.add(it.next());
+ }
+ assertThat(ids, hasItems(addedChild.getId(), addedChild2.getId()));
+ obj = el.toObject();
+ assertEquals(2, ((Collection<?>)obj).size());
+ el.removeChild(addedChild.getId());
+ assertEquals(1, el.getChildrenCount());
+ assertNull(el.getChild(addedChild.getId()));
+ assertNotNull(el.getChild(addedChild2.getId()));
+ el.removeChild(addedChild2.getId());
+ assertEquals(0, el.getChildrenCount());
+ obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof Collection);
+ assertTrue(((Collection<?>)obj).isEmpty());
+
+ List<MyTest> value = new LinkedList<MyTest>();
+ MyTest mt1 = new MyTest();
+ MyTest mt2 = new MyTest();
+ mt1.setPar("p1");
+ mt2.setPar("p2");
+ value.add(mt1);
+ value.add(mt2);
+ el = builder.buildTree(type, "myTests", value, true);
+ assertElementProps(el, false, true, false, false, true, false, false, 2);
+ assertEquals(type, el.getClassType());
+ assertEquals("myTests", el.getName());
+ assertEquals(null, el.getValue());
+ for (Iterator<? extends Element> it = el.getChildren(); it.hasNext(); ) {
+ assertElementProps(it.next(), false, false, false, false, true, true, false, 1);
+ }
+ Object res = el.toObject();
+ assertTrue(obj instanceof Collection);
+ Collection<String> pars = new LinkedList<String>();
+ for (MyTest mt : (Collection<MyTest>)res) {
+ pars.add(mt.getPar());
+ }
+ assertThat(pars, hasItems("p1", "p2"));
+ }
+
+ @Test
+ public void shouldBuildTreeOfLazyElement() throws Exception {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(MyLazyTest.class, "myLazyTest", null, true);
+ assertElementProps(el, false, false, false, false, true, false, false, 2);
+ assertEquals(MyLazyTest.class, el.getClassType());
+ assertEquals("myLazyTest", el.getName());
+ assertEquals(null, el.getValue());
+ List<String> tmpList = new LinkedList<String>();
+ for (Iterator<? extends Element> it = el.getChildren(); it.hasNext(); ) {
+ tmpList.add(it.next().getName());
+ }
+ assertThat(tmpList, hasItems("par", "ref"));
+ Element refEl = el.getChildByName("ref");
+ assertNotNull(refEl);
+ assertElementProps(refEl, false, false, true, false, true, false, false, 1);
+ assertEquals("ref", refEl.getName());
+ Element resolvedRefEl = refEl.getChildren().next();
+ assertElementProps(resolvedRefEl, false, false, false, false, true, false, false, 2);
+ assertEquals("ref", resolvedRefEl.getName());
+ Object obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof MyLazyTest);
+ assertEquals(null, ((MyLazyTest)obj).getPar());
+ Object refObj = ((MyLazyTest)obj).getRef();
+ assertNotNull(refObj);
+ assertTrue(refObj instanceof MyLazyTest);
+ assertEquals(null, ((MyLazyTest)refObj).getPar());
+
+ MyLazyTest value = new MyLazyTest();
+ MyLazyTest refValue = new MyLazyTest();
+ value.setPar("myPar");
+ refValue.setPar("myRefPar");
+ value.setRef(refValue);
+ el = builder.buildTree(MyLazyTest.class, "myLazyTest", value, true);
+ assertElementProps(el, false, false, false, false, true, false, false, 2);
+ assertEquals(MyLazyTest.class, el.getClassType());
+ assertEquals("myLazyTest", el.getName());
+ assertEquals(null, el.getValue());
+ obj = el.toObject();
+ assertNotNull(obj);
+ assertTrue(obj instanceof MyLazyTest);
+ assertEquals("myPar", ((MyLazyTest)obj).getPar());
+ refObj = ((MyLazyTest)obj).getRef();
+ assertNotNull(refObj);
+ assertTrue(refObj instanceof MyLazyTest);
+ assertEquals("myRefPar", ((MyLazyTest)refObj).getPar());
+ }
+
+ private ParameterizedType getTestCollectionType() throws Exception {
+ Method m = this.getClass().getMethod("helperListOfMyTestParMethod", List.class);
+ Type[] types = m.getGenericParameterTypes();
+ ParameterizedType pt = (ParameterizedType)types[0];
+ assertTrue(Collection.class.isAssignableFrom((Class<?>)pt.getRawType()));
+ assertTrue(MyTest.class.isAssignableFrom((Class<?>)pt.getActualTypeArguments()[0]));
+ return pt;
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void incrementChildOperationOnNotGroupElementShouldCauseExceptionThrown() {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(MyTest.class, "myTest", null, true);
+ el.incrementChildren();
+ }
+
+ @Test(expected = WiseRuntimeException.class)
+ public void removeChildOperationOfUnremovableElementShouldCauseExceptionThrown() {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(MyTest.class, "myTest", null, true);
+ Element child = el.getChildren().next();
+ el.removeChild(child.getId());
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void incrementChildOperationOnLeafElementShouldCauseExceptionThrown() {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(String.class, "myString", null, true);
+ el.incrementChildren();
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void setValueOperationsOnNotLeafElementShouldCauseExceptionThrown() {
+ ElementBuilderImpl builder = getElementBuilder(true, false);
+ Element el = builder.buildTree(MyTest.class, "myTest", null, true);
+ el.setValue("Foo");
+ }
+
+ private static ElementBuilderImpl getElementBuilder(boolean request, boolean useDefaults) {
+ WSDynamicClientImpl mock = mock(WSDynamicClientImpl.class);
+ mock.setClassLoader(ElementTest.class.getClassLoader());
+// when(mock.getClassLoaderInternal()).thenReturn();
+ return new TestElementBuilder(mock, request, useDefaults);
+ }
+
+ private static void assertElementProps(Element el, boolean leaf, boolean group, boolean lazy, boolean nil, boolean nillable, boolean removable, boolean resolved, int childrenCount) {
+ assertNotNull(el);
+ assertEquals(leaf, el.isLeaf());
+ assertEquals(group, el.isGroup());
+ assertEquals(lazy, el.isLazy());
+ assertEquals(nil, el.isNil());
+ assertEquals(nillable, el.isNillable());
+ assertEquals(removable, el.isRemovable());
+ assertEquals(resolved, el.isResolved());
+ assertNotNull(el.getId());
+ assertEquals(group, el.getPrototype() != null);
+ assertEquals(childrenCount, el.getChildrenCount());
+ }
+
+ private static class TestElementBuilder extends ElementBuilderImpl {
+
+ public TestElementBuilder(WSDynamicClient client, boolean request, boolean useDefautValuesForNulls) {
+ super(client, request, useDefautValuesForNulls);
+ }
+
+ protected boolean isSimpleType(Class<?> cl, WSDynamicClient client) {
+ if (cl.isEnum() || cl.isPrimitive()) {
+ return true;
+ }
+ final String pn = cl.getPackage().getName();
+ return (pn.startsWith("java.") || pn.startsWith("javax."));
+ }
+
+ }
+
+ public static class MyTest {
+ private String par;
+
+ public MyTest() {
+ }
+ public String getPar() {
+ return par;
+ }
+ public void setPar(String par) {
+ this.par = par;
+ }
+ }
+
+ public static class MyLazyTest {
+ private MyLazyTest ref;
+ private String par;
+
+ public MyLazyTest() {
+ }
+ public String getPar() {
+ return par;
+ }
+ public void setPar(String par) {
+ this.par = par;
+ }
+ public MyLazyTest getRef() {
+ return ref;
+ }
+
+ public void setRef(MyLazyTest ref) {
+ this.ref = ref;
+ }
+ }
+
+ public void helperListOfMyTestParMethod(List<MyTest> parameter) {
+ //NOOP, required for testing of group elements below
+ }
+}
11 years, 10 months
wise SVN: r530 - in core/trunk/core/src/main/java/org/jboss/wise: tree and 1 other directories.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-24 13:24:26 -0500 (Sun, 24 Feb 2013)
New Revision: 530
Added:
core/trunk/core/src/main/java/org/jboss/wise/tree/
core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java
Log:
[WISE-195] Initial tree view impl
Added: core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java (rev 0)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/Element.java 2013-02-24 18:24:26 UTC (rev 530)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed 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.jboss.wise.tree;
+
+import java.io.Serializable;
+import java.lang.reflect.Type;
+import java.util.Iterator;
+
+/**
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface Element extends Serializable, Cloneable {
+
+ public boolean isLeaf();
+
+ public boolean isRemovable();
+
+ public Type getClassType();
+
+ public String getName();
+
+ public boolean isNil();
+
+ public void setNil(boolean nil);
+
+ public String getId();
+
+ public boolean isNillable();
+
+ public boolean isGroup();
+
+ public void removeChild(String id);
+
+ public Element getChild(String id);
+
+ public Element getChildByName(String name);
+
+ public Iterator<String> getChildrenIDs();
+
+// public Iterator<String> getChildrenIDs(boolean resolve);
+
+ public Iterator<? extends Element> getChildren();
+
+// public Iterator<? extends Element> getChildren(boolean resolve);
+
+ public String getValue();
+
+ public void setValue(String value);
+
+ public Element getPrototype();
+
+ public Element incrementChildren();
+
+ public int getChildrenCount();
+
+ public boolean isLazy();
+
+ public boolean isResolved();
+
+ /**
+ * Every WiseTreeElement must be cloneable; this is required to handle
+ * element's add and removal into/from arrays and collections.
+ */
+ public Element clone();
+
+ /**
+ * This is required to convert a tree element into the corresponding object
+ * instance.
+ *
+ * @return The object corresponding to this element
+ */
+ public Object toObject();
+
+}
Added: core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java (rev 0)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java 2013-02-24 18:24:26 UTC (rev 530)
@@ -0,0 +1,252 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed 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.jboss.wise.tree.impl;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.ws.Holder;
+
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+import org.jboss.wise.core.utils.IDGenerator;
+import org.jboss.wise.core.utils.JavaUtils;
+import org.jboss.wise.core.utils.ReflectionUtils;
+import org.jboss.wise.tree.Element;
+
+
+/**
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class ElementBuilderImpl {
+
+ private WSDynamicClient client;
+ private final boolean request;
+ private final boolean useDefautValuesForNullLeaves;
+
+ public ElementBuilderImpl(WSDynamicClient client, boolean request, boolean useDefautValuesForNullLeaves) {
+ this.client = client;
+ this.request = request;
+ this.useDefautValuesForNullLeaves = useDefautValuesForNullLeaves;
+ }
+
+ public Element buildTree(Type type, String name, Object value, boolean nillable) {
+ return buildTree(type, name, value, nillable, null, null, Collections.synchronizedMap(new HashMap<Type, ElementImpl>()), new HashSet<Type>());
+ }
+
+ private ElementImpl buildTree(Type type, String name, Object obj, boolean nillable, Class<?> scope, String namespace, Map<Type, ElementImpl> typeMap, Set<Type> stack) {
+ if (type instanceof ParameterizedType) {
+ ParameterizedType pt = (ParameterizedType) type;
+ return this.buildParameterizedType(pt, name, obj, scope, namespace, typeMap, stack);
+ } else {
+ return this.buildFromClass((Class<?>) type, name, obj, nillable, typeMap, stack);
+
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ private ElementImpl buildParameterizedType(ParameterizedType pt,
+ String name,
+ Object obj,
+ Class<?> scope,
+ String namespace,
+ Map<Type, ElementImpl> typeMap,
+ Set<Type> stack) {
+ Type firstTypeArg = pt.getActualTypeArguments()[0];
+ if (Collection.class.isAssignableFrom((Class<?>) pt.getRawType())) {
+ ElementImpl group;
+ if (obj != null || request) {
+ ElementImpl prototype = this.buildTree(firstTypeArg, name, null, true, null, null, typeMap, stack);
+ group = newElement(pt, name, false, prototype, false, typeMap);
+ if (obj != null) {
+ for (Object o : (Collection) obj) {
+ ElementImpl childElement = this.buildTree(firstTypeArg, name, o, true, null, null, typeMap, stack);
+ childElement.setRemovable(true);
+ group.addChild(childElement);
+ }
+ }
+ } else {
+ group = newElement(pt, name, false, null, false, typeMap);
+ }
+ return group;
+ } else {
+ if (obj != null && obj instanceof JAXBElement) {
+ obj = ((JAXBElement)obj).getValue();
+ } else if (obj != null && obj instanceof Holder) {
+ obj = ((Holder)obj).value;
+ }
+ ElementImpl element = this.buildTree(firstTypeArg, name, obj, true, null, null, typeMap, stack);
+ ElementImpl parameterized = newElement(pt, name, false, null, false, typeMap);
+ parameterized.addChild(element);
+ return parameterized;
+ }
+ }
+
+ private ElementImpl buildFromClass(Class<?> cl, String name, Object obj, boolean nillable, Map<Type, ElementImpl> typeMap, Set<Type> stack) {
+
+ if (cl.isArray()) {
+ if (byte.class.equals(cl.getComponentType())) {
+ return newLeafElement(cl, name, obj, !nillable);
+ }
+ throw new WiseRuntimeException("Converter doesn't support this Object[] yet.");
+ }
+
+ if (isSimpleType(cl, client)) {
+ return newLeafElement(cl, name, obj, !nillable);
+ } else { // complex
+ final boolean recursionCheck = (request && obj == null); //lazy element disable till we have a value object (an actual SOAP request won't have cycles)
+ if (recursionCheck && stack.contains(cl)) {
+ return newElement(cl, name, false, null, true, typeMap);
+ }
+
+ ElementImpl complex = newElement(cl, name, !nillable, null, false, typeMap);
+ if (recursionCheck) {
+ stack.add(cl);
+ }
+ for (Field field : ReflectionUtils.getAllFields(cl)) {
+ XmlElement elemAnnotation = field.getAnnotation(XmlElement.class);
+ XmlElementRef refAnnotation = field.getAnnotation(XmlElementRef.class);
+ String fieldName = null;
+ String namespace = null;
+ if (elemAnnotation != null && !elemAnnotation.name().startsWith("#")) {
+ fieldName = elemAnnotation.name();
+ }
+ if (refAnnotation != null) {
+ fieldName = refAnnotation.name();
+ namespace = refAnnotation.namespace();
+ }
+ if (fieldName == null) {
+ fieldName = field.getName();
+ }
+ // String fieldName = (annotation != null &&
+ // !annotation.name().startsWith("#")) ? annotation.name() :
+ // field.getName();
+ Object fieldValue = null;
+ if (obj != null) {
+ try {
+ Method getter = cl.getMethod(ReflectionUtils.getGetter(field), (Class[]) null);
+ fieldValue = getter.invoke(obj, (Object[]) null);
+ } catch (Exception e) {
+ throw new WiseRuntimeException("Error calling getter method for field " + field, e);
+ }
+ }
+ ElementImpl element = this.buildTree(field.getGenericType(), fieldName, fieldValue, true, cl, namespace, typeMap, stack);
+ complex.addChild(element);
+ }
+ if (recursionCheck) {
+ stack.remove(cl);
+ if (!typeMap.containsKey(cl)) {
+ typeMap.put(cl, complex.cloneInternal());
+ }
+ }
+ return complex;
+ }
+ }
+
+ protected boolean isSimpleType(Class<?> cl, WSDynamicClient client) {
+ return cl.isEnum() || cl.isPrimitive() || client.getClassLoader() != cl.getClassLoader();
+ }
+
+ private ElementImpl newLeafElement(Class<?> classType, String name, Object value, boolean forceNotNillable) {
+ ElementImpl element = new ElementImpl(true);
+ element.setClassType(classType);
+ element.setName(name);
+ element.setId(generateNewID());
+ if (forceNotNillable) {
+ element.enforceNotNillable();
+ } else {
+ // primitive are not nillable, thus they can't be nil or have a null value
+ final boolean primitive = classType.isPrimitive();
+ element.setNillable(!primitive);
+ element.setNil(!primitive);
+ if (value == null && (useDefautValuesForNullLeaves || primitive)) {
+ element.setValue(getDefaultValue(classType));
+ element.setNil(false);
+ }
+ }
+ if (value != null) {
+ element.parseObject(value);
+ }
+ return element;
+ }
+
+ private ElementImpl newElement(Type classType, String name, boolean forceNotNillable, ElementImpl prototype, boolean lazy, Map<Type, ElementImpl> treeTypesMap) {
+ ElementImpl element = new ElementImpl(false);
+ element.setClassType(classType);
+ element.setName(name);
+ element.setId(generateNewID());
+ if (classType instanceof ParameterizedType && Collection.class.isAssignableFrom((Class<?>) ((ParameterizedType) classType).getRawType())) {
+ element.setPrototype(prototype);
+ element.setGroup(true);
+ }
+ element.setClient(client);
+ element.setLazy(lazy);
+ element.setTreeTypesMap(treeTypesMap);
+ if (forceNotNillable) {
+ element.enforceNotNillable();
+ }
+ return element;
+ }
+
+ protected static String getDefaultValue(Class<?> cl) {
+ if (cl.isPrimitive()) {
+ cl = JavaUtils.getWrapperType(cl);
+ }
+ String cn = cl.getName();
+ if ("java.lang.Boolean".equals(cn)) {
+ return "false";
+ } else if ("java.lang.Byte".equals(cn)) {
+ return "0";
+ } else if ("java.lang.Double".equals(cn)) {
+ return "0.0";
+ } else if ("java.lang.Float".equals(cn)) {
+ return "0.0";
+ } else if ("java.lang.Integer".equals(cn)) {
+ return "0";
+ } else if ("java.lang.Long".equals(cn)) {
+ return "0";
+ } else if ("java.lang.Short".equals(cn)) {
+ return "0";
+ } else if ("java.math.BigDecimal".equals(cn)) {
+ return "0.0";
+ } else if ("java.math.BigInteger".equals(cn)) {
+ return "0";
+ } else if ("javax.xml.datatype.Duration".equals(cn)) {
+ return "0";
+ } else if ("javax.xml.datatype.XMLGregorianCalendar".equals(cn)) {
+ return "1970-01-01T00:00:00.000Z";
+ } else {
+ return "";
+ }
+ }
+
+ protected String generateNewID() {
+ return IDGenerator.nextVal();
+ }
+}
Added: core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java (rev 0)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementImpl.java 2013-02-24 18:24:26 UTC (rev 530)
@@ -0,0 +1,580 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed 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.jboss.wise.tree.impl;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.DatatypeConverter;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.exception.WiseRuntimeException;
+import org.jboss.wise.core.utils.IDGenerator;
+import org.jboss.wise.core.utils.JavaUtils;
+import org.jboss.wise.core.utils.ReflectionUtils;
+import org.jboss.wise.tree.Element;
+
+/**
+ * @author alessio.soldano(a)jboss.com
+ */
+public class ElementImpl implements Element {
+
+ private static final long serialVersionUID = -2831618351948874761L;
+
+ protected String id;
+ protected String name;
+ protected String value;
+
+ protected boolean nil; //whether this elements has the attribute xsi:nil set to "true"
+ protected boolean nillable = true; //for primitives and explicitly not nillable elements
+ protected boolean removable; // to be used on array elements
+
+ private Element parent;
+ protected Type classType;
+ protected boolean isLeaf;
+ protected boolean lazy;
+ protected boolean resolved;
+ protected boolean group;
+
+ protected Map<String, ElementImpl> children;
+ protected ElementImpl prototype;
+
+ protected WSDynamicClient client;
+ protected Map<Type, ElementImpl> treeTypesMap;
+
+ protected ElementImpl(boolean isLeaf) {
+ this.isLeaf = isLeaf;
+ if (isLeaf) {
+ children = Collections.emptyMap();
+ } else {
+ children = new HashMap<String, ElementImpl>(8);
+ }
+ }
+
+ @Override
+ public boolean isLeaf() {
+ return isLeaf;
+ }
+
+ @Override
+ public boolean isRemovable() {
+ return removable;
+ }
+
+// @Override
+ protected void setRemovable(boolean removable) {
+ this.removable = removable;
+ }
+
+ @Override
+ public Type getClassType() {
+ return classType;
+ }
+
+ public void setClassType(Type classType) {
+ this.classType = classType;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean isNil() {
+ return nil;
+ }
+
+ @Override
+ public void setNil(boolean nil) {
+ this.nil = nil;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ protected void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public boolean isNillable() {
+ return nillable;
+ }
+
+ public void setNillable(boolean nillable) {
+ this.nillable = nillable;
+ }
+
+ @Override
+ public boolean isGroup() {
+ return group;
+ }
+
+ protected void setGroup(boolean group) {
+ this.group = group;
+ }
+
+ public Element getParent() {
+ return parent;
+ }
+
+ protected void setParent(Element parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(String value) {
+ checkLeaf();
+ this.value = value;
+ }
+
+ public void parseObject(Object obj) {
+ checkLeaf();
+ if (obj == null) {
+ this.setValue(null);
+ }
+ if (obj instanceof byte[]) {
+ this.setValue(DatatypeConverter.printBase64Binary((byte[])obj));
+ } else {
+ this.setValue(obj.toString());
+ }
+ this.nil = (obj == null && nillable);
+ }
+
+ protected void checkLeaf() {
+ if (!isLeaf) {
+ throw new UnsupportedOperationException("Element is not leaf");
+ }
+ }
+
+ protected void setClient(WSDynamicClient client) {
+ this.client = client;
+ }
+
+ protected void setTreeTypesMap(Map<Type, ElementImpl> treeTypesMap) {
+ this.treeTypesMap = treeTypesMap;
+ }
+
+ public void addChild(ElementImpl child) {
+ if (isLeaf) {
+ throw new UnsupportedOperationException("Element is leaf");
+ }
+ children.put(child.getId(), child);
+ child.setParent(this);
+ }
+
+ @Override
+ public void removeChild(String id) {
+ ElementImpl child = children.remove(id);
+ if (child != null) {
+ if (!child.isRemovable()) {
+ children.put(id, child);
+ throw new WiseRuntimeException("Element for id=" + id + " is not removable!");
+ }
+ child.setParent(null);
+ }
+ }
+
+ @Override
+ public Element getChild(String id) {
+ resolveReference();
+ return children.get(id);
+ }
+
+ @Override
+ public Element getChildByName(String name) {
+ if (group) {
+ throw new UnsupportedOperationException("Cannot get child by name for a group element!");
+ }
+ resolveReference();
+ for (ElementImpl el : children.values()) {
+ if (name.equals(el.getName())) {
+ return el;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Iterator<String> getChildrenIDs() {
+ return this.getChildrenIDs(true);
+ }
+
+ @Override
+ public Iterator<? extends Element> getChildren() {
+ return this.getChildren(true);
+ }
+
+// @Override
+ protected Iterator<String> getChildrenIDs(boolean resolve) {
+ if (resolve) {
+ resolveReference();
+ }
+ return unmodifiableIterator(children.keySet().iterator());
+ }
+
+// @Override
+ protected Iterator<? extends Element> getChildren(boolean resolve) {
+ return this.getChildrenInternal(resolve);
+ }
+
+ protected Iterator<ElementImpl> getChildrenInternal(boolean resolve) {
+ if (resolve) {
+ resolveReference();
+ }
+ return unmodifiableIterator(children.values().iterator());
+ }
+
+ protected void resolveReference() {
+ if (isLazy() && !isResolved()) {
+ ElementImpl ref = treeTypesMap.get(this.classType);
+ ElementImpl component = ref.cloneInternal();
+ component.setName(this.getName());
+ addChild(component);
+ setResolved(true);
+ }
+ }
+
+ @Override
+ public boolean isLazy() {
+ return lazy;
+ }
+
+ protected void setLazy(boolean lazy) {
+ this.lazy = lazy;
+ }
+
+ @Override
+ public boolean isResolved() {
+ return resolved;
+ }
+
+ protected void setResolved(boolean resolved) {
+ this.resolved = resolved;
+ }
+
+ @Override
+ public Element getPrototype() {
+ return prototype;
+ }
+
+ protected void setPrototype(ElementImpl prototype) {
+ this.prototype = prototype;
+ }
+
+ @Override
+ public Element incrementChildren() {
+ if (!group) {
+ throw new UnsupportedOperationException("Element is not a group!");
+ }
+ resolveReference();
+ ElementImpl component = prototype.cloneInternal();
+ component.setRemovable(true);
+ this.addChild(component);
+ return component;
+ }
+
+ @Override
+ public int getChildrenCount() {
+ resolveReference();
+ return children.size();
+ }
+
+ /**
+ * Every Element must be cloneable; this is required to handle
+ * element's add and removal into/from arrays and collections.
+ */
+ @Override
+ public Element clone() {
+ return this.cloneInternal();
+ }
+
+ protected ElementImpl cloneInternal() {
+ ElementImpl element = new ElementImpl(isLeaf);
+ element.setId(IDGenerator.nextVal());
+ element.setName(this.name);
+ element.setNil(this.nil);
+ element.setClassType(this.classType);
+ element.setRemovable(this.isRemovable());
+ element.setNillable(this.isNillable());
+ element.setLazy(this.lazy);
+ if (isLeaf) { //simple
+ Class<?> clazz = (Class<?>)this.classType;
+ element.setValue(clazz.isPrimitive() ? ElementBuilderImpl.getDefaultValue(clazz) : null);
+ element.setNil(this.isNillable()); //default to nil on simple elements
+ } else if (lazy) { //lazy
+ element.setResolved(false); //copy into an unresolved element and do not copy child
+ } else { //complex, group
+ for (Iterator<ElementImpl> it = this.getChildrenInternal(false); it.hasNext(); ) {
+ ElementImpl child = it.next();
+ element.addChild(child.cloneInternal());
+ }
+ if (this.prototype != null) {
+ element.setPrototype(this.prototype.cloneInternal());
+ }
+ }
+ element.setGroup(this.group);
+ element.setClient(this.client);
+ element.setTreeTypesMap(this.treeTypesMap);
+ return element;
+ }
+
+ /**
+ * This is required to convert a tree element into the corresponding object
+ * instance.
+ *
+ * @return The object corresponding to this element
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public Object toObject() {
+ if (nil) {
+ return null;
+ }
+ if (isLeaf) { //simple
+ if (value == null) {
+ return null;
+ }
+ Class<?> cl = (Class<?>) classType;
+ if (cl.isArray() && byte.class.equals(cl.getComponentType())) {
+ return DatatypeConverter.parseBase64Binary(value);
+ }
+ if (cl.isPrimitive()) {
+ cl = JavaUtils.getWrapperType(cl);
+ }
+ final String n = cl.getName();
+ if ("java.lang.String".equals(n)) {
+ return new String(value);
+ } else if ("java.lang.Boolean".equals(n)) {
+ return new Boolean(value);
+ } else if ("java.lang.Byte".equals(n)) {
+ return new Byte(value);
+ } else if ("java.lang.Character".equals(n)) {
+ return new Character(value.charAt(0));
+ } else if ("java.lang.Double".equals(n)) {
+ return new Double(value);
+ } else if ("java.lang.Float".equals(n)) {
+ return new Float(value);
+ } else if ("java.lang.Integer".equals(n)) {
+ return new Integer(value);
+ } else if ("java.lang.Long".equals(n)) {
+ return new Long(value);
+ } else if ("java.lang.Short".equals(n)) {
+ return new Short(value);
+ } else if ("java.math.BigDecimal".equals(n)) {
+ return BigDecimal.valueOf(Double.parseDouble(value));
+ } else if ("java.math.BigInteger".equals(n)) {
+ return BigInteger.valueOf(Long.parseLong(value));
+ } else if ("java.lang.Object".equalsIgnoreCase(n)) {
+ return (Object) value;
+ } else if ("javax.xml.namespace.QName".equals(n)) {
+ return QName.valueOf(value);
+ } else if ("javax.xml.datatype.Duration".equals(n)) {
+ try {
+ return DatatypeFactory.newInstance().newDuration(Long.parseLong(value));
+ } catch (DatatypeConfigurationException e) {
+ throw new WiseRuntimeException("Error converting element to object, type format error?", e);
+ }
+ } else if ("javax.xml.datatype.XMLGregorianCalendar".equals(n)) {
+ try {
+ return DatatypeFactory.newInstance().newXMLGregorianCalendar(value);
+ } catch (DatatypeConfigurationException e) {
+ throw new WiseRuntimeException("Type format error", e);
+ }
+ } else {
+ throw new WiseRuntimeException("Class type not supported: " + cl);
+ }
+ } else if (group) { //group
+ LinkedList<Object> returnList = new LinkedList<Object>();
+ for (Iterator<ElementImpl> it = this.getChildrenInternal(false); it.hasNext();) {
+ returnList.add(it.next().toObject());
+ }
+ return returnList;
+ } else if (lazy) { //lazy
+ Iterator<ElementImpl> it = getChildrenInternal(false);
+ return it.hasNext() ? it.next().toObject() : null;
+ } else if (classType instanceof ParameterizedType) { //parameterized
+ Class<?> parameterizedClass = (Class<?>)((ParameterizedType) classType).getRawType();
+ Object child = getChildren(false).next().toObject();
+ if (parameterizedClass.isAssignableFrom(JAXBElement.class)) {
+ return instanceXmlElementDecl(this.name, (Class<?>)this.parent.getClassType(), child);
+ } else if (parameterizedClass.isAssignableFrom(Holder.class)) {
+ return instanceHolder(child);
+ } else {
+ throw new WiseRuntimeException("Unsupported parameterized class: " + parameterizedClass);
+ }
+ } else { //complex
+ try {
+ Class<?> cl = (Class<?>) classType;
+ final Object obj = cl.newInstance();
+ for (Iterator<ElementImpl> it = this.getChildrenInternal(false); it.hasNext(); ) {
+ Element child = it.next();
+ final boolean isBoolean = isBoolean(child.getClassType());
+ final Object childObject = child.toObject();
+ if (childObject != null) {
+ if (child.isGroup()) {
+ final String getter = ReflectionUtils.getterMethodName(child.getName(), isBoolean);
+ final Method method = cl.getMethod(getter, (Class[]) null);
+ Collection<?> col = (Collection<?>) method.invoke(obj, (Object[]) null);
+ col.addAll((List) childObject);
+ } else {
+ final String setter = ReflectionUtils.setterMethodName(child.getName(), isBoolean);
+ final Type t = child.getClassType();
+ final Method method;
+ if (t instanceof ParameterizedType) {
+ method = cl.getMethod(setter, (Class<?>) ((ParameterizedType) t).getRawType());
+ } else {
+ Class<?> fieldClass = (Class<?>) t;
+ if (Duration.class.isAssignableFrom(fieldClass)) {
+ method = cl.getMethod(setter, Duration.class);
+ } else if (XMLGregorianCalendar.class.isAssignableFrom(fieldClass)) {
+ method = cl.getMethod(setter, XMLGregorianCalendar.class);
+ } else {
+ method = cl.getMethod(setter, fieldClass);
+ }
+ }
+ method.invoke(obj, childObject);
+ }
+ }
+ }
+ return obj;
+ } catch (Exception e) {
+ throw new WiseRuntimeException("Error converting element to object", e);
+ }
+ }
+ }
+
+ /**
+ * Make sure this element can't be nill and set the default value
+ * (this is to be used e.g. for main RPC/Lit parameters)
+ */
+ protected void enforceNotNillable() {
+ this.setNillable(false);
+ if (isLeaf) {
+ this.setNil(false);
+ this.setValue(ElementBuilderImpl.getDefaultValue((Class<?>) classType));
+ }
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ private Object instanceHolder(Object obj) {
+ return new Holder(obj);
+ }
+
+ private Object instanceXmlElementDecl(String name, Class<?> scope, Object value) {
+ try {
+ Class<?> objectFactoryClass = null;
+ Method methodToUse = null;
+ boolean done = false;
+ final List<Class<?>> objectFactories = this.client.getObjectFactories();
+ if (objectFactories != null) {
+ Method m = value instanceof Boolean ? scope.getMethod("is" + JavaUtils.capitalize(name)) : scope.getMethod("get" + JavaUtils.capitalize(name));
+ XmlElementRef ann = m.getAnnotation(XmlElementRef.class);
+ String namespace = ann != null ? ann.namespace() : null;
+ for (Iterator<Class<?>> it = objectFactories.iterator(); it.hasNext() && !done; ) {
+ objectFactoryClass = it.next();
+ Method[] methods = objectFactoryClass.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ XmlElementDecl annotation = methods[i].getAnnotation(XmlElementDecl.class);
+ if (annotation != null && name.equals(annotation.name()) && (annotation.namespace() == null || annotation.namespace().equals(namespace)) && (annotation
+ .scope() == null || annotation.scope().equals(scope))) {
+ methodToUse = methods[i];
+ break;
+ }
+ }
+ if (methodToUse != null) {
+ done = true;
+ }
+ }
+ }
+ if (methodToUse != null) {
+ return methodToUse.invoke(objectFactoryClass.newInstance(), new Object[] { value });
+ } else {
+ return null;
+ }
+ } catch (Exception e) {
+ throw new WiseRuntimeException(e);
+ }
+ }
+
+ private static boolean isBoolean(Type type) {
+ String sn;
+ if (type instanceof ParameterizedType) {
+ sn = ((Class<?>) ((ParameterizedType) type).getRawType()).getSimpleName();
+ } else {
+ sn = ((Class<?>) type).getSimpleName();
+ }
+ return "Boolean".equalsIgnoreCase(sn);
+ }
+
+ protected <T> UnmodifiableIterator<T> unmodifiableIterator(final Iterator<T> iterator) {
+ if (iterator instanceof UnmodifiableIterator) {
+ return (UnmodifiableIterator<T>) iterator;
+ }
+ return new UnmodifiableIterator<T>() {
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public T next() {
+ return iterator.next();
+ }
+ };
+ }
+
+ private static abstract class UnmodifiableIterator<E> implements Iterator<E> {
+ public UnmodifiableIterator() {
+ }
+
+ @Override
+ public final void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
11 years, 10 months
wise SVN: r529 - core/trunk/core/src/main/java/org/jboss/wise/core/utils.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-24 13:23:09 -0500 (Sun, 24 Feb 2013)
New Revision: 529
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java
Log:
[WISE-197] ReflectionUtils::getAllFields should skip outer class reference for inner classes
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java 2013-02-24 18:20:51 UTC (rev 528)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java 2013-02-24 18:23:09 UTC (rev 529)
@@ -44,7 +44,7 @@
public static List<Field> getAllFields( Class<?> cl ) {
List<Field> list = new LinkedList<Field>();
for (Field field : cl.getDeclaredFields()) {
- if (!"serialVersionUID".equals(field.getName())) {
+ if (!"serialVersionUID".equals(field.getName()) && !field.getName().startsWith("this$")) {
list.add(field);
}
}
11 years, 10 months
wise SVN: r528 - core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-24 13:20:51 -0500 (Sun, 24 Feb 2013)
New Revision: 528
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
Log:
[WISE-196] initial changes, api interface change to be applied on not-micro release
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-02-24 18:16:31 UTC (rev 527)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-02-24 18:20:51 UTC (rev 528)
@@ -68,7 +68,7 @@
private static final long serialVersionUID = -7185945063107035243L;
@GuardedBy("this")
- private URLClassLoader classLoader;
+ private ClassLoader classLoader;
private final String userName;
@@ -210,11 +210,12 @@
return wsMethod;
}
+ //TODO modify API to avoid enforcing a URLClassLoader
public synchronized final URLClassLoader getClassLoader() {
- return classLoader;
+ return (URLClassLoader)classLoader;
}
- public synchronized final void setClassLoader(URLClassLoader classLoader) {
+ public synchronized final void setClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
11 years, 10 months