Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA53AE2E4 for ; Tue, 26 Feb 2013 14:13:31 +0000 (UTC) Received: (qmail 50562 invoked by uid 500); 26 Feb 2013 14:13:31 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 50450 invoked by uid 500); 26 Feb 2013 14:13:31 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 50431 invoked by uid 99); 26 Feb 2013 14:13:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 14:13:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 14:13:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9ABD623888CD; Tue, 26 Feb 2013 14:13:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1450178 - in /cxf/branches/2.7.x-fixes: ./ rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java Date: Tue, 26 Feb 2013 14:13:10 -0000 To: commits@cxf.apache.org From: ay@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130226141310.9ABD623888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ay Date: Tue Feb 26 14:13:10 2013 New Revision: 1450178 URL: http://svn.apache.org/r1450178 Log: Merged revisions 1450175 via svn merge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1450175 | ay | 2013-02-26 15:08:43 +0100 (Tue, 26 Feb 2013) | 1 line fix the mock usage in HTTPConduitURLEasyMockTest ........ Modified: cxf/branches/2.7.x-fixes/ (props changed) cxf/branches/2.7.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java Propchange: cxf/branches/2.7.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.7.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java?rev=1450178&r1=1450177&r2=1450178&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java (original) +++ cxf/branches/2.7.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java Tue Feb 26 14:13:10 2013 @@ -279,11 +279,11 @@ public class HTTPConduitURLEasyMockTest message.put(AuthorizationPolicy.class, authPolicy); } - private void setUpOneway(Message message) { + private void setUpExchange(Message message, boolean oneway) { Exchange exchange = control.createMock(Exchange.class); message.setExchange(exchange); exchange.isOneWay(); - EasyMock.expectLastCall().andReturn(true).anyTimes(); + EasyMock.expectLastCall().andReturn(oneway).anyTimes(); exchange.isSynchronous(); EasyMock.expectLastCall().andReturn(true).anyTimes(); exchange.isEmpty(); @@ -445,9 +445,7 @@ public class HTTPConduitURLEasyMockTest EasyMock.expectLastCall(); } - if ((style == ResponseStyle.NONE) || (style == ResponseStyle.ONEWAY_NONE)) { - setUpOneway(message); - } + setUpExchange(message, style == ResponseStyle.NONE || style == ResponseStyle.ONEWAY_NONE); connection.getRequestMethod(); EasyMock.expectLastCall().andReturn(method).anyTimes(); @@ -459,7 +457,9 @@ public class HTTPConduitURLEasyMockTest wrappedOS.flush(); wrappedOS.close(); - if (style != ResponseStyle.ONEWAY_NONE) { + if ((style == ResponseStyle.NONE && !emptyResponse) + || style == ResponseStyle.BACK_CHANNEL + || style == ResponseStyle.BACK_CHANNEL_ERROR) { assertNotNull("expected in message", inMessage); Map headerMap = (Map) inMessage.get(Message.PROTOCOL_HEADERS); assertEquals("unexpected response headers", headerMap.size(), 0); @@ -547,7 +547,7 @@ public class HTTPConduitURLEasyMockTest switch (style) { case NONE: case DECOUPLED: - is = EasyMock.createMock(InputStream.class); + is = control.createMock(InputStream.class); connection.getInputStream(); EasyMock.expectLastCall().andReturn(is).anyTimes(); connection.getContentLength(); @@ -562,7 +562,11 @@ public class HTTPConduitURLEasyMockTest EasyMock.expectLastCall().andReturn("close"); } is.read(); - EasyMock.expectLastCall().andReturn(emptyResponse ? -1 : (int)'<'); + if (emptyResponse) { + EasyMock.expectLastCall().andReturn(-1).anyTimes(); + } else { + EasyMock.expectLastCall().andReturn((int)'<'); + } } else { EasyMock.expectLastCall().andReturn(123).anyTimes(); }