Author: dkulp
Date: Wed Aug 20 14:00:53 2008
New Revision: 687463
URL: http://svn.apache.org/viewvc?rev=687463&view=rev
Log:
Update to try and eliminate a NPE with service creation
[CXF-1756] Remove name attribute from generated impls
Modified:
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Modified:
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=687463&r1=687462&r2=687463&view=diff
==============================================================================
---
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Wed Aug 20 14:00:53 2008
@@ -145,29 +145,31 @@
if (method == null
|| method.getReturnType().equals(Future.class)
|| method.getReturnType().equals(Response.class)) {
- return false;
+ return Boolean.FALSE;
}
- if (method != null) {
- WebMethod wm = method.getAnnotation(WebMethod.class);
- if (wm != null) {
- if (wm.exclude()) {
- return Boolean.FALSE;
- } else {
- return Boolean.TRUE;
- }
+ WebMethod wm = method.getAnnotation(WebMethod.class);
+ if (wm != null) {
+ if (wm.exclude()) {
+ return Boolean.FALSE;
} else {
- if (method.getDeclaringClass().isInterface()) {
- return hasWebServiceAnnotation(method);
- }
- return hasWebServiceAnnotation(method);
+ return Boolean.TRUE;
}
+ }
+ if (method.getDeclaringClass().isInterface()) {
+ return hasWebServiceAnnotation(method);
+ }
+ if (implInfo.getSEIClass() == null) {
+ return hasWebServiceAnnotation(method);
}
- return Boolean.FALSE;
+ return
implInfo.getSEIClass().isAssignableFrom(method.getDeclaringClass());
}
@Override
public Boolean isOperation(final Method method) {
+ if (Object.class.equals(method.getDeclaringClass())) {
+ return false;
+ }
Class implClz = implInfo.getImplementorClass();
if (isWebMethod(getDeclaredMethod(implClz, method))) {
return true;
@@ -190,7 +192,7 @@
} catch (SecurityException e) {
throw new ServiceConstructionException(e);
} catch (NoSuchMethodException e) {
- return null;
+ return isWebMethod(method) ? method : null;
}
}
return method;
Modified:
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java?rev=687463&r1=687462&r2=687463&view=diff
==============================================================================
---
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
(original)
+++
cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
Wed Aug 20 14:00:53 2008
@@ -271,7 +271,7 @@
File wsdlFile = outputFile("tmp.wsdl");
String[] args = new String[] {"-wsdl", "-o", output.getPath() +
"/tmp.wsdl", "-verbose", "-s",
output.getPath(), "-frontend", "jaxws",
"-client", "-server",
-
"org.apache.cxf.tools.fortest.GreeterImpl"};
+
org.apache.cxf.tools.fortest.GreeterImpl.class.getName()};
JavaToWS.main(args);
assertTrue("Failed to generate WSDL file", wsdlFile.exists());
Modified:
cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
URL:
http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm?rev=687463&r1=687462&r2=687463&view=diff
==============================================================================
---
cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
(original)
+++
cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
Wed Aug 20 14:00:53 2008
@@ -34,7 +34,7 @@
*
*/
[EMAIL PROTECTED](name = "$intf.Name",
[EMAIL PROTECTED](
#if ($service.ServiceName != "")
serviceName = "$service.ServiceName",
#end
Modified:
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=687463&r1=687462&r2=687463&view=diff
==============================================================================
---
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
(original)
+++
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
Wed Aug 20 14:00:53 2008
@@ -94,7 +94,8 @@
Class clz =
classLoader.loadClass("org.apache.cxf.cxf1678.hello_world_soap_http.GreeterImpl");
WebService webServiceAnn = AnnotationUtil.getPrivClassAnnotation(clz,
WebService.class);
- assertEquals("Greeter", webServiceAnn.name());
+ assertEquals("org.apache.cxf.cxf1678.hello_world_soap_http.Greeter",
+ webServiceAnn.endpointInterface());
}
@Test
@@ -119,7 +120,8 @@
Class clz =
classLoader.loadClass("org.apache.cxf.w2j.hello_world_soap_http.GreeterImpl");
WebService webServiceAnn = AnnotationUtil.getPrivClassAnnotation(clz,
WebService.class);
- assertEquals("Greeter", webServiceAnn.name());
+ assertTrue("Impl class should note generate name property value in
webService annotation",
+ webServiceAnn.name().equals(""));
assertFalse("Impl class should generate portName property value in
webService annotation",
webServiceAnn.portName().equals(""));
assertFalse("Impl class should generate serviceName property value in
webService annotation",
Modified:
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?rev=687463&r1=687462&r2=687463&view=diff
==============================================================================
---
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Wed Aug 20 14:00:53 2008
@@ -315,7 +315,6 @@
assertTrue("Webservice annotation wsdlLocation should begin with
file", ws.wsdlLocation()
.startsWith("file"));
assertEquals("org.apache.cxf.w2j.hello_world_rpclit.GreeterRPCLit",
ws.endpointInterface());
- assertEquals("GreeterRPCLit", ws.name());
}