Author: dkulp Date: Thu Aug 8 19:22:14 2013 New Revision: 1511973 URL: http://svn.apache.org/r1511973 Log: Merged revisions 1511962 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
........ r1511962 | dkulp | 2013-08-08 15:11:57 -0400 (Thu, 08 Aug 2013) | 11 lines Merged revisions 1511840 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1511840 | dkulp | 2013-08-08 11:48:32 -0400 (Thu, 08 Aug 2013) | 3 lines [CXF-5190] Fix issues with faults between oneWay being set and robust being handled. Add some pre/post unmarshall phases for consistency ........ ........ Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/Phase.java cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/managers/PhaseManagerImpl.java cxf/branches/2.6.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/Phase.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/Phase.java?rev=1511973&r1=1511972&r2=1511973&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/Phase.java (original) +++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/Phase.java Thu Aug 8 19:22:14 2013 @@ -58,7 +58,9 @@ public class Phase implements Comparable public static final String RECEIVE = "receive"; public static final String READ = "read"; public static final String PROTOCOL = "protocol"; + public static final String PRE_UNMARSHAL = "pre-unmarshal"; public static final String UNMARSHAL = "unmarshal"; + public static final String POST_UNMARSHAL = "post-unmarshal"; public static final String PRE_INVOKE = "pre-invoke"; public static final String INVOKE = "invoke"; public static final String POST_INVOKE = "post-invoke"; Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=1511973&r1=1511972&r2=1511973&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original) +++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Thu Aug 8 19:22:14 2013 @@ -41,6 +41,7 @@ import org.apache.cxf.logging.FaultListe import org.apache.cxf.message.Exchange; import org.apache.cxf.message.FaultMode; import org.apache.cxf.message.Message; +import org.apache.cxf.message.MessageUtils; import org.apache.cxf.service.Service; import org.apache.cxf.service.model.OperationInfo; import org.apache.cxf.transport.MessageObserver; @@ -315,7 +316,8 @@ public class PhaseInterceptorChain imple if (message.getContent(Exception.class) != null) { message.getExchange().put(Exception.class, ex2); } - isOneWay = message.getExchange().isOneWay(); + isOneWay = message.getExchange().isOneWay() + && !MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY)); } if (faultObserver != null && !isOneWay) { Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/managers/PhaseManagerImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/managers/PhaseManagerImpl.java?rev=1511973&r1=1511972&r2=1511973&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/managers/PhaseManagerImpl.java (original) +++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/managers/PhaseManagerImpl.java Thu Aug 8 19:22:14 2013 @@ -68,7 +68,9 @@ public class PhaseManagerImpl implements inPhases.add(new Phase(Phase.PRE_PROTOCOL_FRONTEND, ++i * 1000)); inPhases.add(new Phase(Phase.USER_PROTOCOL, ++i * 1000)); inPhases.add(new Phase(Phase.POST_PROTOCOL, ++i * 1000)); + inPhases.add(new Phase(Phase.PRE_UNMARSHAL, ++i * 1000)); inPhases.add(new Phase(Phase.UNMARSHAL, ++i * 1000)); + inPhases.add(new Phase(Phase.POST_UNMARSHAL, ++i * 1000)); inPhases.add(new Phase(Phase.PRE_LOGICAL, ++i * 1000)); inPhases.add(new Phase(Phase.USER_LOGICAL, ++i * 1000)); inPhases.add(new Phase(Phase.POST_LOGICAL, ++i * 1000)); Modified: cxf/branches/2.6.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java?rev=1511973&r1=1511972&r2=1511973&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java (original) +++ cxf/branches/2.6.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java Thu Aug 8 19:22:14 2013 @@ -127,7 +127,7 @@ public class InterceptorFaultTest extend private Greeter greeter; private List<Phase> inPhases; private PhaseComparator comparator; - private Phase preLogicalPhase; + private Phase postUnMarshalPhase; @@ -211,7 +211,7 @@ public class InterceptorFaultTest extend // all interceptors pass testInterceptorsPass(robust); - // test failure in phases before Phase.PRE_LOGICAL + // test failure in phases <= Phase.UNMARSHALL FaultLocation location = new org.apache.cxf.greeter_control.types.ObjectFactory() .createFaultLocation(); location.setAfter(MAPAggregator.class.getName()); @@ -226,9 +226,7 @@ public class InterceptorFaultTest extend throws PingMeFault { for (Phase p : phases) { location.setPhase(p.getName()); - if (Phase.PRE_LOGICAL.equals(p.getName())) { - continue; - } else if (Phase.POST_INVOKE.equals(p.getName())) { + if (Phase.POST_INVOKE.equals(p.getName())) { break; } testFail(location, true, robust); @@ -265,8 +263,10 @@ public class InterceptorFaultTest extend // oneway reports a plain fault (although server sends a soap fault) - boolean expectOnewayFault = robust - || comparator.compare(preLogicalPhase, getPhase(location.getPhase())) > 0; + boolean expectOnewayFault = robust; + if (comparator.compare(getPhase(location.getPhase()), postUnMarshalPhase) < 0) { + expectOnewayFault = true; + } try { greeter.greetMeOneWay("oneway"); @@ -331,8 +331,8 @@ public class InterceptorFaultTest extend inPhases.addAll(greeterBus.getExtension(PhaseManager.class).getInPhases()); Collections.sort(inPhases, comparator); } - if (null == preLogicalPhase) { - preLogicalPhase = getPhase(Phase.PRE_LOGICAL); + if (null == postUnMarshalPhase) { + postUnMarshalPhase = getPhase(Phase.POST_UNMARSHAL); } GreeterService gs = new GreeterService();
