You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2012/01/27 20:34:42 UTC
svn commit: r1236851 - in /cxf/branches/2.5.x-fixes: ./
rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java
Author: ay
Date: Fri Jan 27 19:34:40 2012
New Revision: 1236851
URL: http://svn.apache.org/viewvc?rev=1236851&view=rev
Log:
Merged revisions 1236849 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1236849 | ay | 2012-01-27 20:26:11 +0100 (Fri, 27 Jan 2012) | 1 line
make HTTPConduitURLEasyMockTest work when proxy is active
........
Modified:
cxf/branches/2.5.x-fixes/ (props changed)
cxf/branches/2.5.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java
Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 27 19:34:40 2012
@@ -1 +1 @@
-/cxf/trunk:1236624,1236769
+/cxf/trunk:1236624,1236769,1236849
Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.5.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java?rev=1236851&r1=1236850&r2=1236851&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java (original)
+++ cxf/branches/2.5.x-fixes/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLEasyMockTest.java Fri Jan 27 19:34:40 2012
@@ -50,14 +50,17 @@ import org.easymock.EasyMock;
import org.easymock.IMocksControl;
import org.junit.After;
+import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
/**
*/
public class HTTPConduitURLEasyMockTest extends Assert {
-
+ private static String oldHttpProxyHost;
+
private enum ResponseStyle { NONE, BACK_CHANNEL, BACK_CHANNEL_ERROR, DECOUPLED };
private enum ResponseDelimiter { LENGTH, CHUNKED, EOF };
@@ -73,6 +76,22 @@ public class HTTPConduitURLEasyMockTest
private OutputStream os;
private InputStream is;
+ @BeforeClass
+ public static void disableHttpProxy() throws Exception {
+ oldHttpProxyHost = System.getProperty("http.proxyHost");
+ if (oldHttpProxyHost != null) {
+ // disable http proxy so that the connection mocking works (see setUpConduit)
+ System.clearProperty("http.proxyHost");
+ }
+ }
+
+ @AfterClass
+ public static void revertHttpProxy() throws Exception {
+ if (oldHttpProxyHost != null) {
+ System.setProperty("http.proxyHost", oldHttpProxyHost);
+ }
+ }
+
/**
* This is an extension to the HTTPConduit that replaces
* the dynamic assignment of the HttpURLConnectionFactory,