cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r706900 - /cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
Date Wed, 22 Oct 2008 08:54:48 GMT
Author: sergeyb
Date: Wed Oct 22 01:54:48 2008
New Revision: 706900

URL: http://svn.apache.org/viewvc?rev=706900&view=rev
Log:
JAX-RS : updating the system test

Modified:
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java?rev=706900&r1=706899&r2=706900&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java Wed
Oct 22 01:54:48 2008
@@ -27,6 +27,7 @@
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.ProduceMime;
+import javax.ws.rs.QueryParam;
 
 @Path("/bookstore")
 @ProduceMime("application/json")
@@ -45,8 +46,28 @@
     public Book getBookById(@PathParam("id") Long id) {
         return books.get(id);
     }
+    
+    @GET
+    @Path("/booksquery")
+    public Book getBookByQuery(@QueryParam("id") String id) {
+        
+        String[] values = id.split("\\+");
+        StringBuilder b = new StringBuilder();
+        b.append(values[0]).append(values[1]);        
+        return books.get(Long.valueOf(b.toString()));
+    }
      
     @GET
+    @Path("id={id}")
+    public Book getBookByEncodedId(@PathParam("id") String id) {
+        String[] values = id.split("\\+");
+        StringBuilder b = new StringBuilder();
+        b.append(values[0]).append(values[1]);        
+        return books.get(Long.valueOf(b.toString()));
+    }
+    
+    
+    @GET
     public Book getDefaultBook() {
         return books.get(mainId);
     }  



Mime
View raw message