Author: sergeyb
Date: Tue Dec 20 15:23:58 2011
New Revision: 1221315

URL: http://svn.apache.org/viewvc?rev=1221315&view=rev
Log:
Fixing the test which proxifies the exception mapper

Added:
    
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContextAware.java
   (with props)
Modified:
    
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java

Modified: 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java?rev=1221315&r1=1221314&r2=1221315&view=diff
==============================================================================
--- 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java
 (original)
+++ 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookExceptionMapper.java
 Tue Dec 20 15:23:58 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.cxf.systest.jaxrs;
 
-import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.ext.ExceptionMapper;
@@ -28,12 +27,14 @@ import org.apache.cxf.jaxrs.ext.MessageC
 import org.apache.cxf.jaxrs.model.OperationResourceInfo;
 
 @Provider
-public class BookExceptionMapper implements ExceptionMapper<BookNotFoundFault> 
{
-
-    @Context
+public class BookExceptionMapper implements ContextAware, 
ExceptionMapper<BookNotFoundFault> {
     private MessageContext mc;
     private boolean toHandle;
     
+    public void setMessageContext(MessageContext context) {
+        mc = context;
+    }
+    
     public Response toResponse(BookNotFoundFault ex) {
         // status is 200 just to simplify the test client code
         if (toHandle) {

Added: 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContextAware.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContextAware.java?rev=1221315&view=auto
==============================================================================
--- 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContextAware.java
 (added)
+++ 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContextAware.java
 Tue Dec 20 15:23:58 2011
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jaxrs;
+
+import javax.ws.rs.core.Context;
+
+import org.apache.cxf.jaxrs.ext.MessageContext;
+
+public interface ContextAware {
+    @Context
+    void setMessageContext(MessageContext context);
+}

Propchange: 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContextAware.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ContextAware.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date


Reply via email to