You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/10/17 08:49:02 UTC

[4/4] camel git commit: Fixes #647. CAMEL-9227: Fixed CS

Fixes #647. CAMEL-9227: Fixed CS


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

Branch: refs/heads/master
Commit: a3520ddd59f2207574d203ad1d01b09605573c04
Parents: b95325a
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Oct 17 08:51:14 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Oct 17 08:51:14 2015 +0200

----------------------------------------------------------------------
 .../converter/dozer/DozerBeanMappingTest.java   | 46 +++++++++-----------
 .../camel/converter/dozer/model/CustomerA.java  | 26 ++++++-----
 .../camel/converter/dozer/model/CustomerB.java  | 27 +++++++-----
 3 files changed, 50 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a3520ddd/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerBeanMappingTest.java
----------------------------------------------------------------------
diff --git a/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerBeanMappingTest.java b/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerBeanMappingTest.java
index 50ff0f3..f714418 100644
--- a/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerBeanMappingTest.java
+++ b/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerBeanMappingTest.java
@@ -1,12 +1,10 @@
-/*
- * #%L
- * Wildfly Camel :: Testsuite
- * %%
- * Copyright (C) 2013 - 2014 RedHat
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -15,9 +13,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * #L%
  */
-
 package org.apache.camel.converter.dozer;
 
 import java.util.Arrays;
@@ -39,8 +35,8 @@ public class DozerBeanMappingTest {
     @Test
     public void testMarshalViaDozer() throws Exception {
 
-        CamelContext camelctx = new DefaultCamelContext();
-        camelctx.addRoutes(new RouteBuilder() {
+        CamelContext context = new DefaultCamelContext();
+        context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
                 from("direct:start").convertBodyTo(HashMap.class);
@@ -48,25 +44,25 @@ public class DozerBeanMappingTest {
         });
 
         DozerBeanMapperConfiguration mconfig = new DozerBeanMapperConfiguration();
-        mconfig.setMappingFiles(Arrays.asList(new String[] { "bean-to-map-dozer-mappings.xml" }));
-        new DozerTypeConverterLoader(camelctx, mconfig);
+        mconfig.setMappingFiles(Arrays.asList("bean-to-map-dozer-mappings.xml"));
+        new DozerTypeConverterLoader(context, mconfig);
 
-        camelctx.start();
+        context.start();
         try {
-            ProducerTemplate producer = camelctx.createProducerTemplate();
+            ProducerTemplate producer = context.createProducerTemplate();
             Map<?, ?> result = producer.requestBody("direct:start", new Customer("John", "Doe", null), Map.class);
             Assert.assertEquals("John", result.get("firstName"));
             Assert.assertEquals("Doe", result.get("lastName"));
         } finally {
-            camelctx.stop();
+            context.stop();
         }
     }
 
     @Test
     public void testBeanMapping() throws Exception {
 
-        CamelContext camelctx = new DefaultCamelContext();
-        camelctx.addRoutes(new RouteBuilder() {
+        CamelContext context = new DefaultCamelContext();
+        context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
                 from("direct:start").convertBodyTo(CustomerB.class);
@@ -74,21 +70,21 @@ public class DozerBeanMappingTest {
         });
 
         DozerBeanMapperConfiguration mconfig = new DozerBeanMapperConfiguration();
-        mconfig.setMappingFiles(Arrays.asList(new String[] { "bean-to-bean-dozer-mappings.xml" }));
-        new DozerTypeConverterLoader(camelctx, mconfig);
+        mconfig.setMappingFiles(Arrays.asList("bean-to-bean-dozer-mappings.xml"));
+        new DozerTypeConverterLoader(context, mconfig);
 
         CustomerA customerA = new CustomerA("Peter", "Post", "SomeStreet", "12345");
 
-        camelctx.start();
+        context.start();
         try {
-            ProducerTemplate producer = camelctx.createProducerTemplate();
+            ProducerTemplate producer = context.createProducerTemplate();
             CustomerB result = producer.requestBody("direct:start", customerA, CustomerB.class);
             Assert.assertEquals(customerA.getFirstName(), result.getFirstName());
             Assert.assertEquals(customerA.getLastName(), result.getLastName());
             Assert.assertEquals(customerA.getStreet(), result.getAddress().getStreet());
             Assert.assertEquals(customerA.getZip(), result.getAddress().getZip());
         } finally {
-            camelctx.stop();
+            context.stop();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/a3520ddd/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerA.java
----------------------------------------------------------------------
diff --git a/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerA.java b/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerA.java
index 22b9227..d4e98b9 100644
--- a/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerA.java
+++ b/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerA.java
@@ -1,12 +1,10 @@
-/*
- * #%L
- * Wildfly Camel :: Testsuite
- * %%
- * Copyright (C) 2013 - 2014 RedHat
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -15,12 +13,9 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * #L%
  */
-
 package org.apache.camel.converter.dozer.model;
 
-
 public class CustomerA {
 
     private String firstName;
@@ -41,24 +36,31 @@ public class CustomerA {
     public String getFirstName() {
         return firstName;
     }
+
     public void setFirstName(String firstName) {
         this.firstName = firstName;
     }
+
     public String getLastName() {
         return lastName;
     }
+
     public void setLastName(String lastName) {
         this.lastName = lastName;
     }
+
     public String getStreet() {
         return street;
     }
+
     public void setStreet(String street) {
         this.street = street;
     }
+
     public String getZip() {
         return zip;
     }
+
     public void setZip(String zip) {
         this.zip = zip;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/a3520ddd/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerB.java
----------------------------------------------------------------------
diff --git a/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerB.java b/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerB.java
index c7496aa..080274a 100644
--- a/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerB.java
+++ b/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/CustomerB.java
@@ -1,12 +1,10 @@
-/*
- * #%L
- * Wildfly Camel :: Testsuite
- * %%
- * Copyright (C) 2013 - 2014 RedHat
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -15,12 +13,9 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * #L%
  */
-
 package org.apache.camel.converter.dozer.model;
 
-
 public class CustomerB {
 
     private String firstName;
@@ -39,18 +34,23 @@ public class CustomerB {
     public String getFirstName() {
         return firstName;
     }
+
     public void setFirstName(String firstName) {
         this.firstName = firstName;
     }
+
     public String getLastName() {
         return lastName;
     }
+
     public void setLastName(String lastName) {
         this.lastName = lastName;
     }
+
     public Address getAddress() {
         return address;
     }
+
     public void setAddress(Address address) {
         this.address = address;
     }
@@ -71,12 +71,15 @@ public class CustomerB {
         public String getStreet() {
             return street;
         }
+
         public void setStreet(String street) {
             this.street = street;
         }
+
         public String getZip() {
             return zip;
         }
+
         public void setZip(String zip) {
             this.zip = zip;
         }