Author: asoldano
Date: 2014-02-28 06:46:40 -0500 (Fri, 28 Feb 2014)
New Revision: 18444
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/EndorseTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPServletTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/mtom/MtomTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java
Log:
[JBWS-3769] Fixing cxf-tests
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.ws.jaxws.cxf.bus;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
@@ -35,6 +33,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.stack.cxf.client.UseNewBusFeature;
import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
@@ -111,20 +110,7 @@
}
private String readWsdl(String addr) throws Exception {
- BufferedReader in = null;
- try {
- in = new BufferedReader(new InputStreamReader(new URL(addr).openStream()));
- StringBuffer sb = new StringBuffer();
- String line;
- while ((line = in.readLine()) != null) {
- sb.append(line);
- }
- return sb.toString();
- } finally {
- if (in != null) {
- in.close();
- }
- }
+ return IOUtils.readAndCloseStream(new URL(addr).openStream());
}
protected static void performInvocation(Endpoint endpoint)
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/ServletClientBusTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.bus;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -51,27 +50,17 @@
deploy("jaxws-cxf-bus-servlet-client.war");
try
{
-
-
URL url = new URL(TARGET_ENDPOINT_ADDRESS +
"?method=testBusCreation");
- BufferedReader br = new BufferedReader(new
InputStreamReader(url.openStream()));
- String retStr = br.readLine();
- assertEquals("OK testBusCreation", retStr);
+ assertEquals("OK testBusCreation",
IOUtils.readAndCloseStream(url.openStream()));
url = new URL(TARGET_ENDPOINT_ADDRESS +
"?method=testSOAPConnection&host=" + getServerHost());
- br = new BufferedReader(new InputStreamReader(url.openStream()));
- retStr = br.readLine();
- assertEquals("OK testSOAPConnection", retStr);
+ assertEquals("OK testSOAPConnection",
IOUtils.readAndCloseStream(url.openStream()));
url = new URL(TARGET_ENDPOINT_ADDRESS + "?method=testWebServiceRef");
- br = new BufferedReader(new InputStreamReader(url.openStream()));
- retStr = br.readLine();
- assertEquals("OK testWebServiceRef", retStr);
+ assertEquals("OK testWebServiceRef",
IOUtils.readAndCloseStream(url.openStream()));
url = new URL(TARGET_ENDPOINT_ADDRESS +
"?method=testWebServiceClient&host=" + getServerHost());
- br = new BufferedReader(new InputStreamReader(url.openStream()));
- retStr = br.readLine();
- assertEquals("OK testWebServiceClient", retStr);
+ assertEquals("OK testWebServiceClient",
IOUtils.readAndCloseStream(url.openStream()));
}
finally
{
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.clientConfig;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -114,7 +113,6 @@
URL url = new URL("http://" + getServerHost()
+
":8080/jaxws-cxf-clientConfig-inContainer-client?path=/jaxws-cxf-clientConfig/EndpointImpl&method="
+ test
+ "&helper=" + Helper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCaseForked.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.clientConfig;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -84,7 +83,6 @@
URL url = new URL("http://" + getServerHost()
+
":8080/jaxws-cxf-clientConfig-inContainer-client?path=/jaxws-cxf-clientConfig/EndpointImpl&method="
+ test
+ "&helper=" + Helper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/EndorseTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/EndorseTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/EndorseTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.endorse;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.stack.cxf.client.ProviderImpl;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -60,8 +59,6 @@
}
private static void runServerTest(URL url) throws Exception {
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- String retStr = br.readLine();
- assertEquals("OK", retStr);
+ assertEquals("OK", IOUtils.readAndCloseStream(url.openStream()));
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPServletTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPServletTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPServletTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.gzip;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -79,7 +78,6 @@
URL url = new URL("http://" + getServerHost()
+
":8080/jaxws-cxf-gzip-client?path=/jaxws-cxf-gzip/HelloWorldService/HelloWorldImpl&method="
+ test
+ "&helper=" + Helper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.jaxbintros;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -71,7 +70,6 @@
URL url = new URL("http://" + getServerHost()
+
":8080/jaxws-cxf-jaxbintros-client?path=/jaxws-cxf-jaxbintros/EndpointService&method="
+ test
+ "&helper=" + Helper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,9 +21,6 @@
*/
package org.jboss.test.ws.jaxws.cxf.jbws3516;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.net.URL;
import java.util.Map;
@@ -37,9 +34,9 @@
import org.apache.cxf.ws.addressing.AddressingProperties;
import org.apache.cxf.ws.addressing.AttributedURIType;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl;
import org.apache.cxf.ws.addressing.JAXWSAConstants;
-
+import org.apache.cxf.ws.addressing.impl.AddressingPropertiesImpl;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -127,11 +124,6 @@
private String getTargetServletResult() throws Exception
{
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3516/target/result");
- InputStream ins = url.openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(ins));
- String result = br.readLine();
- br.close();
- ins.close();
- return result;
+ return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.jbws3648;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -63,17 +62,7 @@
}
private void checkPolicyAttachments(URL wsdlURL, String[] refIds) throws Exception {
- BufferedReader br = new BufferedReader(new InputStreamReader(wsdlURL.openStream(),
"UTF-8"));
- StringBuilder sb = new StringBuilder();
- try {
- String s;
- while ((s = br.readLine()) != null) {
- sb.append(s);
- }
- } finally {
- br.close();
- }
- String wsdl = sb.toString();
+ final String wsdl = IOUtils.readAndCloseStream(wsdlURL.openStream());
for (String refId : refIds) {
assertTrue("WSDL does not contain '" + refId + "'",
wsdl.contains(refId));
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3679/JBWS3679TestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -16,12 +16,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.jbws3679;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -37,10 +36,7 @@
public void testSchemaImport() throws Exception
{
URL url = new URL(endpointAddress);
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- String retStr = br.readLine();
- assertEquals("Echoded with:input", retStr);
-
+ assertEquals("Echoded with:input",
IOUtils.readAndCloseStream(url.openStream()));
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.ws.jaxws.cxf.jbws3713;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -30,6 +28,7 @@
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.stack.cxf.client.Constants;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -90,9 +89,7 @@
private static int callServlet(String pattern, String strategy, int threads, int
calls) throws Exception {
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3713-client/" + pattern + "?strategy="
+ strategy + "&host=" + getServerHost() +
"&threads=" + threads + "&calls=" + calls);
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- String retStr = br.readLine();
- return Integer.parseInt(retStr);
+ return Integer.parseInt(IOUtils.readAndCloseStream(url.openStream()));
}
private HelloWs getPort(String publishURL) throws Exception
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.spring;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -68,7 +67,6 @@
{
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-spring-client?path=/jaxws-cxf-spring/EndpointService&method="
+ test + "&helper=" + helper);
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/spring/ClientSpringAppTestCaseForked.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.cxf.spring;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -53,7 +52,6 @@
{
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-spring-client?path=/jaxws-cxf-spring/EndpointService&method="
+ test + "&helper=" + helper);
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.ws.jaxws.cxf.udp;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
@@ -37,6 +35,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -56,8 +55,7 @@
public void testServerSide() throws Exception
{
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-udp-api");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("true", br.readLine());
+ assertEquals("true", IOUtils.readAndCloseStream(url.openStream()));
}
public void testClientSide() throws Exception
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/mtom/MtomTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/mtom/MtomTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/mtom/MtomTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.samples.mtom;
+import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
@@ -85,10 +86,15 @@
out.close();
assertEquals(200, conn.getResponseCode());
- String response = IOUtils.readStringFromStream(conn.getInputStream());
-
- assertTrue(response.contains("--uuid"));
- assertTrue(response.contains("<return>Hello
World!</return>"));
+ final InputStream is = conn.getInputStream();
+ try {
+ String response = IOUtils.readStringFromStream(is);
+
+ assertTrue(response.contains("--uuid"));
+ assertTrue(response.contains("<return>Hello
World!</return>"));
+ } finally {
+ is.close();
+ }
}
public void testMtomNotUsed() throws Exception
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.ws.jaxws.samples.schemavalidation;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -32,6 +30,7 @@
import junit.framework.Test;
import org.jboss.test.ws.jaxws.samples.schemavalidation.types.HelloResponse;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
@@ -125,8 +124,7 @@
URL url = new URL("http://" + getServerHost()
+
":8080/jaxws-samples-schemavalidation-client?path=/jaxws-samples-schemavalidation/hello&method="
+ test
+ "&helper=" + Helper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -33,6 +31,7 @@
import org.apache.cxf.message.Message;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -55,18 +54,7 @@
public void testWsdl() throws Exception
{
URL wsdlURL = new URL(serviceURL + "?wsdl");
- BufferedReader br = new BufferedReader(new InputStreamReader(wsdlURL.openStream(),
"UTF-8"));
- StringBuilder sb = new StringBuilder();
- try {
- String s;
- while ((s = br.readLine()) != null) {
- sb.append(s);
- }
- } finally {
- br.close();
- }
- String wsdl = sb.toString();
-
assertTrue(wsdl.contains("AsymmetricBinding_X509v1_GCM256OAEP_ProtectTokens_binding_policy"));
+
assertTrue(IOUtils.readAndCloseStream(wsdlURL.openStream()).contains("AsymmetricBinding_X509v1_GCM256OAEP_ProtectTokens_binding_policy"));
}
public void test() throws Exception
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -75,7 +74,6 @@
{
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-sign-encrypt-client?" +
"path=/jaxws-samples-wsse-policy-sign-encrypt-gcm&method=testSignEncryptUsingConfigProperties&helper="
+ SignEncryptHelper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("1", br.readLine());
+ assertEquals("1", IOUtils.readAndCloseStream(url.openStream()));
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,12 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.basic;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import junit.framework.Test;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -66,15 +65,13 @@
{
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-sign-encrypt-client?" +
"path=/jaxws-samples-wsse-policy-sign-encrypt&method=testSignEncrypt&helper="
+ SignEncryptHelper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("1", br.readLine());
+ assertEquals("1", IOUtils.readAndCloseStream(url.openStream()));
}
public void testServerSideUsingConfigProperties() throws Exception
{
URL url = new URL("http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-sign-encrypt-client?" +
"path=/jaxws-samples-wsse-policy-sign-encrypt&method=testSignEncryptUsingConfigProperties&helper="
+ SignEncryptHelper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("1", br.readLine());
+ assertEquals("1", IOUtils.readAndCloseStream(url.openStream()));
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java 2014-02-28
11:43:44 UTC (rev 18443)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java 2014-02-28
11:46:40 UTC (rev 18444)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@@ -37,6 +35,7 @@
import org.apache.cxf.ws.security.SecurityConstants;
import org.jboss.security.auth.login.XMLLoginConfigImpl;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
@@ -159,8 +158,7 @@
URL url = new URL("http://" + getServerHost()
+
":8080/jaxws-samples-wsse-policy-username-jaspi-client?path=/jaxws-samples-wsse-policy-username-endpoint-jaspi&method="
+ test
+ "&helper=" + Helper.class.getName());
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- return br.readLine();
+ return IOUtils.readAndCloseStream(url.openStream());
}