cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1546545 - in /cxf/trunk: core/src/main/java/org/apache/cxf/validation/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ systests/jaxrs/src/test/java/org/apache/cxf/syst...
Date Fri, 29 Nov 2013 11:34:31 GMT
Author: sergeyb
Date: Fri Nov 29 11:34:31 2013
New Revision: 1546545

URL: http://svn.apache.org/r1546545
Log:
[CXF-5408] Dealing with escaped exceptions in JAXRSDefaultFaultOutInterceptor

Modified:
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
    cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationOutInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSBindingFactory.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSDefaultFaultOutInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutExceptionMapperInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/JAXRSClientServerValidationTest.java

Modified: cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
(original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java
Fri Nov 29 11:34:31 2013
@@ -21,14 +21,10 @@ package org.apache.cxf.validation;
 import java.lang.reflect.Method;
 import java.util.List;
 
-import javax.validation.ValidationException;
-
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 
 public class BeanValidationInInterceptor extends AbstractValidationInterceptor {
-    static final String INPUT_VALIDATION_FAILED = "input.validation.failed";
-    
     public BeanValidationInInterceptor() {
         super(Phase.PRE_INVOKE);
     }
@@ -40,14 +36,9 @@ public class BeanValidationInInterceptor
     protected void handleValidation(final Message message, final Object resourceInstance,
                                     final Method method, final List<Object> arguments)
{
         if (arguments.size() > 0) {
-            try {
-                BeanValidationProvider provider = getProvider(message);
-                provider.validateParameters(resourceInstance, method, unwrapArgs(arguments).toArray());
-                message.getExchange().put(BeanValidationProvider.class, provider);
-            } catch (ValidationException ex) {
-                message.getExchange().put(INPUT_VALIDATION_FAILED, true);
-                throw ex;
-            }
+            BeanValidationProvider provider = getProvider(message);
+            provider.validateParameters(resourceInstance, method, unwrapArgs(arguments).toArray());
+            message.getExchange().put(BeanValidationProvider.class, provider);
         }
     }
     

Modified: cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationOutInterceptor.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationOutInterceptor.java
(original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationOutInterceptor.java
Fri Nov 29 11:34:31 2013
@@ -21,7 +21,6 @@ package org.apache.cxf.validation;
 import java.lang.reflect.Method;
 import java.util.List;
 
-import org.apache.cxf.common.util.PropertyUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 
@@ -37,9 +36,7 @@ public class BeanValidationOutIntercepto
     @Override
     protected void handleValidation(final Message message, final Object resourceInstance,
                                     final Method method, final List<Object> arguments)
{
-        if (arguments.size() == 1
-            && !PropertyUtils.isTrue(message.getExchange().get(
-                BeanValidationInInterceptor.INPUT_VALIDATION_FAILED))) {
+        if (arguments.size() == 1) {
             Object entity = unwrapEntity(arguments.get(0));
             BeanValidationProvider theProvider = getOutProvider(message);
             if (isEnforceOnlyBeanConstraints()) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSBindingFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSBindingFactory.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSBindingFactory.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSBindingFactory.java
Fri Nov 29 11:34:31 2013
@@ -30,7 +30,6 @@ import org.apache.cxf.common.i18n.Messag
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.interceptor.StaxOutInterceptor;
 import org.apache.cxf.jaxrs.interceptor.JAXRSDefaultFaultOutInterceptor;
 import org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor;
 import org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor;
@@ -64,8 +63,7 @@ public class JAXRSBindingFactory extends
         binding.getOutInterceptors().add(new JAXRSOutInterceptor());
         
         binding.getOutFaultInterceptors().add(new JAXRSDefaultFaultOutInterceptor());
-        binding.getOutFaultInterceptors().add(new StaxOutInterceptor());
-
+        
         return binding;
     }
     

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSDefaultFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSDefaultFaultOutInterceptor.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSDefaultFaultOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSDefaultFaultOutInterceptor.java
Fri Nov 29 11:34:31 2013
@@ -18,8 +18,10 @@
  */
 package org.apache.cxf.jaxrs.interceptor;
 
+import java.util.List;
 import java.util.ResourceBundle;
 
+import javax.ws.rs.core.Response;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
@@ -30,7 +32,10 @@ import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.NSStack;
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.StaxOutInterceptor;
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.staxutils.StaxUtils;
 
@@ -46,12 +51,21 @@ public class JAXRSDefaultFaultOutInterce
     }
 
     public void handleMessage(Message message) throws Fault {
+        final Fault f = (Fault) message.getContent(Exception.class);
+        
+        Response r = JAXRSUtils.convertFaultToResponse(f.getCause(), message);
+        if (r != null) {
+            JAXRSUtils.setMessageContentType(message, r);
+            message.setContent(List.class, new MessageContentsList(r));
+            new JAXRSOutInterceptor().handleMessage(message);
+            return;
+        }
         
         if (mustPropogateException(message)) {
-            throw (Fault) message.getContent(Exception.class);
+            throw f;
         }
         
-        Fault f = (Fault) message.getContent(Exception.class);
+        new StaxOutInterceptor().handleMessage(message);
         message.put(org.apache.cxf.message.Message.RESPONSE_CODE, f.getStatusCode());
         NSStack nsStack = new NSStack();
         nsStack.push();
@@ -94,4 +108,6 @@ public class JAXRSDefaultFaultOutInterce
     protected boolean mustPropogateException(Message m) {
         return Boolean.TRUE.equals(m.getExchange().get(Message.PROPOGATE_EXCEPTION));
     }
+    
+    
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Fri Nov 29 11:34:31 2013
@@ -20,7 +20,6 @@
 package org.apache.cxf.jaxrs.interceptor;
 
 import java.io.IOException;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -41,7 +40,6 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.OutgoingChainInterceptor;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.impl.RequestPreprocessor;
@@ -54,12 +52,9 @@ import org.apache.cxf.jaxrs.model.URITem
 import org.apache.cxf.jaxrs.provider.ServerProviderFactory;
 import org.apache.cxf.jaxrs.utils.HttpUtils;
 import org.apache.cxf.jaxrs.utils.JAXRSUtils;
-import org.apache.cxf.logging.FaultListener;
-import org.apache.cxf.logging.NoOpFaultListener;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageContentsList;
-import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
@@ -264,59 +259,13 @@ public class JAXRSInInterceptor extends 
     @Override
     public void handleFault(Message message) {
         super.handleFault(message);
-        
-        Object mapProp = message.getContextualProperty("map.cxf.interceptor.fault");
-        if (mapProp == null || MessageUtils.isTrue(mapProp)) {
-            Throwable ex = message.getContent(Exception.class);
-            if (ex instanceof Fault) {
-                ex = ((Fault)ex).getCause();
-            }
-            Response r = JAXRSUtils.convertFaultToResponse(ex, message);
-            if (r != null) {
-                message.removeContent(Exception.class);
-                message.getInterceptorChain().setFaultObserver(null);
-                if (message.getContextualProperty(FaultListener.class.getName()) == null)
{
-                    message.put(FaultListener.class.getName(), new NoOpFaultListener());
-                }
-                
-                createOutMessage(message, r);
-                
-                Iterator<Interceptor<? extends Message>> iterator = message.getInterceptorChain().iterator();
-                while (iterator.hasNext()) {
-                    Interceptor<? extends Message> inInterceptor = iterator.next();
-                    if (inInterceptor.getClass() == OutgoingChainInterceptor.class) {
-                        ((OutgoingChainInterceptor)inInterceptor).handleMessage(message);
-                        return;
-                    }
-                }
-            }
-        }
-        
-        
-        LOG.fine("Cleanup thread local variables");
-        
-        Object rootInstance = message.getExchange().remove(JAXRSUtils.ROOT_INSTANCE);
-        Object rootProvider = message.getExchange().remove(JAXRSUtils.ROOT_PROVIDER);
-        if (rootInstance != null && rootProvider != null) {
-            try {
-                ((ResourceProvider)rootProvider).releaseInstance(message, rootInstance);
-            } catch (Throwable tex) {
-                LOG.warning("Exception occurred during releasing the service instance, "
+ tex.getMessage());
-            }
-        }
-        ServerProviderFactory.getInstance(message).clearThreadLocalProxies();
-        ClassResourceInfo cri = (ClassResourceInfo)message.getExchange().get(JAXRSUtils.ROOT_RESOURCE_CLASS);
-        if (cri != null) {
-            cri.clearThreadLocalProxies();
-        }
     }
     
     private Message createOutMessage(Message inMessage, Response r) {
         Endpoint e = inMessage.getExchange().get(Endpoint.class);
-        Message mout = new MessageImpl();
+        Message mout = e.getBinding().createMessage();
         mout.setContent(List.class, new MessageContentsList(r));
         mout.setExchange(inMessage.getExchange());
-        mout = e.getBinding().createMessage(mout);
         mout.setInterceptorChain(
              OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange()));
         inMessage.getExchange().setOutMessage(mout);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutExceptionMapperInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutExceptionMapperInterceptor.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutExceptionMapperInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutExceptionMapperInterceptor.java
Fri Nov 29 11:34:31 2013
@@ -19,31 +19,13 @@
 
 package org.apache.cxf.jaxrs.interceptor;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.logging.Logger;
-
-import javax.ws.rs.core.Response;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.interceptor.Interceptor;
-import org.apache.cxf.jaxrs.lifecycle.ResourceProvider;
-import org.apache.cxf.jaxrs.model.ClassResourceInfo;
-import org.apache.cxf.jaxrs.provider.ServerProviderFactory;
-import org.apache.cxf.jaxrs.utils.JAXRSUtils;
-import org.apache.cxf.logging.FaultListener;
-import org.apache.cxf.logging.NoOpFaultListener;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
-import org.apache.cxf.phase.PhaseInterceptorChain;
-import org.apache.cxf.phase.PhaseManager;
 
+@Deprecated
 public class JAXRSOutExceptionMapperInterceptor extends AbstractOutDatabindingInterceptor
{
-    private static final Logger LOG = LogUtils.getL7dLogger(JAXRSOutExceptionMapperInterceptor.class);
     
     public JAXRSOutExceptionMapperInterceptor() {
         super(Phase.SETUP);
@@ -53,62 +35,10 @@ public class JAXRSOutExceptionMapperInte
     }
     @Override
     public void handleFault(Message message) {
-        if (Boolean.TRUE == message.get("jaxrs.out.fault")) {
-            // Exception comes from JAXRSOutInterceptor or the one which follows it
-            return;
-        }
-        Throwable ex = message.getContent(Exception.class);
-        if (ex instanceof Fault) {
-            ex = ((Fault)ex).getCause();
-        }
-        Response r = JAXRSUtils.convertFaultToResponse(ex, message);
-        if (r != null) {
-            message.removeContent(Exception.class);
-            message.getInterceptorChain().setFaultObserver(null);
-            message.setContent(List.class, new MessageContentsList(r));
-            if (message.getContextualProperty(FaultListener.class.getName()) == null) {
-                message.put(FaultListener.class.getName(), new NoOpFaultListener());
-            }
-            
-            PhaseManager pm = message.getExchange().get(Bus.class).getExtension(PhaseManager.class);
-            PhaseInterceptorChain chain = new PhaseInterceptorChain(pm.getOutPhases());
-            
-            boolean jaxrsOutOrAfter = false;
-            Iterator<Interceptor<? extends Message>> iterator = message.getInterceptorChain().iterator();
-            while (iterator.hasNext()) {
-                Interceptor<? extends Message> outInterceptor = iterator.next();
-                if (outInterceptor.getClass() == JAXRSOutInterceptor.class) {
-                    jaxrsOutOrAfter = true;
-                }
-                if (jaxrsOutOrAfter) {
-                    chain.add(outInterceptor);
-                }
-            }
-            
-            message.setInterceptorChain(chain);
-            message.getInterceptorChain().doInterceptStartingAt(message, JAXRSOutInterceptor.class.getName());
-            return;
-        }
-        
-        
-        LOG.fine("Cleanup thread local variables");
-        
-        Object rootInstance = message.getExchange().remove(JAXRSUtils.ROOT_INSTANCE);
-        Object rootProvider = message.getExchange().remove(JAXRSUtils.ROOT_PROVIDER);
-        if (rootInstance != null && rootProvider != null) {
-            try {
-                ((ResourceProvider)rootProvider).releaseInstance(message, rootInstance);
-            } catch (Throwable tex) {
-                LOG.warning("Exception occurred during releasing the service instance, "
+ tex.getMessage());
-            }
-        }
-        ServerProviderFactory.getInstance(message).clearThreadLocalProxies();
-        ClassResourceInfo cri = (ClassResourceInfo)message.getExchange().get(JAXRSUtils.ROOT_RESOURCE_CLASS);
-        if (cri != null) {
-            cri.clearThreadLocalProxies();
-        }
+        //complete
     }
     @Override
     public void handleMessage(Message message) throws Fault {
+      //complete
     }
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
Fri Nov 29 11:34:31 2013
@@ -80,8 +80,6 @@ public class JAXRSOutInterceptor extends
         ServerProviderFactory providerFactory = ServerProviderFactory.getInstance(message);
         try {
             processResponse(providerFactory, message);
-        } catch (Exception ex) {
-            message.put("jaxrs.out.fault", Boolean.TRUE);    
         } finally {
             Object rootInstance = message.getExchange().remove(JAXRSUtils.ROOT_INSTANCE);
             Object rootProvider = message.getExchange().remove(JAXRSUtils.ROOT_PROVIDER);
@@ -482,6 +480,6 @@ public class JAXRSOutInterceptor extends
     }
     
     public void handleFault(Message message) {
-        message.put("jaxrs.out.fault", Boolean.TRUE);
+        // complete
     }
 }

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java (original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java Fri
Nov 29 11:34:31 2013
@@ -37,7 +37,6 @@ import org.apache.cxf.jaxrs.ext.search.Q
 import org.apache.cxf.jaxrs.ext.search.SearchBean;
 import org.apache.cxf.jaxrs.ext.search.SearchContextProvider;
 import org.apache.cxf.jaxrs.ext.search.sql.SQLPrinterVisitor;
-import org.apache.cxf.jaxrs.interceptor.JAXRSOutExceptionMapperInterceptor;
 import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
 import org.apache.cxf.jaxrs.provider.BinaryDataProvider;
 import org.apache.cxf.jaxrs.provider.JAXBElementProvider;
@@ -86,7 +85,6 @@ public class BookServer extends Abstract
         sf.setInInterceptors(inInts);
         List<Interceptor<? extends Message>> outInts = new ArrayList<Interceptor<?
extends Message>>();
         outInts.add(new CustomOutInterceptor());
-        outInts.add(new JAXRSOutExceptionMapperInterceptor());
         sf.setOutInterceptors(outInts);
         List<Interceptor<? extends Message>> outFaultInts = new ArrayList<Interceptor<?
extends Message>>();
         outFaultInts.add(new CustomOutFaultInterceptor());

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Fri Nov 29 11:34:31 2013
@@ -439,6 +439,7 @@ public class JAXRSClientServerBookTest e
         String endpointAddress =
             "http://localhost:" + PORT + "/bookstore/infault"; 
         WebClient wc = WebClient.create(endpointAddress);
+        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000000L);
         Response r = wc.get();
         assertEquals(401, r.getStatus());
     }

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
Fri Nov 29 11:34:31 2013
@@ -124,7 +124,7 @@ public class JAXRSLocalTransportTest ext
     public void testProxyServerOutFault() throws Exception {
         BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
         Response r = localProxy.outfault();
-        assertEquals(500, r.getStatus());
+        assertEquals(403, r.getStatus());
     }
     
     @Test
@@ -132,7 +132,7 @@ public class JAXRSLocalTransportTest ext
         BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
         WebClient.getConfig(localProxy).getRequestContext().put(LocalConduit.DIRECT_DISPATCH,
"true");
         Response r = localProxy.outfault();
-        assertEquals(500, r.getStatus());
+        assertEquals(403, r.getStatus());
     }
     
     @Test

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/JAXRSClientServerValidationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/JAXRSClientServerValidationTest.java?rev=1546545&r1=1546544&r2=1546545&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/JAXRSClientServerValidationTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/JAXRSClientServerValidationTest.java
Fri Nov 29 11:34:31 2013
@@ -27,7 +27,6 @@ import javax.ws.rs.core.Response.Status;
 
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.interceptor.JAXRSOutExceptionMapperInterceptor;
 import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
 import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor;
@@ -64,7 +63,6 @@ public class JAXRSClientServerValidation
                 in));
              
             sf.setOutInterceptors(Arrays.< Interceptor< ? extends Message > >asList(
-                new JAXRSOutExceptionMapperInterceptor(),
                 new JAXRSBeanValidationOutInterceptor()));
 
             sf.create();



Mime
View raw message