Author: ningjiang Date: Wed Feb 24 11:27:53 2010 New Revision: 915753 URL: http://svn.apache.org/viewvc?rev=915753&view=rev Log: Fixed the CS errors of camel-cxf
Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/DefaultCxfBeanBinding.java camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRouterTest.java Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/DefaultCxfBeanBinding.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/DefaultCxfBeanBinding.java?rev=915753&r1=915752&r2=915753&view=diff ============================================================================== --- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/DefaultCxfBeanBinding.java (original) +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/DefaultCxfBeanBinding.java Wed Feb 24 11:27:53 2010 @@ -124,9 +124,9 @@ } // propagate HTTP CONTENT_TYPE - if (cxfMessage.get(Message.CONTENT_TYPE) != null) { - camelHeaders.put(Exchange.CONTENT_TYPE, cxfMessage.get(Message.CONTENT_TYPE)); - } + if (cxfMessage.get(Message.CONTENT_TYPE) != null) { + camelHeaders.put(Exchange.CONTENT_TYPE, cxfMessage.get(Message.CONTENT_TYPE)); + } } Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java?rev=915753&r1=915752&r2=915753&view=diff ============================================================================== --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java (original) +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java Wed Feb 24 11:27:53 2010 @@ -72,11 +72,11 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(put); + HttpResponse response = httpclient.execute(put); assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals("", EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @@ -90,18 +90,18 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(post); + HttpResponse response = httpclient.execute(post); assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>", - EntityUtils.toString(response.getEntity())); + EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @Test public void testPostConsumerUniqueResponseCode() throws Exception { - HttpPost post = new HttpPost("http://localhost:9000/customerservice/customersUniqueResponseCode"); + HttpPost post = new HttpPost("http://localhost:9000/customerservice/customersUniqueResponseCode"); post.addHeader("Accept" , "text/xml"); StringEntity entity = new StringEntity(POST_REQUEST, "ISO-8859-1"); entity.setContentType("text/xml; charset=ISO-8859-1"); @@ -109,18 +109,18 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(post); + HttpResponse response = httpclient.execute(post); assertEquals(201, response.getStatusLine().getStatusCode()); assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>125</id><name>Jack</name></Customer>", - EntityUtils.toString(response.getEntity())); + EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @Test public void testJaxWsBean() throws Exception { - HttpPost post = new HttpPost("http://localhost:9090/customerservice/customers"); + HttpPost post = new HttpPost("http://localhost:9090/customerservice/customers"); post.addHeader("Accept" , "text/xml"); String body = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body><GetPerson xmlns=\"http://camel.apache.org/wsdl-first/types\">" @@ -132,7 +132,7 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(post); + HttpResponse response = httpclient.execute(post); assertEquals(200, response.getStatusLine().getStatusCode()); String responseBody = EntityUtils.toString(response.getEntity()); String correct = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body>" @@ -141,7 +141,7 @@ assertEquals("Get a wrong response", correct, responseBody); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRouterTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRouterTest.java?rev=915753&r1=915752&r2=915753&view=diff ============================================================================== --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRouterTest.java (original) +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRouterTest.java Wed Feb 24 11:27:53 2010 @@ -46,23 +46,23 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(get); + HttpResponse response = httpclient.execute(get); assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals("{\"Customer\":{\"id\":123,\"name\":\"John\"}}", - EntityUtils.toString(response.getEntity())); + EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @Test public void testGetCustomers() throws Exception { - HttpGet get = new HttpGet("http://localhost:9000/customerservice/customers/"); + HttpGet get = new HttpGet("http://localhost:9000/customerservice/customers/"); get.addHeader("Accept" , "application/xml"); HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(get); + HttpResponse response = httpclient.execute(get); assertEquals(200, response.getStatusLine().getStatusCode()); // order returned can differ on OS so match for both orders String s = EntityUtils.toString(response.getEntity()); @@ -73,23 +73,23 @@ fail("Not expected body returned: " + s); } } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @Test public void testGetSubResource() throws Exception { - HttpGet get = new HttpGet("http://localhost:9000/customerservice/orders/223/products/323"); + HttpGet get = new HttpGet("http://localhost:9000/customerservice/orders/223/products/323"); get.addHeader("Accept" , "application/json"); HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(get); + HttpResponse response = httpclient.execute(get); assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals("{\"Product\":{\"description\":\"product 323\",\"id\":323}}", - EntityUtils.toString(response.getEntity())); + EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @@ -102,11 +102,11 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(put); + HttpResponse response = httpclient.execute(put); assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals("", EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @@ -120,19 +120,19 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(post); + HttpResponse response = httpclient.execute(post); assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>", - EntityUtils.toString(response.getEntity())); + EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } @Test public void testPostConsumerUniqueResponseCode() throws Exception { - HttpPost post = new HttpPost("http://localhost:9000/customerservice/customersUniqueResponseCode"); + HttpPost post = new HttpPost("http://localhost:9000/customerservice/customersUniqueResponseCode"); post.addHeader("Accept" , "text/xml"); StringEntity entity = new StringEntity(POST_REQUEST, "ISO-8859-1"); entity.setContentType("text/xml; charset=ISO-8859-1"); @@ -140,12 +140,12 @@ HttpClient httpclient = new DefaultHttpClient(); try { - HttpResponse response = httpclient.execute(post); + HttpResponse response = httpclient.execute(post); assertEquals(201, response.getStatusLine().getStatusCode()); assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Customer><id>124</id><name>Jack</name></Customer>", - EntityUtils.toString(response.getEntity())); + EntityUtils.toString(response.getEntity())); } finally { - httpclient.getConnectionManager().shutdown(); + httpclient.getConnectionManager().shutdown(); } } } \ No newline at end of file