Author: dkulp
Date: Tue Dec 11 13:18:29 2007
New Revision: 603363
URL: http://svn.apache.org/viewvc?rev=603363&view=rev
Log:
Add system test from a bug report on the list
That test found an unrelated bug with creating clients with Aegis using a WSDL.
Fix that bug.
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
(with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
(with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/Team.java
(with props)
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
incubator/cxf/trunk/systests/src/test/resources/webapp/WEB-INF/beans.xml
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java?rev=603363&r1=603362&r2=603363&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
Tue Dec 11 13:18:29 2007
@@ -37,6 +37,10 @@
private Map<Method, OperationInfo> methodToOp =
new ConcurrentHashMap<Method, OperationInfo>();
+ public SimpleMethodDispatcher() {
+ //complete
+ }
+
public void bind(OperationInfo o, Method... methods) {
Method primary = methods[0];
for (Method m : methods) {
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=603363&r1=603362&r2=603363&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Tue Dec 11 13:18:29 2007
@@ -273,20 +273,32 @@
}
}
+ protected void setServiceProperties() {
+ getService().put(MethodDispatcher.class.getName(),
getMethodDispatcher());
+ if (properties != null) {
+ getService().putAll(properties);
+ }
+
+ }
+
protected void buildServiceFromWSDL(String url) {
LOG.info("Creating Service " + getServiceQName() + " from WSDL: " +
url);
WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), url,
getServiceQName());
setService(factory.create());
- if (properties != null) {
- getService().putAll(properties);
- }
+ setServiceProperties();
initializeWSDLOperations();
if (getDataBinding() != null) {
getDataBinding().initialize(getService());
}
+
+ for (ServiceInfo si : getService().getServiceInfos()) {
+ if (getExtraClass() != null) {
+ si.setProperty(EXTRA_CLASS, getExtraClass());
+ }
+ }
}
protected void buildServiceFromClass() {
@@ -304,19 +316,19 @@
setService(service);
- if (properties != null) {
- service.putAll(properties);
- }
-
- service.put(MethodDispatcher.class.getName(), getMethodDispatcher());
+ setServiceProperties();
serviceInfo.setName(getServiceQName());
serviceInfo.setTargetNamespace(serviceInfo.getName().getNamespaceURI());
createInterface(serviceInfo);
- if (getExtraClass() != null) {
- serviceInfo.setProperty(EXTRA_CLASS, getExtraClass());
+
+ for (ServiceInfo si : getService().getServiceInfos()) {
+ if (getExtraClass() != null) {
+ si.setProperty(EXTRA_CLASS, getExtraClass());
+ }
}
+
getDataBinding().initialize(service);
boolean isWrapped = isWrapped();
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java?rev=603363&r1=603362&r2=603363&view=diff
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
Tue Dec 11 13:18:29 2007
@@ -21,6 +21,7 @@
import java.net.URL;
+import java.util.Collection;
import java.util.List;
import java.util.logging.Logger;
@@ -131,5 +132,19 @@
dom = XMLUtils.parse(url.openStream());
util.assertValid("//wsdl:[EMAIL PROTECTED]'http://foo.bar.com']",
dom);
+ }
+
+ @Test
+ public void testCollection() throws Exception {
+ AegisDatabinding aegisBinding = new AegisDatabinding();
+ JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
+ proxyFactory.setDataBinding(aegisBinding);
+ proxyFactory.setServiceClass(SportsService.class);
+
proxyFactory.setWsdlLocation("http://localhost:9002/jaxwsAndAegisSports?wsdl");
+ SportsService service = (SportsService) proxyFactory.create();
+ Collection<Team> teams = service.getTeams();
+ assertEquals(1, teams.size());
+ assertEquals("Patriots", teams.iterator().next().getName());
+
}
}
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsService.java?rev=603363&view=auto
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
Tue Dec 11 13:18:29 2007
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.aegis;
+
+import java.util.Collection;
+
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceException;
+
[EMAIL PROTECTED](targetNamespace =
"http://cxf.apache.org/systest/aegis/sports")
+public interface SportsService {
+ Collection<Team> getTeams() throws WebServiceException;
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java?rev=603363&view=auto
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
Tue Dec 11 13:18:29 2007
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.aegis;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.ws.WebServiceException;
+
+/**
+ *
+ */
+public class SportsServiceImpl implements SportsService {
+
+ /** [EMAIL PROTECTED]/
+ public Collection<Team> getTeams() throws WebServiceException {
+ List<Team> teams = new ArrayList<Team>();
+ teams.add(new Team("Patriots", "New England"));
+ return teams;
+ }
+
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/SportsServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/Team.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/Team.java?rev=603363&view=auto
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/Team.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/Team.java
Tue Dec 11 13:18:29 2007
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.aegis;
+
+/**
+ *
+ */
+public class Team {
+ private String name;
+ private String city;
+
+ public Team() {
+ }
+ public Team(String name, String city) {
+ this.name = name;
+ this.city = city;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getCity() {
+ return city;
+ }
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/Team.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/Team.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
incubator/cxf/trunk/systests/src/test/resources/webapp/WEB-INF/beans.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/resources/webapp/WEB-INF/beans.xml?rev=603363&r1=603362&r2=603363&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/resources/webapp/WEB-INF/beans.xml
(original)
+++ incubator/cxf/trunk/systests/src/test/resources/webapp/WEB-INF/beans.xml
Tue Dec 11 13:18:29 2007
@@ -89,5 +89,16 @@
<bean class="org.apache.cxf.authservice.AuthServiceImpl" />
</jaxws:serviceBean>
</jaxws:server>
+
+
+ <jaxws:server address="/jaxwsAndAegisSports"
+ serviceClass="org.apache.cxf.systest.aegis.SportsService">
+ <jaxws:dataBinding>
+ <bean class="org.apache.cxf.aegis.databinding.AegisDatabinding" />
+ </jaxws:dataBinding>
+ <jaxws:serviceBean>
+ <bean class="org.apache.cxf.systest.aegis.SportsServiceImpl" />
+ </jaxws:serviceBean>
+ </jaxws:server>
</beans>
<!-- END SNIPPET: beans -->