camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/2] camel git commit: CAMEL-8217 Fixed the CS error of XmlJsonOptionsTest
Date Fri, 09 Jan 2015 07:10:38 GMT
CAMEL-8217 Fixed the CS error of XmlJsonOptionsTest


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

Branch: refs/heads/camel-2.14.x
Commit: 9bfb2092c2150e2b0800de2dc1e3d2e638f76650
Parents: d61838b
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Thu Jan 8 15:10:41 2015 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Jan 9 15:10:09 2015 +0800

----------------------------------------------------------------------
 .../dataformat/xmljson/XmlJsonOptionsTest.java  | 44 ++++++++++----------
 1 file changed, 23 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9bfb2092/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonOptionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonOptionsTest.java
b/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonOptionsTest.java
index 5183c5e..1deeba6 100644
--- a/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonOptionsTest.java
+++ b/components/camel-xmljson/src/test/java/org/apache/camel/dataformat/xmljson/XmlJsonOptionsTest.java
@@ -139,9 +139,9 @@ public class XmlJsonOptionsTest extends CamelTestSupport {
         assertEquals("Root element must have namespace attributes", 2, document.getDocumentElement().getAttributes().getLength());
         mockXML.assertIsSatisfied();
     }
-	
-	@Test
-	public void testTypeHintsToJSON() throws Exception {
+    
+    @Test
+    public void testTypeHintsToJSON() throws Exception {
         InputStream inStream = getClass().getClassLoader().getResourceAsStream("org/apache/camel/dataformat/xmljson/testMessage5-typeHints.xml");
         String in = context.getTypeConverter().convertTo(String.class, inStream);
 
@@ -156,10 +156,10 @@ public class XmlJsonOptionsTest extends CamelTestSupport {
         assertEquals("root.b must be boolean", Boolean.TRUE, obj.getJSONObject("root").get("b"));
 
         mockJSON.assertIsSatisfied();
-	}
-	
-	@Test
-	public void testTypeHintsToXML() throws Exception {
+    }
+    
+    @Test
+    public void testTypeHintsToXML() throws Exception {
         InputStream inStream = getClass().getClassLoader().getResourceAsStream("org/apache/camel/dataformat/xmljson/testMessage5-typeHints.json");
         String in = context.getTypeConverter().convertTo(String.class, inStream);
 
@@ -171,13 +171,15 @@ public class XmlJsonOptionsTest extends CamelTestSupport {
         Document document = context.getTypeConverter().convertTo(Document.class, marshalled);
         assertEquals("Element a should exists", 1, document.getDocumentElement().getElementsByTagName("a").getLength());
         assertNotNull("Element a should have attribute type", document.getDocumentElement().getElementsByTagName("a").item(0).getAttributes().getNamedItem("type"));
-        assertEquals("Element a should have attribute type with value number", "number",
document.getDocumentElement().getElementsByTagName("a").item(0).getAttributes().getNamedItem("type").getTextContent());
-        assertEquals("Element b should have attribute type with value boolean", "boolean",
document.getDocumentElement().getElementsByTagName("b").item(0).getAttributes().getNamedItem("type").getTextContent());
+        assertEquals("Element a should have attribute type with value number", "number",
+                     document.getDocumentElement().getElementsByTagName("a").item(0).getAttributes().getNamedItem("type").getTextContent());
+        assertEquals("Element b should have attribute type with value boolean", 
+                     "boolean", document.getDocumentElement().getElementsByTagName("b").item(0).getAttributes().getNamedItem("type").getTextContent());
         mockXML.assertIsSatisfied();
-	}
-	
-	@Test
-	public void testPrefixedTypeHintsToJSON() throws Exception {
+    }
+    
+    @Test
+    public void testPrefixedTypeHintsToJSON() throws Exception {
         InputStream inStream = getClass().getClassLoader().getResourceAsStream("org/apache/camel/dataformat/xmljson/testMessage6-prefixedTypeHints.xml");
         String in = context.getTypeConverter().convertTo(String.class, inStream);
 
@@ -192,7 +194,7 @@ public class XmlJsonOptionsTest extends CamelTestSupport {
         assertEquals("root.b must be boolean", Boolean.TRUE, obj.getJSONObject("root").get("b"));
 
         mockJSON.assertIsSatisfied();
-	}
+    }
 
 
     @Override
@@ -225,18 +227,18 @@ public class XmlJsonOptionsTest extends CamelTestSupport {
                 // from JSON to XML
                 from("direct:unmarshalNS").unmarshal(namespacesFormat).to("mock:xmlNS");
 
-				XmlJsonDataFormat typeHintsFormat = new XmlJsonDataFormat();
+                XmlJsonDataFormat typeHintsFormat = new XmlJsonDataFormat();
                 typeHintsFormat.setForceTopLevelObject(true);
-				typeHintsFormat.setTypeHints("YES");
-				// from XML to JSON
+                typeHintsFormat.setTypeHints("YES");
+                // from XML to JSON
                 from("direct:marshalTypeHints").marshal(typeHintsFormat).to("mock:jsonTypeHints");
                 // from JSON to XML
                 from("direct:unmarshalTypeHints").unmarshal(typeHintsFormat).to("mock:xmlTypeHints");
-				
-				XmlJsonDataFormat prefixedTypeHintsFormat = new XmlJsonDataFormat();
+                
+                XmlJsonDataFormat prefixedTypeHintsFormat = new XmlJsonDataFormat();
                 prefixedTypeHintsFormat.setForceTopLevelObject(true);
-				prefixedTypeHintsFormat.setTypeHints("WITH_PREFIX");
-				// from XML to JSON
+                prefixedTypeHintsFormat.setTypeHints("WITH_PREFIX");
+                // from XML to JSON
                 from("direct:marshalPrefixedTypeHints").marshal(prefixedTypeHintsFormat).to("mock:jsonPrefixedTypeHints");
 
             }


Mime
View raw message