Search in sources :

Example 1 with CompressionCachedOutputStreamCallback

use of org.talend.esb.policy.compression.impl.CompressionOutInterceptor.CompressionCachedOutputStreamCallback in project tesb-rt-se by Talend.

the class CompressionOutInterceptorTest method handleRuntimeException2.

@Test
public void handleRuntimeException2() throws Exception {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(Message.HTTP_REQUEST_METHOD, "GET");
    Message message = CompressionCommonTest.getMessageStub(null, map);
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    CompressionCachedOutputStreamCallback callback = new CompressionCachedOutputStreamCallback(os, 1024, message);
    CachedOutputStream wrapper = new CachedOutputStream();
    try {
        callback.onClose(wrapper);
    } catch (RuntimeException ex) {
        return;
    }
    fail("No exception is not expected");
}
Also used : CompressionCachedOutputStreamCallback(org.talend.esb.policy.compression.impl.CompressionOutInterceptor.CompressionCachedOutputStreamCallback) Message(org.apache.cxf.message.Message) HashMap(java.util.HashMap) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CachedOutputStream(org.apache.cxf.io.CachedOutputStream) Test(org.junit.Test)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 HashMap (java.util.HashMap)1 CachedOutputStream (org.apache.cxf.io.CachedOutputStream)1 Message (org.apache.cxf.message.Message)1 Test (org.junit.Test)1 CompressionCachedOutputStreamCallback (org.talend.esb.policy.compression.impl.CompressionOutInterceptor.CompressionCachedOutputStreamCallback)1