Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ private String getServiceInfo(Message message) {
OperationInfo opInfo = boi != null ? boi.getOperationInfo() : null;
if (opInfo != null) {
description.append('#').append(opInfo.getName());
} else {
Object resourceOperation = exchange.get(Message.RESOURCE_OPERATION_NAME);
if (resourceOperation != null) {
description.append('#').append(resourceOperation);
}
}
description.append("\' ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@
import java.util.SortedSet;
import java.util.TreeSet;

import javax.xml.namespace.QName;

import org.apache.cxf.common.util.ReflectionUtil;
import org.apache.cxf.common.util.SortedArraySet;
import org.apache.cxf.continuations.SuspendedInvocationException;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.interceptor.InterceptorChain;
import org.apache.cxf.logging.FaultListener;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.ExchangeImpl;
import org.apache.cxf.message.FaultMode;
import org.apache.cxf.message.Message;
import org.apache.cxf.service.Service;

import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -341,6 +346,28 @@ public void testInsertionInSamePhasePass() throws Exception {
verifyPhaseInterceptorInvocations(p2, false, false);
}

@Test
public void testFaultDescriptionIncludesResourceOperation() throws Exception {
Service service = mock(Service.class);
when(service.getName()).thenReturn(new QName("http://test", "FirstResource"));
Exchange exchange = new ExchangeImpl();
exchange.put(Service.class, service);
exchange.put(Message.RESOURCE_OPERATION_NAME, "SecondResource#getItem");
when(message.getExchange()).thenReturn(exchange);

FaultListener listener = mock(FaultListener.class);
when(message.getContextualProperty(FaultListener.class.getName())).thenReturn(listener);

AbstractPhaseInterceptor<Message> p = setUpPhaseInterceptor("phase1", "p1");
setUpPhaseInterceptorInvocations(p, true, false);
chain.add(p);
chain.doIntercept(message);

verify(listener).faultOccurred(isA(Exception.class),
eq("'{http://test}FirstResource#SecondResource#getItem' "),
eq(message));
}

@Test
public void testWrappedInvocation() throws Exception {
CountingPhaseInterceptor p1 = new CountingPhaseInterceptor("phase1",
Expand Down
Loading