Author: asoldano
Date: 2013-10-29 08:05:42 -0400 (Tue, 29 Oct 2013)
New Revision: 18042
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java
Log:
Skip HTTPProxyTestCase on systems missing GLIBCXX_3.4.9 (e.g. RHEL 5)
See
https://github.com/adamfisk/LittleProxy/issues/110
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-24
14:53:34 UTC (rev 18041)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java 2013-10-29
12:05:42 UTC (rev 18042)
@@ -54,6 +54,8 @@
import org.littleshoot.proxy.ChainedProxyManager;
import org.littleshoot.proxy.HttpProxyServer;
+import com.barchart.udt.SocketUDT;
+
/**
* Tests / samples for WS client using HTTP Proxy
*
@@ -67,7 +69,7 @@
private static final String PROXY_PWD = "bar";
private static final String ENDPOINT_PATH =
"/jaxws-cxf-httpproxy/HelloWorldService/HelloWorldImpl";
private HttpProxyServer proxyServer;
-
+
public static Test suite()
{
return new JBossWSCXFTestSetup(HTTPProxyTestCaseForked.class,
"jaxws-cxf-httpproxy.war");
@@ -75,6 +77,11 @@
public void testHttpProxy() throws Exception
{
+ if (checkNativeLibraries()) {
+ initProxyServer();
+ } else {
+ return;
+ }
final String testHost = "unreachable-testHttpProxy";
HelloWorld port =
getPort(getResourceURL("jaxws/cxf/httpproxy/HelloWorldService.wsdl"),
testHost);
final String hi = "Hi!";
@@ -119,6 +126,11 @@
public void testHttpProxyUsingHTTPClientPolicy() throws Exception
{
+ if (checkNativeLibraries()) {
+ initProxyServer();
+ } else {
+ return;
+ }
final String testHost =
"unreachable-testHttpProxyUsingHTTPClientPolicy";
HelloWorld port =
getPort(getResourceURL("jaxws/cxf/httpproxy/HelloWorldService.wsdl"),
testHost);
final String hi = "Hi!";
@@ -164,8 +176,7 @@
assertEquals(hi, port.echo(hi));
}
- @Override
- protected void setUp() throws Exception
+ private void initProxyServer() throws Exception
{
org.littleshoot.proxy.ProxyAuthenticator proxyAuthenticator = new
org.littleshoot.proxy.ProxyAuthenticator()
{
@@ -235,6 +246,11 @@
public void testWSDLHttpProxy() throws Exception
{
+ if (checkNativeLibraries()) {
+ initProxyServer();
+ } else {
+ return;
+ }
setProxySystemProperties();
try
{
@@ -251,6 +267,11 @@
public void testWSDLNoHttpProxy() throws Exception
{
+ if (checkNativeLibraries()) {
+ initProxyServer();
+ } else {
+ return;
+ }
clearProxySystemProperties();
String endpointAddress = "http://unreachable-testWSDLNoHttpProxy" +
ENDPOINT_PATH;
try
@@ -264,6 +285,20 @@
}
}
+ private boolean checkNativeLibraries() {
+ boolean result;
+ try {
+ result = SocketUDT.INIT_OK;
+ } catch (Exception e) {
+ result = false;
+ }
+ if (!result) {
+ System.out.println("Native libraries not available or not loadble, skipping
test. " +
+ "Check logs for more details and see
https://github.com/adamfisk/LittleProxy/issues/110");
+ }
+ return result;
+ }
+
private static StringBuffer readContent(URL url) throws Exception
{
StringBuffer sb = new StringBuffer();