chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1153284 - /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java
Date Tue, 02 Aug 2011 21:52:00 GMT
Author: fmui
Date: Tue Aug  2 21:51:59 2011
New Revision: 1153284

URL: http://svn.apache.org/viewvc?rev=1153284&view=rev
Log:
TCK text report: use platform new lines

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java?rev=1153284&r1=1153283&r2=1153284&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java
Tue Aug  2 21:51:59 2011
@@ -36,22 +36,25 @@ import org.apache.chemistry.opencmis.tck
  * Text Report.
  */
 public class TextReport extends AbstractCmisTestReport {
+    public static String NL = System.getProperty("line.separator");
+
     public TextReport() {
+
     }
 
     @Override
     public void createReport(Map<String, String> parameters, List<CmisTestGroup>
groups, Writer writer)
             throws IOException {
-        writer.write("***************************************************************\n");
-        writer.write("Test Report: " + (new Date()) + "\n");
+        writer.write("***************************************************************" +
NL);
+        writer.write("Test Report: " + (new Date()) + NL);
 
-        writer.write("***************************************************************\n");
+        writer.write("***************************************************************" +
NL);
         if (parameters != null) {
             for (Map.Entry<String, String> p : (new TreeMap<String, String>(parameters)).entrySet())
{
-                writer.write(p.getKey() + " = " + p.getValue() + "\n");
+                writer.write(p.getKey() + " = " + p.getValue() + NL);
             }
         }
-        writer.write("***************************************************************\n");
+        writer.write("***************************************************************" +
NL);
 
         if (groups != null) {
             for (CmisTestGroup group : groups) {
@@ -63,9 +66,9 @@ public class TextReport extends Abstract
     }
 
     private void printGroupResults(CmisTestGroup group, Writer writer) throws IOException
{
-        writer.write("===============================================================\n");
-        writer.write(group.getName() + "\n");
-        writer.write("===============================================================\n");
+        writer.write("===============================================================" +
NL);
+        writer.write(group.getName() + NL);
+        writer.write("===============================================================" +
NL);
 
         if (group.getTests() != null) {
             for (CmisTest test : group.getTests()) {
@@ -75,18 +78,18 @@ public class TextReport extends Abstract
     }
 
     private void printTestResults(CmisTest test, Writer writer) throws IOException {
-        writer.write("---------------------------------------------------------------\n");
-        writer.write(test.getName() + " (" + test.getTime() + " ms)\n");
-        writer.write("---------------------------------------------------------------\n\n");
+        writer.write("---------------------------------------------------------------" +
NL);
+        writer.write(test.getName() + " (" + test.getTime() + " ms)" + NL);
+        writer.write("---------------------------------------------------------------" +
NL + NL);
 
         if (test.getResults() != null) {
             for (CmisTestResult result : test.getResults()) {
                 printResult(1, result, writer);
-                writer.write("\n");
+                writer.write(NL);
             }
         }
 
-        writer.write("\n");
+        writer.write(NL);
     }
 
     private void printResult(int level, CmisTestResult result, Writer writer) throws IOException
{
@@ -98,16 +101,16 @@ public class TextReport extends Abstract
                     + result.getStackTrace()[0].getLineNumber() + ")");
         }
 
-        writer.write("\n");
+        writer.write(NL);
 
         if (result.getStatus() == CmisTestResultStatus.UNEXPECTED_EXCEPTION && result.getException()
!= null) {
-            writer.write("\nStacktrace:\n\n");
+            writer.write(NL + "Stacktrace:" + NL + NL);
             result.getException().printStackTrace(new PrintWriter(writer));
 
             if (result.getException() instanceof CmisBaseException) {
                 CmisBaseException cbe = (CmisBaseException) result.getException();
                 if (cbe.getErrorContent() != null) {
-                    writer.write("\nError Content:\n\n");
+                    writer.write(NL + "Error Content:" + NL + NL);
                     writer.write(cbe.getErrorContent());
                 }
             }
@@ -115,17 +118,17 @@ public class TextReport extends Abstract
 
         if (result.getException() != null) {
             printIntend(level, writer);
-            writer.write("Exception: " + result.getException().getMessage() + "\n");
+            writer.write("Exception: " + result.getException().getMessage() + NL);
         }
 
         if (result.getRequest() != null) {
             printIntend(level, writer);
-            writer.write("Request: " + result.getRequest() + "\n");
+            writer.write("Request: " + result.getRequest() + NL);
         }
 
         if (result.getRequest() != null) {
             printIntend(level, writer);
-            writer.write("Response: " + result.getRequest() + "\n");
+            writer.write("Response: " + result.getRequest() + NL);
         }
 
         for (CmisTestResult child : result.getChildren()) {



Mime
View raw message