cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf git commit: [CXF-7016] Fix test
Date Mon, 26 Sep 2016 09:23:06 GMT
Repository: cxf
Updated Branches:
  refs/heads/master dba09f008 -> 21c788a31


[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/21c788a3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/21c788a3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/21c788a3

Branch: refs/heads/master
Commit: 21c788a31d52b6f88e70dc560bec6e2df94a8109
Parents: dba09f0
Author: Christian Schneider <chris@die-schneider.net>
Authored: Mon Sep 26 11:22:35 2016 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Mon Sep 26 11:22:47 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/21c788a3/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);


Mime
View raw message