JBossWS SVN: r18014 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-21 05:04:07 -0400 (Mon, 21 Oct 2013)
New Revision: 18014
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3714] Applying Petr's patch (thanks!) for moving to latest littleproxy
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java 2013-10-18 14:14:23 UTC (rev 18013)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java 2013-10-21 09:04:07 UTC (rev 18014)
@@ -21,16 +21,19 @@
*/
package org.jboss.test.ws.jaxws.cxf.httpproxy;
+import io.netty.handler.codec.http.HttpRequest;
+
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Authenticator;
+import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.PasswordAuthentication;
import java.net.URL;
-import java.util.HashMap;
+import java.util.Queue;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -46,10 +49,10 @@
import org.apache.cxf.transports.http.configuration.ProxyServerType;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
-import org.littleshoot.proxy.DefaultHttpProxyServer;
-import org.littleshoot.proxy.HttpFilter;
+import org.littleshoot.proxy.ChainedProxy;
+import org.littleshoot.proxy.ChainedProxyAdapter;
+import org.littleshoot.proxy.ChainedProxyManager;
import org.littleshoot.proxy.HttpProxyServer;
-import org.littleshoot.proxy.ProxyAuthorizationHandler;
/**
* Tests / samples for WS client using HTTP Proxy
@@ -164,19 +167,37 @@
@Override
protected void setUp() throws Exception
{
- proxyServer = new DefaultHttpProxyServer(++proxyPort, new HashMap<String, HttpFilter>(),
- getServerHost() + ":8080", null, null);
- ProxyAuthorizationHandler authorizationHandler = new ProxyAuthorizationHandler()
+ org.littleshoot.proxy.ProxyAuthenticator proxyAuthenticator = new org.littleshoot.proxy.ProxyAuthenticator()
{
-
@Override
public boolean authenticate(String user, String pwd)
{
return (PROXY_USER.equals(user) && PROXY_PWD.equals(pwd));
}
};
- proxyServer.addProxyAuthenticationHandler(authorizationHandler);
- proxyServer.start();
+ InetSocketAddress address = new InetSocketAddress(getServerHost(), ++proxyPort);
+ ChainedProxyManager chainProxyManager = new ChainedProxyManager()
+ {
+ @Override
+ public void lookupChainedProxies(HttpRequest httpRequest, Queue<ChainedProxy> chainedProxies)
+ {
+ chainedProxies.add(new ChainedProxyAdapter()
+ {
+ @Override
+ public InetSocketAddress getChainedProxyAddress()
+ {
+ return new InetSocketAddress(getServerHost(), 8080);
+ }
+
+ });
+ }
+ };
+ proxyServer = org.littleshoot.proxy.impl.DefaultHttpProxyServer
+ .bootstrap()
+ .withChainProxyManager(chainProxyManager)
+ .withAddress(address)
+ .withProxyAuthenticator(proxyAuthenticator)
+ .start();
}
@Override
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2013-10-18 14:14:23 UTC (rev 18013)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2013-10-21 09:04:07 UTC (rev 18014)
@@ -26,7 +26,7 @@
<wsdl.publish.location>${project.build.directory}/wsdl-publish</wsdl.publish.location>
<log4j.output.dir>${project.build.directory}</log4j.output.dir>
<appclient.output.dir>${project.build.directory}/appclient-logs</appclient.output.dir>
- <org.littleshoot.littleproxy.version>0.4</org.littleshoot.littleproxy.version>
+ <org.littleshoot.littleproxy.version>1.0.0-beta2</org.littleshoot.littleproxy.version>
<org.slf4j.version>1.6.1</org.slf4j.version>
<gnu.getopt.version>1.0.13</gnu.getopt.version>
<bc.version>1.46</bc.version>