camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject camel git commit: There's less to type if we reuse the LS constant instead of the System.lineSeparator() utility.
Date Thu, 02 Apr 2015 18:35:14 GMT
Repository: camel
Updated Branches:
  refs/heads/master 1e923eca2 -> a3f89218b


There's less to type if we reuse the LS constant instead of the System.lineSeparator() utility.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a3f89218
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a3f89218
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a3f89218

Branch: refs/heads/master
Commit: a3f89218b3dd4303f5d94e87de7ed5858bc2e6d4
Parents: 1e923ec
Author: Babak Vahdat <bvahdat@apache.org>
Authored: Thu Apr 2 20:33:11 2015 +0200
Committer: Babak Vahdat <bvahdat@apache.org>
Committed: Thu Apr 2 20:33:11 2015 +0200

----------------------------------------------------------------------
 .../dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java     | 4 ++--
 .../dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java      | 2 +-
 .../camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java      | 2 +-
 .../apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java    | 6 +++---
 .../org/apache/camel/component/jackson/JacksonMarshalTest.java | 2 +-
 .../component/jackson/SpringJacksonJsonDataFormatTest.java     | 2 +-
 .../component/velocity/VelocityBodyAsDomainObjectTest.java     | 3 +--
 7 files changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a3f89218/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
----------------------------------------------------------------------
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
index efa639a..4b4b6a3 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalAutogenColumnsSpringTest.java
@@ -48,7 +48,7 @@ public class CsvMarshalAutogenColumnsSpringTest extends CamelSpringTestSupport
{
         result.assertIsSatisfied();
 
         String body = result.getReceivedExchanges().get(0).getIn().getBody(String.class);
-        String[] lines = body.split(System.lineSeparator());
+        String[] lines = body.split(LS);
         assertEquals(2, lines.length);
         assertEquals("Camel in Action", lines[0].trim());
         assertEquals("ActiveMQ in Action", lines[1].trim());
@@ -63,7 +63,7 @@ public class CsvMarshalAutogenColumnsSpringTest extends CamelSpringTestSupport
{
         result2.assertIsSatisfied();
 
         String body = result2.getReceivedExchanges().get(0).getIn().getBody(String.class);
-        String[] lines = body.split(System.lineSeparator());
+        String[] lines = body.split(LS);
         assertEquals(2, lines.length);
         assertEquals("123|1", lines[0].trim());
         assertEquals("124|2", lines[1].trim());

http://git-wip-us.apache.org/repos/asf/camel/blob/a3f89218/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
----------------------------------------------------------------------
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
index fba0673..1442f82 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterSpringTest.java
@@ -44,7 +44,7 @@ public class CsvMarshalPipeDelimiterSpringTest extends CamelSpringTestSupport
{
         assertMockEndpointsSatisfied();
 
         String body = result.getReceivedExchanges().get(0).getIn().getBody(String.class);
-        String[] lines = body.split(System.lineSeparator());
+        String[] lines = body.split(LS);
         assertEquals(2, lines.length);
         assertEquals("123|Camel in Action|1", lines[0].trim());
         assertEquals("124|ActiveMQ in Action|2", lines[1].trim());

http://git-wip-us.apache.org/repos/asf/camel/blob/a3f89218/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
index eafbfa9..f117f79 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvMarshalPipeDelimiterTest.java
@@ -41,7 +41,7 @@ public class CsvMarshalPipeDelimiterTest extends CamelTestSupport {
         assertMockEndpointsSatisfied();
 
         String body = result.getReceivedExchanges().get(0).getIn().getBody(String.class);
-        String[] lines = body.split(System.lineSeparator());
+        String[] lines = body.split(LS);
         assertEquals(2, lines.length);
         assertEquals("123|Camel in Action|1", lines[0].trim());
         assertEquals("124|ActiveMQ in Action|2", lines[1].trim());

http://git-wip-us.apache.org/repos/asf/camel/blob/a3f89218/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
----------------------------------------------------------------------
diff --git a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
index 97735b9..3c049b8 100644
--- a/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
+++ b/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvUnmarshalStreamTest.java
@@ -46,7 +46,7 @@ public class CsvUnmarshalStreamTest extends CamelTestSupport {
 
         String message = "";
         for (int i = 0; i < EXPECTED_COUNT; ++i) {
-            message += i + "|\"" + i + System.lineSeparator() + i + "\"\n";
+            message += i + "|\"" + i + LS + i + "\"\n";
         }
 
         template.sendBody("direct:start", message);
@@ -58,7 +58,7 @@ public class CsvUnmarshalStreamTest extends CamelTestSupport {
                     .getIn().getBody(List.class);
             assertEquals(2, body.size());
             assertEquals(String.valueOf(i), body.get(0));
-            assertEquals(String.format("%d%s%d", i, System.lineSeparator(), i), body.get(1));
+            assertEquals(String.format("%d%s%d", i, LS, i), body.get(1));
         }
     }
 
@@ -78,7 +78,7 @@ public class CsvUnmarshalStreamTest extends CamelTestSupport {
                     .getIn().getBody(List.class);
             assertEquals(2, body.size());
             assertEquals(String.valueOf(i), body.get(0));
-            assertEquals(String.format("%d%s%d", i, System.lineSeparator(), i), body.get(1));
+            assertEquals(String.format("%d%s%d", i, LS, i), body.get(1));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/a3f89218/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalTest.java
b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalTest.java
index 95b8220..330a494 100644
--- a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalTest.java
+++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalTest.java
@@ -57,7 +57,7 @@ public class JacksonMarshalTest extends CamelTestSupport {
 
         Object marshalled = template.requestBody("direct:inPretty", in);
         String marshalledAsString = context.getTypeConverter().convertTo(String.class, marshalled);
-        String expected = String.format("{%s  \"name\" : \"Camel\"%s}", System.lineSeparator(),
System.lineSeparator());
+        String expected = String.format("{%s  \"name\" : \"Camel\"%s}", LS, LS);
         assertEquals(expected, marshalledAsString);
 
         template.sendBody("direct:backPretty", marshalled);

http://git-wip-us.apache.org/repos/asf/camel/blob/a3f89218/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
index b1ef3ad..45e789f 100644
--- a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
+++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
@@ -61,7 +61,7 @@ public class SpringJacksonJsonDataFormatTest extends CamelSpringTestSupport
{
 
         Object marshalled = template.requestBody("direct:inPretty", in);
         String marshalledAsString = context.getTypeConverter().convertTo(String.class, marshalled);
-        String expected = String.format("{%s  \"name\" : \"Camel\"%s}", System.lineSeparator(),
System.lineSeparator());
+        String expected = String.format("{%s  \"name\" : \"Camel\"%s}", LS, LS);
         assertEquals(expected, marshalledAsString);
 
         template.sendBody("direct:back", marshalled);

http://git-wip-us.apache.org/repos/asf/camel/blob/a3f89218/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityBodyAsDomainObjectTest.java
----------------------------------------------------------------------
diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityBodyAsDomainObjectTest.java
b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityBodyAsDomainObjectTest.java
index 8dd60e2..915fa20 100644
--- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityBodyAsDomainObjectTest.java
+++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityBodyAsDomainObjectTest.java
@@ -30,8 +30,7 @@ public class VelocityBodyAsDomainObjectTest extends CamelTestSupport {
 
     @Test
     public void testWithObject() throws Exception {
-        String msg = String.format("Hi Claus how are you? Its a nice day.%sGive my regards
to the family Ibsen.",
-                System.lineSeparator());
+        String msg = String.format("Hi Claus how are you? Its a nice day.%sGive my regards
to the family Ibsen.", LS);
 
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);


Mime
View raw message