cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1085431 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
Date Fri, 25 Mar 2011 15:44:07 GMT
Author: sergeyb
Date: Fri Mar 25 15:44:06 2011
New Revision: 1085431

URL: http://svn.apache.org/viewvc?rev=1085431&view=rev
Log:
[CXF-3423] Minor improvement

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1085431&r1=1085430&r2=1085431&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Fri Mar 25 15:44:06 2011
@@ -287,6 +287,8 @@ public class WadlGenerator implements Re
                                  OperationResourceInfo nextOp,
                                  boolean resourceTagOpened,
                                  int index) {
+        Annotation[] anns = getMethod(ori).getAnnotations();
+        
     //CHECKSTYLE:ON
         boolean samePathOperationFollows = singleResourceMultipleMethods && compareOperations(ori,
nextOp);
 
@@ -301,13 +303,13 @@ public class WadlGenerator implements Re
                 }
             }
             sb.append("<resource path=\"").append(path).append("\">");
+            handleDocs(anns, sb, DocTarget.RESOURCE, false);
             handlePathAndMatrixParams(sb, ori);
         } else if (index == 0) {
             handlePathAndMatrixParams(sb, ori);
         }
 
         startMethodTag(sb, ori);
-        Annotation[] anns = getMethod(ori).getAnnotations();
         handleDocs(anns, sb, DocTarget.METHOD, true);
         if (getMethod(ori).getParameterTypes().length != 0) {
             sb.append("<request>");

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java?rev=1085431&r1=1085430&r2=1085431&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java
Fri Mar 25 15:44:06 2011
@@ -63,16 +63,18 @@ public class BookStore {
         return new Book(1);
     }
     
-    @POST
-    @Path("books/{bookid}")
+    
     @Descriptions({ 
         @Description(value = "Update the books collection", target = DocTarget.METHOD),
         @Description(value = "Requested Book", target = DocTarget.RETURN),
         @Description(value = "Request", target = DocTarget.REQUEST),
-        @Description(value = "Response", target = DocTarget.RESPONSE)
+        @Description(value = "Response", target = DocTarget.RESPONSE),
+        @Description(value = "Resource books/{bookid}", target = DocTarget.RESOURCE)
     })
     
     //CHECKSTYLE:OFF
+    @POST
+    @Path("books/{bookid}")
     public Book addBook(@Description("book id")
                         @PathParam("id") int id,
                         @PathParam("bookid") int bookId,

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java?rev=1085431&r1=1085430&r2=1085431&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
Fri Mar 25 15:44:06 2011
@@ -375,6 +375,7 @@ public class WadlGeneratorTest extends A
         verifyGetResourceMethod(resourceEls.get(0), book2El, null);
         
         //verify resource starting with /books/{bookid}
+        checkDocs(resourceEls.get(1), "", "Resource books/{bookid}", "");
         verifyParameters(resourceEls.get(1), 3, 
                          new Param("id", "template", "xs:int", "book id"),
                          new Param("bookid", "template", "xs:int"),



Mime
View raw message