Updated Branches: refs/heads/master 6d9fe077a -> d9e038687
o Fix test that failed with some charsets (again) Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/d9e03868 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/d9e03868 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/d9e03868 Branch: refs/heads/master Commit: d9e0386876149cf931da0c7a7a7779f94eb5d4a8 Parents: 6d9fe07 Author: Andreas Gudian <agud...@apache.org> Authored: Sun Aug 11 13:55:30 2013 +0200 Committer: Andreas Gudian <agud...@apache.org> Committed: Sun Aug 11 13:55:30 2013 +0200 ---------------------------------------------------------------------- .../surefire/report/StatelessXMLReporterTest.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/d9e03868/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXMLReporterTest.java ---------------------------------------------------------------------- diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXMLReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXMLReporterTest.java index 2dfd099..5a74c45 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXMLReporterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXMLReporterTest.java @@ -99,21 +99,25 @@ public class StatelessXMLReporterTest stats.testSucceeded( testSetReportEntry ); StackTraceWriter stackTraceWriter = new DeserializedStacktraceWriter( "A fud msg", "trimmed", "fail at foo" ); Utf8RecodingDeferredFileOutputStream stdOut = new Utf8RecodingDeferredFileOutputStream( "fds" ); - byte[] stdOutBytes = "st]]>d-o\u00DCt<null>!\u0020\u0000\u001F".getBytes(); - stdOut.write( stdOutBytes, 0, stdOutBytes.length ); - - Utf8RecodingDeferredFileOutputStream stdErr = new Utf8RecodingDeferredFileOutputStream( "fds" ); - + String stdOutPrefix; String stdErrPrefix; if ( defaultCharsetSupportsSpecialChar() ) { stdErrPrefix = "std-\u0115rr"; + stdOutPrefix = "st]]>d-o\u00DCt"; } else { stdErrPrefix = "std-err"; + stdOutPrefix = "st]]>d-out"; } + byte[] stdOutBytes = (stdOutPrefix + "<null>!\u0020\u0000\u001F").getBytes(); + stdOut.write( stdOutBytes, 0, stdOutBytes.length ); + + Utf8RecodingDeferredFileOutputStream stdErr = new Utf8RecodingDeferredFileOutputStream( "fds" ); + + byte[] stdErrBytes = (stdErrPrefix + "?&-&£\u0020\u0000\u001F").getBytes(); stdErr.write( stdErrBytes, 0, stdErrBytes.length ); WrappedReportEntry t2 = @@ -148,7 +152,7 @@ public class StatelessXMLReporterTest assertNotNull( errorNode ); assertEquals( "A fud msg", errorNode.getAttribute( "message" ) ); assertEquals( "fail at foo", errorNode.getAttribute( "type" ) ); - assertEquals( "st]]>d-o\u00DCt<null>! &#0;&#31;", tcb.getChild( "system-out" ).getValue() ); + assertEquals( stdOutPrefix + "<null>! &#0;&#31;", tcb.getChild( "system-out" ).getValue() ); assertEquals( stdErrPrefix + "?&-&£ &#0;&#31;", tcb.getChild( "system-err" ).getValue() ); @@ -157,7 +161,7 @@ public class StatelessXMLReporterTest private boolean defaultCharsetSupportsSpecialChar() { // some charsets are not able to deal with \u0115 on both ways of the conversion - return "\u0115".equals( new String( "\u0115".getBytes() ) ); + return "\u0115\u00DC".equals( new String( "\u0115\u00DC".getBytes() ) ); } class Inner