Author: mmao
Date: Wed Nov 21 00:35:11 2007
New Revision: 596984
URL: http://svn.apache.org/viewvc?rev=596984&view=rev
Log:
* Fix the tests, using auto flush
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java?rev=596984&r1=596983&r2=596984&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
Wed Nov 21 00:35:11 2007
@@ -46,6 +46,7 @@
public LoggingInInterceptor() {
super(Phase.RECEIVE);
}
+
public LoggingInInterceptor(int lim) {
this();
limit = lim;
@@ -114,7 +115,7 @@
}
if (writer != null) {
- writer.write(buffer.toString());
+ writer.println(buffer.toString());
} else if (LOG.isLoggable(Level.INFO)) {
LOG.info(buffer.toString());
}
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java?rev=596984&r1=596983&r2=596984&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
Wed Nov 21 00:35:11 2007
@@ -106,7 +106,7 @@
}
if (writer != null) {
- writer.write(buffer.toString());
+ writer.println(buffer.toString());
} else if (LOG.isLoggable(Level.INFO)) {
LOG.info(buffer.toString());
}
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java?rev=596984&r1=596983&r2=596984&view=diff
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_feature/WSAClientServerTest.java
Wed Nov 21 00:35:11 2007
@@ -51,7 +51,7 @@
private ByteArrayOutputStream setupInLogging() {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
- PrintWriter writer = new PrintWriter(bos);
+ PrintWriter writer = new PrintWriter(bos, true);
LoggingInInterceptor in = new LoggingInInterceptor(writer);
this.bus.getInInterceptors().add(in);
return bos;
@@ -59,7 +59,7 @@
private ByteArrayOutputStream setupOutLogging() {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
- PrintWriter writer = new PrintWriter(bos);
+ PrintWriter writer = new PrintWriter(bos, true);
LoggingOutInterceptor out = new LoggingOutInterceptor(writer);
this.bus.getOutInterceptors().add(out);
@@ -102,8 +102,8 @@
String expectedOut =
"<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>";
String expectedIn = "<RelatesTo
xmlns=\"http://www.w3.org/2005/08/addressing\">";
- assertTrue(output.toString().indexOf(expectedOut) == -1);
- assertTrue(input.toString().indexOf(expectedIn) == -1);
+ assertTrue(output.toString().indexOf(expectedOut) != -1);
+ assertTrue(input.toString().indexOf(expectedIn) != -1);
}
@Test
@@ -118,8 +118,8 @@
String expectedOut =
"<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>";
String expectedIn = "<RelatesTo
xmlns=\"http://www.w3.org/2005/08/addressing\">";
- assertTrue(output.toString().indexOf(expectedOut) == -1);
- assertTrue(input.toString().indexOf(expectedIn) == -1);
+ assertTrue(output.toString().indexOf(expectedOut) != -1);
+ assertTrue(input.toString().indexOf(expectedIn) != -1);
}
private AddNumbersPortType getPort() {