cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r810336 [2/4] - in /cxf/branches/2.1.x-fixes: ./ common/common/src/main/java/org/apache/cxf/staxutils/ systests/ systests/aegis/ systests/aegis/src/test/java/org/apache/cxf/systest/aegis/ systests/jaxrs/ systests/jaxrs/src/test/java/org/apa...
Date Wed, 02 Sep 2009 02:21:50 GMT
Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java (original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java Wed Sep  2 02:21:37 2009
@@ -32,7 +32,12 @@
 
 public class W3CNamespaceContext implements NamespaceContext {
     private Element currentNode;
-
+    
+    public W3CNamespaceContext() {
+    }
+    public W3CNamespaceContext(Element el) {
+        currentNode = el;
+    }
     public String getNamespaceURI(String prefix) {
         String name = prefix;
         if (name.length() == 0) {

Modified: cxf/branches/2.1.x-fixes/systests/aegis/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/aegis/pom.xml?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/aegis/pom.xml (original)
+++ cxf/branches/2.1.x-fixes/systests/aegis/pom.xml Wed Sep  2 02:21:37 2009
@@ -21,19 +21,16 @@
     <parent>
         <artifactId>cxf-parent</artifactId>
         <groupId>org.apache.cxf</groupId>
-        <version>2.3.0-SNAPSHOT</version>
+        <version>2.1.7-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.cxf</groupId>
     <artifactId>cxf-systests-aegis</artifactId>
     <name>Apache CXF Aegis System Tests</name>
-    <version>2.3.0-SNAPSHOT</version>
+    <version>2.1.7-SNAPSHOT</version>
     <url>http://cxf.apache.org</url>
-    <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/cxf/trunk/systests/aegis</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/cxf/trunk/systests/aegis</developerConnection>
-    </scm>
+
     <build>
         <plugins>
             <plugin>
@@ -311,14 +308,6 @@
             </exclusions>
         </dependency>
         
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-databinding-sdo</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-acl</artifactId>

Modified: cxf/branches/2.1.x-fixes/systests/aegis/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/aegis/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/aegis/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java (original)
+++ cxf/branches/2.1.x-fixes/systests/aegis/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java Wed Sep  2 02:21:37 2009
@@ -23,10 +23,8 @@
 
 import javax.jws.WebService;
 
-import org.apache.cxf.annotations.Logging;
 import org.apache.cxf.systest.aegis.bean.Item;
 
-@Logging
 @WebService(endpointInterface = "org.apache.cxf.systest.aegis.AegisJaxWs")
 public class AegisJaxWsImpl implements AegisJaxWs {
     

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/pom.xml?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/pom.xml (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/pom.xml Wed Sep  2 02:21:37 2009
@@ -21,19 +21,16 @@
     <parent>
         <artifactId>cxf-parent</artifactId>
         <groupId>org.apache.cxf</groupId>
-        <version>2.3.0-SNAPSHOT</version>
+        <version>2.1.7-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.cxf</groupId>
     <artifactId>cxf-systests-jaxrs</artifactId>
     <name>Apache CXF JAX-RS System Tests</name>
-    <version>2.3.0-SNAPSHOT</version>
+    <version>2.1.7-SNAPSHOT</version>
     <url>http://cxf.apache.org</url>
-    <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs</developerConnection>
-    </scm>
+
     <build>
         <plugins>
             <plugin>
@@ -220,12 +217,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-databinding-sdo</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-testsupport</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBook.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBook.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBook.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBook.java Wed Sep  2 02:21:37 2009
@@ -20,7 +20,7 @@
 package org.apache.cxf.systest.jaxrs;
 
 import javax.ws.rs.GET;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 
 import org.apache.abdera.model.Entry;
 
@@ -35,7 +35,7 @@
     
     
     @GET
-    @Produces("application/atom+xml")
+    @ProduceMime("application/atom+xml")
     public Entry getAsEntry() {
         try {
             return AtomUtils.createBookEntry(book);

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java Wed Sep  2 02:21:37 2009
@@ -26,12 +26,12 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.ws.rs.Consumes;
+import javax.ws.rs.ConsumeMime;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.HttpHeaders;
@@ -69,7 +69,7 @@
     
     @GET
     @Path("/books/jsonfeed")
-    @Produces({"application/xml", "application/json", "text/html", "application/atom+xml" })
+    @ProduceMime({"application/xml", "application/json", "text/html", "application/atom+xml" })
     public Feed getBooksAsJsonFeed(@Context UriInfo uParam) {
         return getBooksAsFeed(uParam);    
     }
@@ -77,7 +77,7 @@
     
     @GET
     @Path("/books/feed")
-    @Produces({"application/atom+xml", "application/json" })
+    @ProduceMime({"application/atom+xml", "application/json" })
     public Feed getBooksAsFeed(@Context UriInfo uParam) {
         
         MediaType mt = headers.getMediaType();
@@ -112,7 +112,7 @@
     
     @POST
     @Path("/books/feed")
-    @Consumes("application/atom+xml")
+    @ConsumeMime("application/atom+xml")
     public Response addBookAsEntry(Entry e) {
         try {
             String text = e.getContentElement().getValue();
@@ -121,37 +121,20 @@
             Book b = (Book)jc.createUnmarshaller().unmarshal(reader);
             books.put(b.getId(), b);
             
-            URI uri = 
-                uField.getBaseUriBuilder().path("books").path("entries") 
-                                                .path(Long.toString(b.getId())).build();
-            return Response.created(uri).entity(e).build();
-        } catch (Exception ex) {
-            return Response.serverError().build();
-        }
-    }
-    
-    @POST
-    @Path("/books/feed/relative")
-    @Consumes("application/atom+xml")
-    public Response addBookAsEntryRelativeURI(Entry e) throws Exception {
-        try {
-            String text = e.getContentElement().getValue();
-            StringReader reader = new StringReader(text);
-            JAXBContext jc = JAXBContext.newInstance(Book.class);
-            Book b = (Book)jc.createUnmarshaller().unmarshal(reader);
-            books.put(b.getId(), b);
+            // this code is broken as Response does not
             
-            URI uri = URI.create("books/entries/" + Long.toString(b.getId()));
+            URI uri = 
+                uField.getBaseUriBuilder().path("books/entries", 
+                                                Long.toString(b.getId())).build();
             return Response.created(uri).entity(e).build();
         } catch (Exception ex) {
             return Response.serverError().build();
         }
     }
     
-    
     @GET
     @Path("/books/entries/{bookId}/")
-    @Produces({"application/atom+xml", "application/json" })
+    @ProduceMime({"application/atom+xml", "application/json" })
     public Entry getBookAsEntry(@PathParam("bookId") String id) throws BookNotFoundFault {
         System.out.println("----invoking getBook with id: " + id);
         Book book = books.get(Long.parseLong(id));

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java Wed Sep  2 02:21:37 2009
@@ -23,7 +23,7 @@
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
 
@@ -34,7 +34,7 @@
     
     @GET
     @Path("/")
-    @Produces({"application/atom+xml", "application/json" })
+    @ProduceMime({"application/atom+xml", "application/json" })
     public Feed getBooksAsFeed(@Context UriInfo uParam) {
         
         return super.getBooksAsFeed(uParam);

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BadgerFishProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BadgerFishProvider.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BadgerFishProvider.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BadgerFishProvider.java Wed Sep  2 02:21:37 2009
@@ -24,12 +24,11 @@
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
-import java.util.Locale;
 import java.util.Map;
 import java.util.WeakHashMap;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ConsumeMime;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
@@ -50,8 +49,8 @@
 import org.codehaus.jettison.badgerfish.BadgerFishXMLInputFactory;
 import org.codehaus.jettison.badgerfish.BadgerFishXMLOutputFactory;
 
-@Produces("application/json")
-@Consumes("application/json")
+@ProduceMime("application/json")
+@ConsumeMime("application/json")
 @Provider
 public final class BadgerFishProvider 
     implements MessageBodyReader<Object>, MessageBodyWriter<Object>  {
@@ -61,15 +60,15 @@
     @Context
     private HttpHeaders requestHeaders;  
     
-    public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType m) {
+    public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations) {
         return type.getAnnotation(XmlRootElement.class) != null;
     }
     
-    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType m) {
+    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations) {
         return type.getAnnotation(XmlRootElement.class) != null;
     }
 
-    public long getSize(Object o, Class<?> type, Type genericType, Annotation[] annotations, MediaType m) {
+    public long getSize(Object o) {
         return -1;
     }
     
@@ -96,7 +95,7 @@
     public void writeTo(Object obj, Class<?> clazz, Type genericType, Annotation[] annotations,  
         MediaType m, MultivaluedMap<String, Object> headers, OutputStream os) {
         try {
-            if (!new Locale("badgerFishLanguage").equals(requestHeaders.getLanguage())) {
+            if (!"badger-fish-language".equals(requestHeaders.getLanguage())) {
                 throw new RuntimeException();
             }
             

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Book.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Book.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Book.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Book.java Wed Sep  2 02:21:37 2009
@@ -25,7 +25,7 @@
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.xml.bind.annotation.XmlRootElement;
 
 
@@ -62,20 +62,17 @@
     
     @GET
     @Path("chapters/{chapterid}/")    
-    @Produces("application/xml;charset=ISO-8859-1")
+    @ProduceMime("application/xml;charset=ISO-8859-1")
     public Chapter getChapter(@PathParam("chapterid")int chapterid) {
-        return chapters.get(new Long(chapterid));
-    } 
+        System.out.println("----invoking getChapter with chapterid: " + chapterid);
 
-    @GET
-    @Path("chapters/badencoding/{chapterid}/")    
-    @Produces("application/xml;charset=UTF-48")
-    public Chapter getChapterBadEncoding(@PathParam("chapterid")int chapterid) {
         return chapters.get(new Long(chapterid));
-    }
+    } 
     
     @Path("chapters/sub/{chapterid}/")    
     public Chapter getSubChapter(@PathParam("chapterid")int chapterid) {
+        System.out.println("----invoking getChapter with chapterid: " + chapterid);
+
         return chapters.get(new Long(chapterid));
     }
     

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationServer.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationServer.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationServer.java Wed Sep  2 02:21:37 2009
@@ -20,7 +20,6 @@
 package org.apache.cxf.systest.jaxrs;
 
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
     
 public class BookContinuationServer extends AbstractBusTestServerBase {
@@ -28,8 +27,7 @@
     protected void run() {
         JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
         sf.setResourceClasses(BookContinuationStore.class);
-        sf.setResourceProvider(BookContinuationStore.class,
-                               new SingletonResourceProvider(new BookContinuationStore()));
+        //default lifecycle is per-request, change it to singleton
         sf.setAddress("http://localhost:9080/");
 
         sf.create();        

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookInterface.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookInterface.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookInterface.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookInterface.java Wed Sep  2 02:21:37 2009
@@ -22,24 +22,24 @@
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 
 public interface BookInterface {
 
     @GET
     @Path("/thosebooks/{bookId}/")
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
     Book getThatBook(@PathParam("bookId") Long id) throws BookNotFoundFault;
     
     
     @GET
     @Path("/thosebooks/{bookId}/{id}")
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
     Book getThatBook(@PathParam("bookId") Long id, @PathParam("id") String s) throws BookNotFoundFault;
     
     @GET
     @Path("/thosebooks")
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
     Book getThatBook() throws BookNotFoundFault;
     
 }

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java Wed Sep  2 02:21:37 2009
@@ -33,18 +33,12 @@
 
     protected void run() {
         JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
-        sf.setResourceClasses(BookStore.class, BookStorePerRequest.class);
-        
-        List<Object> providers = new ArrayList<Object>();
-        
+        sf.setResourceClasses(BookStore.class);
         //default lifecycle is per-request, change it to singleton
         BinaryDataProvider p = new BinaryDataProvider();
         p.setProduceMediaTypes(Collections.singletonList("application/bar"));
         p.setEnableBuffering(true);
-        
-        providers.add(p);
-        providers.add(new GenericHandlerWriter());
-        sf.setProviders(providers);
+        sf.setProvider(p);
         List<Interceptor> ints = new ArrayList<Interceptor>();
         ints.add(new CustomOutInterceptor());
         sf.setOutInterceptors(ints);

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java Wed Sep  2 02:21:37 2009
@@ -28,10 +28,9 @@
 import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 
-import javax.ws.rs.Consumes;
+import javax.ws.rs.ConsumeMime;
 import javax.ws.rs.DELETE;
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
@@ -41,11 +40,10 @@
 import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
-import javax.ws.rs.core.GenericEntity;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
@@ -60,7 +58,6 @@
 import javax.xml.transform.dom.DOMSource;
 
 import org.apache.cxf.helpers.XMLUtils;
-import org.apache.cxf.phase.PhaseInterceptorChain;
 
 @Path("/bookstore")
 public class BookStore {
@@ -91,21 +88,8 @@
     }
     
     @GET
-    @Path("propogateexception")
-    public Book propogateException() throws BookNotFoundFault {
-        throw new BookNotFoundFault("Book Exception");
-    }
-    
-    @GET
-    @Path("propogateexception2")
-    public Book propogateException2() throws BookNotFoundFault {
-        PhaseInterceptorChain.getCurrentMessage().put("org.apache.cxf.propogate.exception", Boolean.FALSE);
-        throw new BookNotFoundFault("Book Exception");
-    }
-    
-    @GET
     @Path("books/check/{id}")
-    @Produces("text/plain")
+    @ProduceMime("text/plain")
     public boolean checkBook(@PathParam("id") Long id) {
         return books.containsKey(id);
     }
@@ -131,7 +115,7 @@
     
     @POST
     @Path("/unsupportedcontenttype")
-    @Consumes("application/xml")
+    @ConsumeMime("application/xml")
     public String unsupportedContentType() {
         throw new IllegalStateException("This op is not expected to be invoked");
     }
@@ -142,29 +126,7 @@
         String url2 = new URL(urlValue).toString();
         int index = url2.lastIndexOf('/');
         return doGetBook(url2.substring(index + 1));
-    }
-    
-    @POST
-    @Path("/collections")
-    @Produces("application/xml")
-    @Consumes("application/xml")
-    public List<Book> getBookCollection(List<Book> bs) throws Exception {
-        if (bs == null || bs.size() != 2) {
-            throw new RuntimeException();
-        }
-        return bs;
-    }
-    
-    @POST
-    @Path("/array")
-    @Produces("application/xml")
-    @Consumes("application/xml")
-    public Book[] getBookArray(Book[] bs) throws Exception {
-        if (bs == null || bs.length != 2) {
-            throw new RuntimeException();
-        }
-        return bs;
-    }
+    } 
     
     @GET
     @Path("/segment/{pathsegment}/")
@@ -204,10 +166,10 @@
             || !MediaType.APPLICATION_XML_TYPE.isCompatible(types.get(1))) {
             throw new WebApplicationException();
         }
-        List<Locale> locales = httpHeaders.getAcceptableLanguages();
+        List<String> locales = httpHeaders.getAcceptableLanguages();
         if (locales.size() != 2 
-            || !"en".equals(locales.get(0).getLanguage())
-            || !"da".equals(locales.get(1).getLanguage())) {
+            || !"en".equals(locales.get(0))
+            || !"da".equals(locales.get(1))) {
             throw new WebApplicationException();
         }
         
@@ -241,7 +203,7 @@
 
     @GET
     @Path("/securebooks/{bookId}/")
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
     public Book getSecureBook(@PathParam("bookId") String id) throws BookNotFoundFault {
         if (!securityContext.isSecure()) {
             throw new WebApplicationException(Response.status(403).entity("Unsecure link").build());
@@ -250,53 +212,13 @@
     }
     
     @GET
-    @Path("/genericbooks/{bookId}/")
-    @Produces("application/xml")
-    public GenericEntity<GenericHandler<Book>> getGenericBook(@PathParam("bookId") String id) 
-        throws BookNotFoundFault {
-        return new GenericEntity<GenericHandler<Book>>(new GenericHandler<Book>(doGetBook(id))) { };
-    }
-    
-    @GET
-    @Path("/genericresponse/{bookId}/")
-    @Produces("application/xml")
-    public Response getGenericResponseBook(@PathParam("bookId") String id) 
-        throws BookNotFoundFault {
-        return Response.ok(getGenericBook(id)).build();
-    }
-    
-    @GET
     @Path("/books/{bookId}/")
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
     public Book getBook(@PathParam("bookId") String id) throws BookNotFoundFault {
         return doGetBook(id);
     }
     
     @GET
-    @Path("/books/{bookId}/")
-    @Produces("text/xml")
-    public Book getBookTextXml(@PathParam("bookId") String id) throws BookNotFoundFault {
-        return doGetBook(id);
-    }
-    
-    @GET
-    @Path("/books/wrapper/{bookId}/")
-    @Produces("application/xml")
-    public BookWrapper getWrappedBook(@PathParam("bookId") Long id) throws BookNotFoundFault {
-        BookWrapper bw = new BookWrapper();
-        Book b = new Book("CXF in Action", 99999L);
-        bw.setBook(b);
-        return bw;
-    }
-    
-    @GET
-    @Path("/books/wrapper2/{bookId}/")
-    @Produces("application/xml")
-    public Book getWrappedBook2(@PathParam("bookId") Long id) throws BookNotFoundFault {
-        return new Book("CXF in Action", 99999L);
-    }
-    
-    @GET
     @Path("books/custom/{bookId:\\d\\d\\d}")
     public Book getBookCustom(@PathParam("bookId") String id) throws BookNotFoundFault {
         return doGetBook(id);
@@ -347,7 +269,7 @@
     
     @GET
     @Path("/books/{bookId}/")
-    @Produces("application/json;q=0.9")
+    @ProduceMime("application/json;q=0.9")
     public Book getBookAsJSON() throws BookNotFoundFault {
         return doGetBook(currentBookId);
     }
@@ -355,21 +277,21 @@
     
     @GET
     @Path("/books/buffer")
-    @Produces("application/bar")
+    @ProduceMime("application/bar")
     public InputStream getBufferedBook() {
         return getClass().getResourceAsStream("resources/expected_get_book123.txt");
     }
     
     @GET
     @Path("/books/fail-early")
-    @Produces("application/bar")
+    @ProduceMime("application/bar")
     public StreamingOutput failEarlyInWrite() {
         return new StreamingOutputImpl(true);
     }
     
     @GET
     @Path("/books/fail-late")
-    @Produces("application/bar")
+    @ProduceMime("application/bar")
     public StreamingOutput writeToStreamAndFail() {
         return new StreamingOutputImpl(false);
     }
@@ -404,7 +326,7 @@
     
     @GET
     @Path("/booknames/{bookId}/")
-    @Produces("text/*")
+    @ProduceMime("text/*")
     public String getBookName(@PathParam("bookId") int id) throws BookNotFoundFault {
         Book book = books.get(new Long(id));
         if (book != null) {
@@ -418,17 +340,10 @@
 
     @POST
     @Path("/books")
-    @Produces("text/xml")
-    @Consumes("application/xml")
+    @ProduceMime("text/xml")
+    @ConsumeMime("application/xml")
     public Response addBook(Book book) {
-        String ct1 = httpHeaders.getMediaType().toString();
-        String ct2 = httpHeaders.getRequestHeader("Content-Type").get(0);
-        String ct3 = httpHeaders.getRequestHeaders().getFirst("Content-Type");
-        if (!("application/xml".equals(ct1) && ct1.equals(ct2) && ct1.equals(ct3))) {
-            throw new RuntimeException("Unexpected content type");
-        }
-        
-        book.setId(bookId + 1);
+        book.setId(++bookId);
         books.put(book.getId(), book);
 
         return Response.ok(book).build();
@@ -436,8 +351,8 @@
     
     @POST
     @Path("/booksinfo")
-    @Produces("text/xml")
-    @Consumes("application/xml")
+    @ProduceMime("text/xml")
+    @ConsumeMime("application/xml")
     public Response addBook(@XmlJavaTypeAdapter(BookInfoAdapter.class) 
                             BookInfo bookInfo) {
         return Response.ok(bookInfo.asBook()).build();
@@ -445,8 +360,8 @@
 
     @POST
     @Path("/binarybooks")
-    @Produces("text/xml")
-    @Consumes("application/octet-stream")
+    @ProduceMime("text/xml")
+    @ConsumeMime("application/octet-stream")
     public Response addBinaryBook(long[] book) {
         return Response.ok(book).build();
     }
@@ -494,7 +409,7 @@
     
     @PUT
     @Path("/bookswithjson/")
-    @Consumes("application/json")
+    @ConsumeMime("application/json")
     public Response updateBookJSON(Book book) {
         Book b = books.get(book.getId());
 
@@ -544,8 +459,8 @@
 
     @POST
     @Path("/booksplain")
-    @Consumes("text/plain")
-    @Produces("text/plain")
+    @ConsumeMime("text/plain")
+    @ProduceMime("text/plain")
     public Long echoBookId(long theBookId) {
         return new Long(theBookId);
     }
@@ -560,7 +475,7 @@
 
     @GET
     @Path("/cdwithmultitypes/{CDId}/")
-    @Produces({"application/xml", "application/bar+xml", "application/json" }) 
+    @ProduceMime({"application/xml", "application/bar+xml", "application/json" }) 
     public CD getCDWithMultiContentTypes(@PathParam("CDId") String id) {
         CD cd = cds.get(Long.parseLong(id));
 

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrs.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrs.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrs.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrs.java Wed Sep  2 02:21:37 2009
@@ -21,8 +21,10 @@
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
+import javax.ws.rs.ProduceMime;
 
 @Path("/myRestService")
+@ProduceMime("text/plain")
 public interface BookStoreJaxrs {
 
     @GET

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java Wed Sep  2 02:21:37 2009
@@ -22,23 +22,23 @@
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
 import javax.jws.WebService;
-import javax.ws.rs.Consumes;
+import javax.ws.rs.ConsumeMime;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 
 @WebService
 @Path("/bookstore")
-@Consumes("application/xml")
-@Produces("application/xml")
+@ConsumeMime("application/xml")
+@ProduceMime("application/xml")
 public interface BookStoreJaxrsJaxws {
     
     @WebMethod
     @GET
     @Path("/{id}")
-    @Consumes("*/*")
+    @ConsumeMime("*/*")
     Book getBook(@PathParam("id") @WebParam(name = "id") Long id) throws BookNotFoundFault;
 
     @WebMethod

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSoapRestImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSoapRestImpl.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSoapRestImpl.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSoapRestImpl.java Wed Sep  2 02:21:37 2009
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.systest.jaxrs;
 
-import java.io.OutputStream;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -29,8 +28,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Response;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
 import javax.xml.ws.WebServiceContext;
 
 import org.apache.cxf.jaxrs.client.WebClient;
@@ -62,30 +59,8 @@
     }
     
     public Book getBook(Long id) throws BookNotFoundFault {
-        
         if (books.get(id) == null) {
-            if (id == 0) {
-                try {
-                    OutputStream os = jaxrsContext.getHttpServletResponse().getOutputStream();
-                    JAXBContext c = JAXBContext.newInstance(new Class[]{Book.class});
-                    Marshaller m = c.createMarshaller();
-                    m.marshal(books.get(123L), os);
-                    os.flush();
-                    return null;
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                    throw new RuntimeException();
-                }
-            }
-            int returnCode = 404;
-            if (id == 321) {
-                returnCode = 525;
-            } else if (id == 322) {
-                BookNotFoundDetails details = new BookNotFoundDetails();
-                details.setId(id);
-                throw new BookNotFoundFault(details);
-            }
-            Response r = Response.status(returnCode).header("BOOK-HEADER", 
+            Response r = Response.status(404).header("BOOK-HEADER", 
                 "No Book with id " + id + " is available").build();
             throw new WebApplicationException(r);
         }

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java Wed Sep  2 02:21:37 2009
@@ -23,21 +23,19 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.ws.rs.Consumes;
+import javax.ws.rs.ConsumeMime;
 import javax.ws.rs.GET;
-import javax.ws.rs.MatrixParam;
 import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriInfo;
 
 @Path("/")
-@Produces("application/json")
+@ProduceMime("application/json")
 public class BookStoreSpring {
 
     private Map<Long, Book> books = new HashMap<Long, Book>();
@@ -58,19 +56,12 @@
     
     @GET
     @Path("/books/{id}")
-    @Produces({"application/jettison", "application/json" })
+    @ProduceMime({"application/jettison", "application/json" })
     public Book getBookById(@PathParam("id") Long id) {
         return books.get(id);
     }
     
     @GET
-    @Path("/bookstore/books/{id}")
-    @Produces("application/xml")
-    public Book getBookXml(@PathParam("id") Long id) {
-        return books.get(id);
-    }
-    
-    @GET
     @Path("/bookinfo")
     public Book getBookByUriInfo() throws Exception {
         MultivaluedMap<String, String> params = ui.getQueryParameters();
@@ -105,8 +96,8 @@
 
     @POST
     @Path("books/convert")
-    @Consumes({"application/xml", "application/json", "application/jettison" })
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
+    @ConsumeMime({"application/xml", "application/json", "application/jettison" })
     public Book convertBook(Book2 book) {
         // how to have Book2 populated ?
         Book b = new Book();
@@ -115,44 +106,7 @@
         return b;
     }
     
-    @PUT
-    @Path("books/convert2")
-    @Consumes({"application/xml", "application/json", "application/jettison" })
-    @Produces("application/xml")
-    public Book convertBook2(Book2 book) {
-        return convertBook(book);
-    }
-    
-    @GET
-    @Path("books/aegis")
-    @Produces({"application/html;q=1.0", "application/xml;q=0.5", "application/json;q=0.5" })
-    public Book getBookAegis() {
-        // how to have Book2 populated ?
-        Book b = new Book();
-        b.setId(124);
-        b.setName("CXF in Action - 2");
-        return b;
-    }
-    
-    @RETRIEVE
-    @Path("books/aegis/retrieve")
-    @Produces({"application/html;q=0.5", "application/xml;q=1.0", "application/json;q=0.5" })
-    public Book getBookAegisRetrieve() {
-        return getBookAegis();
-    }
     
-    @GET
-    @Path("books/xslt/{id}")
-    @Produces({"text/html", "application/xhtml+xml", "application/xml" })
-    public Book getBookXSLT(@PathParam("id") long id, 
-                            @QueryParam("name") String name,
-                            @MatrixParam("name2") String name2) {
-        // how to have Book2 populated ?
-        Book b = new Book();
-        b.setId(999);
-        b.setName("CXF in ");
-        return b;
-    }
     
     final void init() {
         Book book = new Book();

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresource.java Wed Sep  2 02:21:37 2009
@@ -19,54 +19,41 @@
 
 package org.apache.cxf.systest.jaxrs;
 
-import javax.ws.rs.Consumes;
+import javax.ws.rs.ConsumeMime;
 import javax.ws.rs.CookieParam;
-import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
 import javax.ws.rs.HeaderParam;
 import javax.ws.rs.MatrixParam;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MultivaluedMap;
+
+import org.apache.cxf.customer.book.BookNotFoundFault;
 
 public interface BookSubresource {
     
     @GET
     @Path("/subresource")
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
     Book getTheBook() throws BookNotFoundFault;
     
-    @GET
-    @Path("/subresource/noproduces")
-    Book getTheBookNoProduces() throws BookNotFoundFault;
-    
     @POST
     @Path("/subresource2/{n1:.*}")
-    @Consumes("text/plain")
-    @Produces("application/xml")
+    @ConsumeMime("text/plain")
+    @ProduceMime("application/xml")
     Book getTheBook2(@PathParam("n1") String name1,
                      @QueryParam("n2") String name2,
                      @MatrixParam("n3") String name3,
-                     @MatrixParam("n33") String name33,
                      @HeaderParam("N4") String name4,
                      @CookieParam("n5") String name5,
                      String name6) throws BookNotFoundFault;
     
     @POST
     @Path("/subresource3")
-    Book getTheBook3(@FormParam("id") String id,
-                     @FormParam("name") String name,
-                     @FormParam("nameid") Integer nameid) throws BookNotFoundFault;
-    
-    @GET
-    @Path("/subresource4/{id}/{name}")
-    @Produces("application/xml")
-    Book getTheBook4(@PathParam("") Book bookPath,
-                     @QueryParam("") Book bookQuery,
-                     @MatrixParam("") Book matrixBook) throws BookNotFoundFault;
-    
+    Book getTheBook3(MultivaluedMap<String, String> form) throws BookNotFoundFault;
     
 }
 

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java Wed Sep  2 02:21:37 2009
@@ -19,6 +19,10 @@
 
 package org.apache.cxf.systest.jaxrs;
 
+import javax.ws.rs.core.MultivaluedMap;
+
+import org.apache.cxf.customer.book.BookNotFoundFault;
+
 public class BookSubresourceImpl implements BookSubresource {
 
     private Long id;
@@ -43,45 +47,21 @@
         return b;
     }
 
-    public Book getTheBook2(String n1, String n2, String n3, String n33, 
-                            String n4, String n5, String n6) 
+    public Book getTheBook2(String n1, String n2, String n3, String n4, String n5, String n6) 
         throws BookNotFoundFault {
         
         Book b = new Book();
         b.setId(id); 
-        b.setName(n1 + n2 + n3 + n33 + n4 + n5 + n6);
+        b.setName(n1 + n2 + n3 + n4 + n5 + n6);
         return b;
     }
     
-    public Book getTheBook3(String sid, String name, Integer nameid) throws BookNotFoundFault {
+    public Book getTheBook3(MultivaluedMap<String, String> form) throws BookNotFoundFault {
         Book b = new Book();
         
-        b.setId(Long.valueOf(sid)); 
-        b.setName(name + nameid.toString());
+        b.setId(Long.valueOf(form.getFirst("id"))); 
+        b.setName(form.getFirst("name"));
         return b;
     }
-    
-    public Book getTheBook4(Book bookPath, Book bookQuery, Book bookMatrix) throws BookNotFoundFault {
-        if (bookPath == null || bookQuery == null || bookMatrix == null) {
-            throw new RuntimeException();
-        }
-        long id1 = bookPath.getId();
-        long id2 = bookQuery.getId();
-        long id3 = bookMatrix.getId();
-        if (id1 != 139L || id1 != id2 || id1 != id3 || id1 != id.longValue()) {
-            throw new RuntimeException();
-        }
-        String name1 = bookPath.getName();
-        String name2 = bookQuery.getName();
-        String name3 = bookMatrix.getName();
-        if (!"CXF Rocks".equals(name1) || !name1.equals(name2) || !name1.equals(name3)) {
-            throw new RuntimeException();
-        }
-        return bookPath;
-    }
-
-    public Book getTheBookNoProduces() throws BookNotFoundFault {
-        return getTheBook();
-    }
 
 }

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Chapter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Chapter.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Chapter.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/Chapter.java Wed Sep  2 02:21:37 2009
@@ -24,8 +24,7 @@
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
@@ -57,7 +56,7 @@
     
     @GET
     @Path("/recurse")
-    @Produces("application/xml")
+    @ProduceMime("application/xml")
     public Chapter getItself() {
         return this;
     }
@@ -68,29 +67,18 @@
     }
     
     @GET
-    @Produces("application/xml;charset=ISO-8859-1")
+    @ProduceMime("application/xml;charset=ISO-8859-1")
     public Chapter get() {
         return this;
     }
-    
-    @GET
-    @Path("/ids")
-    @Produces("application/xml;charset=ISO-8859-1")
-    public Chapter getWithBookId(@PathParam("bookId") int bookId,
-                                 @PathParam("chapterid") int chapterId) {
-        if (bookId != 123 || chapterId != 1) {
-            throw new RuntimeException();
-        }
-        return this;
-    }
 
     
     @GET
     @Path("/matched-resources")
-    @Produces("text/plain")
+    @ProduceMime("text/plain")
     public String getMatchedResources(@Context UriInfo ui) {
         List<String> list = new ArrayList<String>();
-        for (Object obj : ui.getMatchedResources()) {
+        for (Object obj : ui.getAncestorResources()) {
             list.add(obj.toString());
         }
         return list.toString();
@@ -98,9 +86,9 @@
 
     @GET
     @Path("/matched%21uris")
-    @Produces("text/plain")
+    @ProduceMime("text/plain")
     public String getMatchedUris(@Context UriInfo ui, 
                                  @QueryParam("decode") String decode) {
-        return ui.getMatchedURIs(Boolean.parseBoolean(decode)).toString();        
+        return ui.getAncestorResourceURIs(Boolean.parseBoolean(decode)).toString();        
     }
 }

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAtomBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAtomBookTest.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAtomBookTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAtomBookTest.java Wed Sep  2 02:21:37 2009
@@ -71,8 +71,32 @@
                           + " application/xhtml+xml, image/png, image/jpeg, image/gif,"
                           + " image/x-xbitmap, */*;q=0.1");
         
-        Entry entry = addEntry(endpointAddress);
-        entry = addEntry(endpointAddress + "/relative");
+        Entry e = createBookEntry(256, "AtomBook");
+        StringWriter w = new StringWriter();
+        e.writeTo(w);
+        
+        PostMethod post = new PostMethod(endpointAddress);
+        post.setRequestEntity(
+             new StringRequestEntity(w.toString(), "application/atom+xml", null));
+        HttpClient httpclient = new HttpClient();
+        
+        String location = null;
+        try {
+            int result = httpclient.executeMethod(post);
+            assertEquals(201, result);
+            location = post.getResponseHeader("Location").getValue();
+            InputStream ins = post.getResponseBodyAsStream();
+            Document<Entry> entryDoc = abdera.getParser().parse(copyIn(ins));
+            assertEquals(entryDoc.getRoot().toString(), e.toString());
+        } finally {
+            post.releaseConnection();
+        }         
+        
+        Entry entry = getEntry(location, null);
+        assertEquals(location, entry.getBaseUri().toString());
+        assertEquals("AtomBook", entry.getTitle());
+                
+        
         
         endpointAddress =
             "http://localhost:9080/bookstore/bookstore/books/subresources/123"; 
@@ -100,34 +124,6 @@
         
     }
     
-    private Entry addEntry(String endpointAddress) throws Exception {
-        Entry e = createBookEntry(256, "AtomBook");
-        StringWriter w = new StringWriter();
-        e.writeTo(w);
-        
-        PostMethod post = new PostMethod(endpointAddress);
-        post.setRequestEntity(
-             new StringRequestEntity(w.toString(), "application/atom+xml", null));
-        HttpClient httpclient = new HttpClient();
-        
-        String location = null;
-        try {
-            int result = httpclient.executeMethod(post);
-            assertEquals(201, result);
-            location = post.getResponseHeader("Location").getValue();
-            InputStream ins = post.getResponseBodyAsStream();
-            Document<Entry> entryDoc = abdera.getParser().parse(copyIn(ins));
-            assertEquals(entryDoc.getRoot().toString(), e.toString());
-        } finally {
-            post.releaseConnection();
-        }         
-        
-        Entry entry = getEntry(location, null);
-        assertEquals(location, entry.getBaseUri().toString());
-        assertEquals("AtomBook", entry.getTitle());
-        return entry;
-    }
-    
     @Test
     public void testGetBooks2() throws Exception {
         String endpointAddress =

Propchange: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAtomBookTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Sep  2 02:21:37 2009
@@ -0,0 +1,2 @@
+/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAtomBookTest.java:810203-810224,810236
+/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAtomBookTest.java:809663,809706

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Wed Sep  2 02:21:37 2009
@@ -23,10 +23,7 @@
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
 
 import javax.ws.rs.core.Response;
 
@@ -42,12 +39,9 @@
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.cxf.jaxrs.ext.xml.XMLSource;
-import org.apache.cxf.jaxrs.provider.XSLTJaxbProvider;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
@@ -58,23 +52,6 @@
                    launchServer(BookServer.class));
     }
     
-    
-    @Test
-    public void testPropogateException() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/propogateexception",
-                      "", "application/xml", 500);
-    }
-    
-    @Test
-    public void testPropogateException2() throws Exception {
-        String data = "<ns1:XMLFault xmlns:ns1=\"http://cxf.apache.org/bindings/xformat\">"
-            + "<ns1:faultstring xmlns:ns1=\"http://cxf.apache.org/bindings/xformat\">"
-            + "org.apache.cxf.systest.jaxrs.BookNotFoundFault: Book Exception</ns1:faultstring>"
-            + "</ns1:XMLFault>";
-        getAndCompare("http://localhost:9080/bookstore/propogateexception2",
-                      data, "application/xml", 500);
-    }
-    
     @Test
     public void testWebApplicationException() throws Exception {
         getAndCompare("http://localhost:9080/bookstore/webappexception",
@@ -82,60 +59,6 @@
                       "application/xml", 500);
     }
     
-    @Test 
-    public void testAddBookProxyResponse() {
-        BookStore store = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
-        Book b = new Book("CXF rocks", 123L);
-        Response r = store.addBook(b);
-        assertNotNull(r);
-        InputStream is = (InputStream)r.getEntity();
-        assertNotNull(is);
-        XMLSource source = new XMLSource(is);
-        source.setBuffering(true);
-        assertEquals(124L, Long.parseLong(source.getValue("Book/id")));
-        assertEquals("CXF rocks", source.getValue("Book/name"));
-    }
-    
-    @Test 
-    public void testGetBookCollection() throws Exception {
-        BookStore store = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
-        Book b1 = new Book("CXF in Action", 123L);
-        Book b2 = new Book("CXF Rocks", 124L);
-        List<Book> books = new ArrayList<Book>();
-        books.add(b1);
-        books.add(b2);
-        List<Book> books2 = store.getBookCollection(books);
-        assertNotNull(books2);
-        assertNotSame(books, books2);
-        assertEquals(2, books2.size());
-        Book b11 = books.get(0);
-        assertEquals(123L, b11.getId());
-        assertEquals("CXF in Action", b11.getName());
-        Book b22 = books.get(1);
-        assertEquals(124L, b22.getId());
-        assertEquals("CXF Rocks", b22.getName());
-    }
-    
-    @Test 
-    public void testGetBookArray() throws Exception {
-        BookStore store = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
-        Book b1 = new Book("CXF in Action", 123L);
-        Book b2 = new Book("CXF Rocks", 124L);
-        Book[] books = new Book[2];
-        books[0] = b1;
-        books[1] = b2;
-        Book[] books2 = store.getBookArray(books);
-        assertNotNull(books2);
-        assertNotSame(books, books2);
-        assertEquals(2, books2.length);
-        Book b11 = books2[0];
-        assertEquals(123L, b11.getId());
-        assertEquals("CXF in Action", b11.getName());
-        Book b22 = books2[1];
-        assertEquals(124L, b22.getId());
-        assertEquals("CXF Rocks", b22.getName());
-    }
-    
     @Test
     public void testGetBookByURL() throws Exception {
         getAndCompareAsStrings("http://localhost:9080/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123",
@@ -144,55 +67,6 @@
     }
     
     @Test
-    public void testHeadBookByURL() throws Exception {
-        WebClient wc = 
-            WebClient.create("http://localhost:9080/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123");
-        Response response = wc.head();
-        assertTrue(response.getMetadata().size() != 0);
-        assertEquals(0, ((InputStream)response.getEntity()).available());
-    }
-    
-    @Test
-    public void testWebClientUnwrapBookWithXslt() throws Exception {
-        XSLTJaxbProvider provider = new XSLTJaxbProvider();
-        provider.setInTemplate("classpath:/org/apache/cxf/systest/jaxrs/resources/unwrapbook.xsl");
-        WebClient wc = WebClient.create("http://localhost:9080/bookstore/books/wrapper",
-                             Collections.singletonList(provider));
-        wc.path("{id}", 123);
-        Book book = wc.get(Book.class);
-        assertNotNull(book);
-        assertEquals(123L, book.getId());
-        
-    }
-    
-    @Test
-    @Ignore
-    // uncomment once I can figure out how to set for this test only
-    // com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize - JAXB is a pain
-    public void testProxyUnwrapBookWithXslt() throws Exception {
-        XSLTJaxbProvider provider = new XSLTJaxbProvider();
-        provider.setInTemplate("classpath:/org/apache/cxf/systest/jaxrs/resources/unwrapbook2.xsl");
-        BookStore bs = JAXRSClientFactory.create("http://localhost:9080", BookStore.class,
-                             Collections.singletonList(provider));
-        Book book = bs.getWrappedBook2(123L);
-        assertNotNull(book);
-        assertEquals(123L, book.getId());
-        
-    }
-    
-    @Test
-    public void testOptions() throws Exception {
-        WebClient wc = 
-            WebClient.create("http://localhost:9080/bookstore/bookurl/http%3A%2F%2Ftest.com%2Frss%2F123");
-        Response response = wc.options();
-        List<Object> values = response.getMetadata().get("Allow");
-        assertNotNull(values);
-        assertTrue(values.contains("POST") && values.contains("GET")
-                   && values.contains("DELETE") && values.contains("PUT"));
-        assertEquals(0, ((InputStream)response.getEntity()).available());
-    }
-    
-    @Test
     public void testGetBookByEncodedQuery() throws Exception {
         getAndCompareAsStrings("http://localhost:9080/bookstore/bookquery?"
                                + "urlid=http%3A%2F%2Ftest.com%2Frss%2F123",
@@ -201,20 +75,6 @@
     }
     
     @Test
-    public void testGetGenericBook() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/genericbooks/123",
-                               "resources/expected_get_book123.txt",
-                               "application/xml", 200);
-    }
-    
-    @Test
-    public void testGetGenericResponseBook() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore/genericresponse/123",
-                               "resources/expected_get_book123.txt",
-                               "application/xml", 200);
-    }
-    
-    @Test
     public void testGetBookByArrayQuery() throws Exception {
         getAndCompareAsStrings("http://localhost:9080/bookstore/bookidarray?"
                                + "id=1&id=2&id=3",
@@ -339,7 +199,7 @@
     @Test
     public void testBookExists() throws Exception {
         checkBook("http://localhost:9080/bookstore/books/check/123", true);
-        checkBook("http://localhost:9080/bookstore/books/check/125", false);  
+        checkBook("http://localhost:9080/bookstore/books/check/124", false);  
         
     }
     
@@ -375,7 +235,7 @@
     public void testGetBook123WebClient() throws Exception {
         BookStore bs = JAXRSClientFactory.create("http://localhost:9080", BookStore.class);
         Book b = bs.getBook("123");
-        assertEquals(b.getId(), 123);
+        assertEquals(b.getId(), 123L);
     }
     
     @Test
@@ -495,13 +355,6 @@
     }
     
     @Test
-    public void testGetBookByHeaderPerRequest() throws Exception {
-        getAndCompareAsStrings("http://localhost:9080/bookstore2/bookheaders",
-                               "resources/expected_get_book123.txt",
-                               "application/xml;q=0.5,text/xml", "text/xml", 200);
-    }
-    
-    @Test
     public void testGetBookByHeaderDefault() throws Exception {
         getAndCompareAsStrings("http://localhost:9080/bookstore/bookheaders2",
                                "resources/expected_get_book123.txt",
@@ -550,14 +403,6 @@
     }
     
     @Test
-    public void testGetChapterEncodingDefault() throws Exception {
-        
-        getAndCompareAsStrings("http://localhost:9080/bookstore/booksubresource/123/chapters/badencoding/1",
-                               "resources/expected_get_chapter1_utf.txt",
-                               "application/xml", "application/xml;charset=UTF-8", 200);
-    }
-    
-    @Test
     public void testGetChapterChapter() throws Exception {
         
         getAndCompareAsStrings("http://localhost:9080/bookstore/booksubresource/123/chapters/sub/1/recurse",
@@ -569,15 +414,6 @@
     }
     
     @Test
-    public void testGetChapterWithParentIds() throws Exception {
-        
-        getAndCompareAsStrings(
-            "http://localhost:9080/bookstore/booksubresource/123/chapters/sub/1/recurse2/ids",
-            "resources/expected_get_chapter1.txt",
-            "application/xml", "application/xml;charset=iso-8859-1", 200);
-    }
-    
-    @Test
     public void testGetBook123ReturnString() throws Exception {
         getAndCompareAsStrings("http://localhost:9080/bookstore/booknames/123",
                                "resources/expected_get_book123_returnstring.txt",
@@ -585,6 +421,14 @@
     }
     
     @Test
+    public void testGetBookNotFound() throws Exception {
+        
+        getAndCompareAsStrings("http://localhost:9080/bookstore/books/126",
+                               "resources/expected_get_book_notfound.txt",
+                               "application/xml", "text/xml; charset=utf-8", 500);
+    }
+    
+    @Test
     public void testAddBook() throws Exception {
         doAddBook("http://localhost:9080/bookstore/books");               
     }
@@ -989,10 +833,6 @@
                          expectedValue, content);
             if (expectedStatus == 200) {
                 assertEquals("123", get.getResponseHeader("BookId").getValue());
-                assertNotNull(get.getResponseHeader("Date"));
-            }
-            if (expectedStatus == 405) {
-                assertNotNull(get.getResponseHeader("Allow"));
             }
             if (expectedContentType != null) {
                 Header ct = get.getResponseHeader("Content-Type");

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java Wed Sep  2 02:21:37 2009
@@ -20,7 +20,6 @@
 package org.apache.cxf.systest.jaxrs;
 
 import java.io.InputStream;
-import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
 
@@ -39,60 +38,51 @@
     }
     
     @Test
-    public void testGetBookNotFound() throws Exception {
-        
+    public void testGetThatBook123() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/test/bookstore/books/12345"; 
+            "http://localhost:9080/test/bookstorestorage/thosebooks/123"; 
         URL url = new URL(endpointAddress);
-        HttpURLConnection connect = (HttpURLConnection)url.openConnection();
-        connect.addRequestProperty("Accept", "text/plain,application/xml");
-        assertEquals(500, connect.getResponseCode());
-        InputStream in = connect.getErrorStream();
-        assertNotNull(in);           
+        URLConnection connect = url.openConnection();
+        connect.addRequestProperty("Accept", "application/xml");
+        InputStream in = connect.getInputStream();           
 
         InputStream expected = getClass()
-            .getResourceAsStream("resources/expected_get_book_notfound_mapped.txt");
+            .getResourceAsStream("resources/expected_get_book123.txt");
 
-        assertEquals("Exception is not mapped correctly", 
-                     getStringFromInputStream(expected).trim(),
-                     getStringFromInputStream(in).trim());
-    }
-    
-    @Test
-    public void testGetThatBook123() throws Exception {
-        getBook("http://localhost:9080/test/bookstorestorage/thosebooks/123");
-    }
-    
-    @Test
-    public void testGetThatBook123UserResource() throws Exception {
-        getBook("http://localhost:9080/test/2/bookstore/books/123");
+        //System.out.println("---" + getStringFromInputStream(in));
+        assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in)); 
     }
     
     @Test
-    public void testGetThatBook123UserResourceInterface() throws Exception {
-        getBook("http://localhost:9080/test/3/bookstore2/books/123");
-    }
-    
-    private void getBook(String endpointAddress) throws Exception {
+    public void testGetThatBookOverloaded() throws Exception {
+        String endpointAddress =
+            "http://localhost:9080/test/bookstorestorage/thosebooks/123/123"; 
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
-        connect.addRequestProperty("Content-Type", "*/*");
         connect.addRequestProperty("Accept", "application/xml");
         InputStream in = connect.getInputStream();           
 
         InputStream expected = getClass()
             .getResourceAsStream("resources/expected_get_book123.txt");
-        assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in));
-    }
-    
-    @Test
-    public void testGetThatBookOverloaded() throws Exception {
-        getBook("http://localhost:9080/test/bookstorestorage/thosebooks/123/123");
+
+        //System.out.println("---" + getStringFromInputStream(in));
+        assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in)); 
     }
     
     @Test
     public void testGetThatBookOverloaded2() throws Exception {
-        getBook("http://localhost:9080/test/bookstorestorage/thosebooks");
+        String endpointAddress =
+            "http://localhost:9080/test/bookstorestorage/thosebooks"; 
+        URL url = new URL(endpointAddress);
+        URLConnection connect = url.openConnection();
+        connect.addRequestProperty("Accept", "application/xml");
+        InputStream in = connect.getInputStream();           
+
+        InputStream expected = getClass()
+            .getResourceAsStream("resources/expected_get_book123.txt");
+
+        //System.out.println("---" + getStringFromInputStream(in));
+        assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in)); 
     }
     
     @Test

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java Wed Sep  2 02:21:37 2009
@@ -22,22 +22,13 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.net.HttpURLConnection;
-import java.net.Socket;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.List;
 
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -46,58 +37,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                   launchServer(BookServerResourceCreatedSpringProviders.class));
-    }
-    
-    @Test
-    public void testMultipleRootsWadl() throws Exception {
-        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:9080/webapp/",
-                                                         "http://localhost:9080/webapp/", 2);
-        String path1 = resourceEls.get(0).getAttribute("path");
-        int bookStoreInd = path1.contains("/bookstore") ? 0 : 1;
-        int petStoreInd = bookStoreInd == 0 ? 1 : 0;
-        checkBookStoreInfo(resourceEls.get(bookStoreInd));
-        checkPetStoreInfo(resourceEls.get(petStoreInd));
-    }
-    
-    @Test
-    public void testBookStoreWadl() throws Exception {
-        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:9080/webapp/",
-                                                         "http://localhost:9080/webapp/bookstore", 1);
-        checkBookStoreInfo(resourceEls.get(0));
-    }
-    
-    @Test
-    public void testPetStoreWadl() throws Exception {
-        List<Element> resourceEls = getWadlResourcesInfo("http://localhost:9080/webapp/",
-                                                         "http://localhost:9080/webapp/petstore", 1);
-        checkPetStoreInfo(resourceEls.get(0));
-    }
- 
-    private void checkBookStoreInfo(Element resource) {
-        assertEquals("/bookstore", resource.getAttribute("path"));
-    }
-    
-    private void checkPetStoreInfo(Element resource) {
-        assertEquals("/petstore/", resource.getAttribute("path"));
-    }
-    
-    private List<Element> getWadlResourcesInfo(String baseURI, String requestURI, int size) throws Exception {
-        WebClient client = WebClient.create(requestURI + "?_wadl&_type=xml");
-        Document doc = DOMUtils.readXml(new InputStreamReader(client.get(InputStream.class), "UTF-8"));
-        Element root = doc.getDocumentElement();
-        assertEquals("http://research.sun.com/wadl/2006/10", root.getNamespaceURI());
-        assertEquals("application", root.getLocalName());
-        List<Element> resourcesEls = DOMUtils.getChildrenWithName(root, 
-                                            "http://research.sun.com/wadl/2006/10", "resources");
-        assertEquals(1, resourcesEls.size());
-        Element resourcesEl =  resourcesEls.get(0);
-        assertEquals(baseURI, resourcesEl.getAttribute("base"));
-        List<Element> resourceEls = 
-            DOMUtils.getChildrenWithName(resourcesEl, 
-                                                "http://research.sun.com/wadl/2006/10", "resource");
-        assertEquals(size, resourceEls.size());
-        return resourceEls;
+                   launchServer(BookServerResourceCreatedSpringProviders.class, true));
     }
     
     @Test
@@ -108,7 +48,7 @@
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
         connect.addRequestProperty("Accept", "application/json");
-        connect.addRequestProperty("Content-Language", "badgerFishLanguage");
+        connect.addRequestProperty("Content-Language", "badger-fish-language");
         InputStream in = connect.getInputStream();
         assertNotNull(in);           
 
@@ -142,23 +82,6 @@
     }
     
     @Test
-    public void testGetBookNotExistent() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/webapp/bookstore/nonexistent"; 
-        URL url = new URL(endpointAddress);
-        HttpURLConnection connect = (HttpURLConnection)url.openConnection();
-        connect.addRequestProperty("Accept", "application/xml");
-        assertEquals(405, connect.getResponseCode());
-        InputStream in = connect.getErrorStream();
-        assertNotNull(in);           
-
-        assertEquals("Exception is not mapped correctly", 
-                     "Nonexistent method",
-                     getStringFromInputStream(in).trim());
-    }
-    
-    @Test
     public void testPostPetStatus() throws Exception {
         
         String endpointAddress =
@@ -175,6 +98,7 @@
         httpUrlConnection.setRequestProperty("Accept",   "text/xml");   
         httpUrlConnection.setRequestProperty("Content-type",   "application/x-www-form-urlencoded");   
         httpUrlConnection.setRequestProperty("Connection",   "close");   
+        //httpurlconnection.setRequestProperty("Content-Length",   String.valueOf(is.available()));   
 
         OutputStream outputstream = httpUrlConnection.getOutputStream();
         File inputFile = new File(getClass().getResource("resources/singleValPostBody.txt").toURI());         
@@ -199,23 +123,6 @@
         httpUrlConnection.disconnect();
     }
     
-    @Test
-    public void testPostPetStatus2() throws Exception {
-        
-        
-        Socket s = new Socket("localhost", 9080);
-        IOUtils.copyAndCloseInput(getClass().getResource("resources/formRequest.txt").openStream(), 
-                                  s.getOutputStream());
-
-        s.getOutputStream().flush();
-        try {
-            assertTrue("Wrong status returned", getStringFromInputStream(s.getInputStream())
-                       .contains("open"));  
-        } finally {
-            s.close();
-        }
-    }
-    
     private String getStringFromInputStream(InputStream in) throws Exception {
         return IOUtils.toString(in);
     }

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java Wed Sep  2 02:21:37 2009
@@ -19,19 +19,10 @@
 
 package org.apache.cxf.systest.jaxrs;
 
-import java.io.BufferedReader;
 import java.io.File;
 import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.Socket;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.FileRequestEntity;
@@ -39,14 +30,8 @@
 import org.apache.commons.httpclient.methods.RequestEntity;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.io.CachedOutputStream;
-import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.cxf.jaxrs.ext.xml.XMLSource;
-import org.apache.cxf.jaxrs.provider.AegisElementProvider;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTestBase {
@@ -54,7 +39,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
-                   launchServer(BookServerSpring.class));
+                   launchServer(BookServerSpring.class, true));
     }
     
     @Test
@@ -66,21 +51,6 @@
     }
     
     @Test
-    public void testGetBookXSLTHtml() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/xslt";
-        WebClient wc = WebClient.create(endpointAddress);
-        wc.accept("application/xhtml+xml").path(666).matrix("name2", 2).query("name", "Action - ");
-        XMLSource source = wc.get(XMLSource.class);
-        Map<String, String> namespaces = new HashMap<String, String>();
-        namespaces.put("xhtml", "http://www.w3.org/1999/xhtml");
-        Book2 b = source.getNode("xhtml:html/xhtml:body/xhtml:ul/xhtml:Book", namespaces, Book2.class);
-        assertEquals(666, b.getId());
-        assertEquals("CXF in Action - 2", b.getName());
-    }
-
-    @Test
     public void testGetBookByUriInfo2() throws Exception {
         String endpointAddress =
             "http://localhost:9080/the/thebooks3/bookstore/bookinfo?"
@@ -142,40 +112,15 @@
     }
     
     private void getBook(String endpointAddress, String resource, String type) throws Exception {
-        getBook(endpointAddress, resource, type, null);
-    }
-    
-    private void getBook(String endpointAddress, String resource, String type, String mHeader) 
-        throws Exception {
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
-        connect.addRequestProperty("Content-Type", "*/*");
         connect.addRequestProperty("Accept", type);
-        if (mHeader != null) {
-            connect.addRequestProperty("X-HTTP-Method-Override", mHeader);
-        }
         InputStream in = connect.getInputStream();           
 
         InputStream expected = getClass().getResourceAsStream(resource);
         assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in));
     }
     
-    private void getBookAegis(String endpointAddress, String type) throws Exception {
-        getBookAegis(endpointAddress, type, null);
-    }
-    
-    private void getBookAegis(String endpointAddress, String type, String mHeader) throws Exception {
-        WebClient client = WebClient.create(endpointAddress,
-            Collections.singletonList(new AegisElementProvider()));
-        if (mHeader != null) {
-            client = client.header("X-HTTP-Method-Override", mHeader);
-        }
-        Book book = client.accept(type).get(Book.class);
-
-        assertEquals(124L, book.getId());
-        assertEquals("CXF in Action - 2", book.getName());
-    }
-    
     @Test
     public void testAddInvalidXmlBook() throws Exception {
         
@@ -226,132 +171,6 @@
                "resources/expected_get_book123.txt");
                 
     }
-
-    @Test
-    public void testGetBookAegis() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks4/bookstore/books/aegis"; 
-        getBookAegis(endpointAddress, "application/xml"); 
-    }
-    
-    @Test
-    public void testRetrieveBookAegis1() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks4/bookstore/books/aegis/retrieve?_method=RETRIEVE"; 
-        getBookAegis(endpointAddress, "application/xml"); 
-    }
-    
-    @Test
-    public void testRetrieveBookAegis2() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks4/bookstore/books/aegis/retrieve"; 
-        getBookAegis(endpointAddress, "application/xml", "RETRIEVE"); 
-    }
-    
-    @Test
-    public void testRetrieveBookAegis3() throws Exception {
-        
-        Socket s = new Socket("localhost", 9080);
-        
-        InputStream is = this.getClass().getResourceAsStream("resources/retrieveRequest.txt");
-        byte[] bytes = IOUtils.readBytesFromStream(is);
-        s.getOutputStream().write(bytes);
-        s.getOutputStream().flush();
-        
-        BufferedReader r = new BufferedReader(new InputStreamReader(s.getInputStream()));
-        StringBuilder sb = new StringBuilder();
-        String str = null;
-        while ((str = r.readLine()) != null) {
-            sb.append(str);
-        }
-        
-        String aegisData = sb.toString();
-        s.getInputStream().close();
-        s.close();
-        assertTrue(aegisData.contains("CXF in Action - 2"));
-        
-    }
-    
-    @Test
-    public void testGetBookUserResource() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks6/bookstore/books/123"; 
-        getBook(endpointAddress, "resources/expected_get_book123.txt", "application/xml"); 
-    }
-    
-    @Test
-    public void testGetBookUserResource2() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks7/bookstore/books/123"; 
-        getBook(endpointAddress, "resources/expected_get_book123.txt", "application/xml"); 
-    }
-    
-    @Test
-    public void testGetBookUserResourceFromProxy() throws Exception {
-        
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks6"; 
-        BookStoreNoAnnotations bStore = JAXRSClientFactory.createFromModel(
-                                         endpointAddress, 
-                                         BookStoreNoAnnotations.class,
-                                         "classpath:/org/apache/cxf/systest/jaxrs/resources/resources.xml",
-                                         null);
-        Book b = bStore.getBook(123L);
-        assertNotNull(b);
-        assertEquals(123L, b.getId());
-        assertEquals("CXF in Action", b.getName());
-        ChapterNoAnnotations proxy = bStore.getBookChapter(123L);
-        ChapterNoAnnotations c = proxy.getItself();
-        assertNotNull(c);
-        assertEquals(1, c.getId());
-        assertEquals("chapter 1", c.getTitle());
-    }
-    
-    @Test
-    public void testGetBookXSLTXml() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/xslt";
-        WebClient wc = WebClient.create(endpointAddress);
-        wc.accept("application/xml").path(666).matrix("name2", 2).query("name", "Action - ");
-        Book b = wc.get(Book.class);
-        assertEquals(666, b.getId());
-        assertEquals("CXF in Action - 2", b.getName());
-    }
-    
-    @Test
-    public void testReaderWriterFromJaxrsFilters() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/convert2";
-        WebClient wc = WebClient.create(endpointAddress);
-        wc.type("application/xml").accept("application/xml");
-        Book2 b = new Book2();
-        b.setId(777L);
-        b.setName("CXF - 777");
-        Book2 b2 = wc.invoke("PUT", b, Book2.class);
-        assertNotSame(b, b2);
-        assertEquals(777, b2.getId());
-        assertEquals("CXF - 777", b2.getName());
-    }
-    
-    @Test
-    public void testReaderWriterFromInterceptors() throws Exception {
-        String endpointAddress =
-            "http://localhost:9080/the/thebooks5/bookstore/books/convert";
-        WebClient wc = WebClient.create(endpointAddress);
-        wc.type("application/xml").accept("application/xml");
-        Book2 b = new Book2();
-        b.setId(777L);
-        b.setName("CXF - 777");
-        Book2 b2 = wc.invoke("POST", b, Book2.class);
-        assertNotSame(b, b2);
-        assertEquals(777, b2.getId());
-        assertEquals("CXF - 777", b2.getName());
-    }
     
     @Test
     public void testAddValidBookJson() throws Exception {
@@ -409,32 +228,4 @@
         return bos.getOut().toString();        
     }
 
-        
-    @Ignore
-    @XmlRootElement(name = "Book", namespace = "http://www.w3.org/1999/xhtml")
-    public static class Book2 {
-        @XmlElement(name = "id", namespace = "http://www.w3.org/1999/xhtml")
-        private long id1;
-        @XmlElement(name = "name", namespace = "http://www.w3.org/1999/xhtml")
-        private String name1;
-        public Book2() {
-            
-        }
-        public long getId() {
-            return id1;
-        }
-        
-        public void setId(Long theId) {
-            id1 = theId;
-        }
-        
-        public String getName() {
-            return name1;
-        }
-        
-        public void setName(String n) {
-            name1 = n;
-        }
-        
-    }
 }

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java Wed Sep  2 02:21:37 2009
@@ -20,24 +20,17 @@
 package org.apache.cxf.systest.jaxrs;
 
 import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
-import javax.ws.rs.core.MediaType;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
 import org.apache.cxf.jaxrs.provider.JAXBElementProvider;
-import org.apache.cxf.staxutils.CachingXmlEventWriter;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
@@ -55,17 +48,10 @@
             sf.setResourceClasses(BookStore.class);
             sf.setResourceProvider(BookStore.class,
                                    new SingletonResourceProvider(new BookStore()));
-            JAXBElementProvider p1 = new JAXBElementProvider();
-            p1.setEnableBuffering(true);
-            p1.setEnableStreaming(true);
-            
-            JAXBElementProvider p2 = new CustomJaxbProvider();
-            p2.setProduceMediaTypes(Collections.singletonList("text/xml"));
-            
-            List<Object> providers = new ArrayList<Object>();
-            providers.add(p1);
-            providers.add(p2);
-            sf.setProviders(providers);
+            JAXBElementProvider p = new JAXBElementProvider();
+            p.setEnableBuffering(true);
+            p.setEnableStreaming(true);
+            sf.setProvider(p);
             sf.setAddress("http://localhost:9080/");
             Map<String, Object> properties = new HashMap<String, Object>();
             properties.put("org.apache.cxf.serviceloader-context", "true");
@@ -99,12 +85,6 @@
                       "application/xml", 200);
     }
     
-    @Test
-    public void testGetBookUsingStaxWriter() throws Exception {
-        getAndCompare("http://localhost:9080/bookstore/books/123",
-                      "text/xml", 200);
-    }
-    
     private void getAndCompare(String address, 
                                String acceptType,
                                int expectedStatus) throws Exception {
@@ -127,16 +107,4 @@
         Unmarshaller u = c.createUnmarshaller();
         return (Book)u.unmarshal(is);
     }
-    
-    @Ignore
-    public static class CustomJaxbProvider extends JAXBElementProvider {
-        @Override
-        protected XMLStreamWriter getStreamWriter(Object obj, OutputStream os, MediaType mt) {
-            if (mt.equals(MediaType.TEXT_XML_TYPE)) {
-                return new CachingXmlEventWriter();
-            } else {
-                throw new RuntimeException();
-            }
-        }
-    }
 }

Modified: cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java?rev=810336&r1=810335&r2=810336&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java (original)
+++ cxf/branches/2.1.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java Wed Sep  2 02:21:37 2009
@@ -37,7 +37,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                   launchServer(MultipartServer.class));
+                   launchServer(MultipartServer.class, true));
     }
     
     @Test
@@ -106,11 +106,6 @@
         doAddBook("multipart/form-data", address, "attachmentForm", 200);               
     }
     
-    @Test
-    public void testAddBookFormParam() throws Exception {
-        String address = "http://localhost:9085/bookstore/books/formparam";
-        doAddBook("multipart/form-data", address, "attachmentForm", 200);               
-    }
     
     @Test
     public void testAddBookFormBody() throws Exception {
@@ -124,12 +119,7 @@
         doAddBook("multipart/form-data", address, "attachmentForm", 200);               
     }
     
-    @Test
-    public void testAddBookFormParamBean() throws Exception {
-        String address = "http://localhost:9085/bookstore/books/formparambean";
-        doAddBook("multipart/form-data", address, "attachmentForm", 200);               
-    }
-    
+   
     @Test
     public void testAddBookAsJAXB2() throws Exception {
         String address = "http://localhost:9085/bookstore/books/jaxb2";



Mime
View raw message