cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r802824 - in /cxf/trunk: api/src/main/java/org/apache/cxf/annotations/ systests/src/test/java/org/apache/cxf/systest/jaxws/
Date Mon, 10 Aug 2009 15:26:44 GMT
Author: dkulp
Date: Mon Aug 10 15:26:27 2009
New Revision: 802824

URL: http://svn.apache.org/viewvc?rev=802824&view=rev
Log:
Add tests for fault docs. Add javadoc

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java?rev=802824&r1=802823&r2=802824&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java Mon Aug
10 15:26:27 2009
@@ -27,13 +27,24 @@
 
 
 /**
- * 
+ * Adds documentation nodes to the generated WSDL
  */
 @Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER })
+@Target({ ElementType.TYPE, ElementType.METHOD })
 public @interface WSDLDocumentation {
+    /**
+     * The documentation to add
+     * @return documentation string
+     */
     String value();
     
+    /**
+     * The place to put the documentation.  The Default is depends on the 
+     * location of the annotation.   On the method in the SEI, it would be
+     * the portType/operation, on the SEI, it would be the portType, on the 
+     * service impl, the service element.
+     * @return location
+     */
     Placement placement() default Placement.DEFAULT;
     
     /**

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=802824&r1=802823&r2=802824&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Mon Aug 10 15:26:27 2009
@@ -82,7 +82,7 @@
         XPathUtils xpu = new XPathUtils(ns);
         Document wsdl = XMLUtils.parse(this.getHttpConnection(ServerMisc.DOCLIT_CODEFIRST_URL
+ "?wsdl")
                                           .getInputStream());
-        XMLUtils.printDOM(wsdl.getDocumentElement());
+        //XMLUtils.printDOM(wsdl.getDocumentElement());
         assertEquals("DocLitWrappedCodeFirstService impl",
                      xpu.getValue("/wsdl:definitions/wsdl:service/wsdl:documentation",
                                   wsdl.getDocumentElement(),
@@ -143,6 +143,21 @@
                                   + "/wsdl:output/wsdl:documentation",
                                   wsdl.getDocumentElement(),
                                   XPathConstants.STRING));
+        assertEquals("fault binding doc",
+                     xpu.getValue("/wsdl:definitions/wsdl:binding/wsdl:operation[@name='throwException']"
+                                  + "/wsdl:fault/wsdl:documentation",
+                                  wsdl.getDocumentElement(),
+                                  XPathConstants.STRING));
+        assertEquals("fault porttype doc",
+                     xpu.getValue("/wsdl:definitions/wsdl:portType/wsdl:operation[@name='throwException']"
+                                  + "/wsdl:fault/wsdl:documentation",
+                                  wsdl.getDocumentElement(),
+                                  XPathConstants.STRING));
+        assertEquals("fault message doc",
+                     xpu.getValue("/wsdl:definitions/wsdl:message[@name='CustomException']"
+                                  + "/wsdl:documentation",
+                                  wsdl.getDocumentElement(),
+                                  XPathConstants.STRING));
     }
     
     @Test

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?rev=802824&r1=802823&r2=802824&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
Mon Aug 10 15:26:27 2009
@@ -139,6 +139,18 @@
     List<Foo[]> listObjectArrayOutput();
     
     @WebMethod
+    @WSDLDocumentationCollection({
+        @WSDLDocumentation(value = "fault message doc",
+                           placement = WSDLDocumentation.Placement.FAULT_MESSAGE,
+                           faultClass = CustomException.class),   
+        @WSDLDocumentation(value = "fault binding doc",
+                           placement = WSDLDocumentation.Placement.BINDING_OPERATION_FAULT,
+                           faultClass = CustomException.class),   
+        @WSDLDocumentation(value = "fault porttype doc",
+                           placement = WSDLDocumentation.Placement.PORT_TYPE_OPERATION_FAULT,
+                           faultClass = CustomException.class),   
+        }
+    )
     int throwException(int i) 
         throws ServiceTestFault,
         CustomException,



Mime
View raw message