This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 208b581 cxf-systests-jaxws: update OASISCatalogTest.readUrl
208b581 is described below
commit 208b581837430a97d9e13318603af679674b8092
Author: amarkevich <[email protected]>
AuthorDate: Tue May 14 14:52:14 2019 +0300
cxf-systests-jaxws: update OASISCatalogTest.readUrl
---
.../org/apache/cxf/systest/jaxws/OASISCatalogTest.java | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git
a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java
index f22de8a..1ba4cf8 100644
---
a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java
+++
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java
@@ -43,7 +43,6 @@ import org.apache.hello_world.Greeter;
import org.apache.hello_world.GreeterImpl;
import org.apache.hello_world.services.SOAPService;
-import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
@@ -104,7 +103,7 @@ public class OASISCatalogTest {
*
*/
@Test
- public void testWSDLPublishWithCatalogsRewritePaths() {
+ public void testWSDLPublishWithCatalogsRewritePaths() throws Exception {
Endpoint ep = Endpoint.publish("http://localhost:" + PORT +
"/SoapContext/SoapPort",
new GreeterImpl());
try {
@@ -254,17 +253,10 @@ public class OASISCatalogTest {
}
}
- private String readUrl(String address) {
- String content = null;
- try {
- URL url = new URL(address);
- assertNotNull(url.getContent());
- content = IOUtils.toString((InputStream) url.getContent());
- } catch (IOException e) {
- e.printStackTrace(System.err);
- Assert.fail("Couldn't read URL: " + e.getMessage());
+ private static String readUrl(String address) throws IOException {
+ try (InputStream is = new URL(address).openStream()) {
+ return IOUtils.toString(is);
}
- return content;
}
}
\ No newline at end of file