[CXF-7016] Fix test
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6e9def4f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6e9def4f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6e9def4f Branch: refs/heads/3.1.x-fixes Commit: 6e9def4f5d9946b37133ec53a9b8ab622b64db57 Parents: 0b40c84 Author: Christian Schneider <[email protected]> Authored: Mon Sep 26 11:22:35 2016 +0200 Committer: Christian Schneider <[email protected]> Committed: Tue Sep 27 10:29:17 2016 +0200 ---------------------------------------------------------------------- .../org/apache/cxf/ext/logging/RESTLoggingTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/6e9def4f/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/RESTLoggingTest.java ---------------------------------------------------------------------- diff --git a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/RESTLoggingTest.java b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/RESTLoggingTest.java index 088daa9..8bde31f 100644 --- a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/RESTLoggingTest.java +++ b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/RESTLoggingTest.java @@ -36,6 +36,7 @@ import org.junit.Test; public class RESTLoggingTest { private static final String SERVICE_URI = "http://localhost:5679/testrest"; + private static final String SERVICE_URI_BINARY = "http://localhost:5680/testrest"; @Test public void testSlf4j() throws IOException { @@ -55,7 +56,7 @@ public class RESTLoggingTest { loggingFeature.setSender(sender); Server server = createServiceBinary(loggingFeature); server.start(); - WebClient client = createClient(loggingFeature); + WebClient client = createClientBinary(loggingFeature); client.get(InputStream.class).close(); loggingFeature.setLogBinary(true); client.get(InputStream.class).close(); @@ -95,9 +96,16 @@ public class RESTLoggingTest { return factory.create(); } + private WebClient createClientBinary(LoggingFeature loggingFeature) { + JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); + bean.setAddress(SERVICE_URI_BINARY + "/test1"); + bean.setFeatures(Collections.singletonList(loggingFeature)); + return bean.createWebClient(); + } + private Server createServiceBinary(LoggingFeature loggingFeature) { JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean(); - factory.setAddress(SERVICE_URI); + factory.setAddress(SERVICE_URI_BINARY); factory.setFeatures(Collections.singletonList(loggingFeature)); factory.setServiceBean(new TestServiceRestBinary()); return factory.create(); @@ -106,6 +114,7 @@ public class RESTLoggingTest { @Test public void testEvents() throws MalformedURLException { LoggingFeature loggingFeature = new LoggingFeature(); + loggingFeature.setLogBinary(true); TestEventSender sender = new TestEventSender(); loggingFeature.setSender(sender); Server server = createService(loggingFeature);
