svn commit: r1476502 - in /camel/trunk/components/camel-spring-ws/src: main/java/org/apache/camel/component/spring/ws/ test/java/org/apache/camel/component/spring/ws/ test/resources/org/apache/camel/c

2013-04-27 Thread davsclaus
Author: davsclaus
Date: Sat Apr 27 06:36:46 2013
New Revision: 1476502

URL: http://svn.apache.org/r1476502
Log:
CAMEL-4515: spring-ws now supports SOAP header to/from Camel Message so end 
users can set/access it. Thanks to Damian for the patch.

Added:

camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderResponseProcessor.java

camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderTest.java

camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SoapHeaderTest-context.xml
Modified:

camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java

camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java

camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java

Modified: 
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java?rev=1476502r1=1476501r2=1476502view=diff
==
--- 
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
 (original)
+++ 
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
 Sat Apr 27 06:36:46 2013
@@ -18,14 +18,14 @@ package org.apache.camel.component.sprin
 
 public final class SpringWebserviceConstants {
 
-/* Producer constants */
 public static final String SPRING_WS_ENDPOINT_URI = 
CamelSpringWebserviceEndpointUri;
+
 public static final String SPRING_WS_SOAP_ACTION = 
CamelSpringWebserviceSoapAction;
+public static final String SPRING_WS_SOAP_HEADER = 
CamelSpringWebserviceSoapHeader;
+
 public static final String SPRING_WS_ADDRESSING_ACTION = 
CamelSpringWebserviceAddressingAction;
 public static final String SPRING_WS_ADDRESSING_PRODUCER_FAULT_TO =  
CamelSpringWebserviceAddressingFaultTo;
 public static final String SPRING_WS_ADDRESSING_PRODUCER_REPLY_TO = 
CamelSpringWebserviceAddressingReplyTo;
-
-/* Consumers constants (reserved, not impl. yet) */
 public static final String SPRING_WS_ADDRESSING_CONSUMER_OUTPUT_ACTION = 
CamelSpringWebserviceAddressingOutputAction;
 public static final String SPRING_WS_ADDRESSING_CONSUMER_FAULT_ACTION = 
CamelSpringWebserviceAddressingFaultAction;
 

Modified: 
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java?rev=1476502r1=1476501r2=1476502view=diff
==
--- 
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
 (original)
+++ 
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
 Sat Apr 27 06:36:46 2013
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.spring.ws;
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -66,9 +65,9 @@ public class SpringWebserviceConsumer ex
 if (responseMessage != null) {
 Source responseBody = responseMessage.getBody(Source.class);
 WebServiceMessage response = messageContext.getResponse();
-
+
 configuration.getMessageFilter().filterConsumer(exchange, 
response);
-
+
 XmlConverter xmlConverter = configuration.getXmlConverter();
 xmlConverter.toResult(responseBody, 
response.getPayloadResult());
 }
@@ -81,7 +80,7 @@ public class SpringWebserviceConsumer ex
 // create inbound message
 WebServiceMessage request = messageContext.getRequest();
 SpringWebserviceMessage inMessage = new 
SpringWebserviceMessage(request);
-inMessage.setHeaders(extractSoapHeadersFromWebServiceMessage(request));
+extractSourceFromSoapHeader(inMessage.getHeaders(), request);
 exchange.setIn(inMessage);
 }
 
@@ -96,28 +95,40 @@ public class SpringWebserviceConsumer ex
 }
 }
 
-private MapString, Object 
extractSoapHeadersFromWebServiceMessage(WebServiceMessage request) {
-MapString, Object headers = new HashMapString, Object();
+/**
+ * Extracts the SOAP headers and set them as headers in the Exchange. Also 
sets
+ * it as a header with the 

svn commit: r1476503 - in /camel/branches/camel-2.11.x: ./ components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/ components/camel-spring-ws/src/test/java/org/apache/camel/comp

2013-04-27 Thread davsclaus
Author: davsclaus
Date: Sat Apr 27 06:37:33 2013
New Revision: 1476503

URL: http://svn.apache.org/r1476503
Log:
CAMEL-4515: spring-ws now supports SOAP header to/from Camel Message so end 
users can set/access it. Thanks to Damian for the patch.

Added:

camel/branches/camel-2.11.x/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderResponseProcessor.java
  - copied unchanged from r1476502, 
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderResponseProcessor.java

camel/branches/camel-2.11.x/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderTest.java
  - copied unchanged from r1476502, 
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderTest.java

camel/branches/camel-2.11.x/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SoapHeaderTest-context.xml
  - copied unchanged from r1476502, 
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SoapHeaderTest-context.xml
Modified:
camel/branches/camel-2.11.x/   (props changed)

camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java

camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java

camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java

Propchange: camel/branches/camel-2.11.x/
--
  Merged /camel/trunk:r1476502

Propchange: camel/branches/camel-2.11.x/
--
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Apr 27 06:37:33 2013
@@ -1 +1 @@
-/camel/trunk:1-1468763,1469704,1469819,1470420,1470426-1470427,1470429,1470508,1471293,1471330,1471407-1471408,1471543,1475657,1475677,1475742,1475786,1476113,1476428,1476442
+/camel/trunk:1-1468763,1469704,1469819,1470420,1470426-1470427,1470429,1470508,1471293,1471330,1471407-1471408,1471543,1475657,1475677,1475742,1475786,1476113,1476428,1476442,1476502

Modified: 
camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java?rev=1476503r1=1476502r2=1476503view=diff
==
--- 
camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
 (original)
+++ 
camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
 Sat Apr 27 06:37:33 2013
@@ -18,14 +18,14 @@ package org.apache.camel.component.sprin
 
 public final class SpringWebserviceConstants {
 
-/* Producer constants */
 public static final String SPRING_WS_ENDPOINT_URI = 
CamelSpringWebserviceEndpointUri;
+
 public static final String SPRING_WS_SOAP_ACTION = 
CamelSpringWebserviceSoapAction;
+public static final String SPRING_WS_SOAP_HEADER = 
CamelSpringWebserviceSoapHeader;
+
 public static final String SPRING_WS_ADDRESSING_ACTION = 
CamelSpringWebserviceAddressingAction;
 public static final String SPRING_WS_ADDRESSING_PRODUCER_FAULT_TO =  
CamelSpringWebserviceAddressingFaultTo;
 public static final String SPRING_WS_ADDRESSING_PRODUCER_REPLY_TO = 
CamelSpringWebserviceAddressingReplyTo;
-
-/* Consumers constants (reserved, not impl. yet) */
 public static final String SPRING_WS_ADDRESSING_CONSUMER_OUTPUT_ACTION = 
CamelSpringWebserviceAddressingOutputAction;
 public static final String SPRING_WS_ADDRESSING_CONSUMER_FAULT_ACTION = 
CamelSpringWebserviceAddressingFaultAction;
 

Modified: 
camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java?rev=1476503r1=1476502r2=1476503view=diff
==
--- 
camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
 (original)
+++ 
camel/branches/camel-2.11.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
 Sat Apr 27 06:37:33 2013
@@ -16,7 +16,6 @@
  */
 package 

[CONF] Apache Camel Spring Web Services

2013-04-27 Thread confluence







Spring Web Services
Page edited by Claus Ibsen


 Changes (2)
 




...
| {{CamelSpringWebserviceSoapAction}} | String | Header to specify the SOAP action of the message, overrides {{soapAction}} option if present | | {{CamelSpringWebserviceAddressingAction}} | URI | Use this header to specify the WS-Addressing action of the message, overrides {{wsAddressingAction}} option if present | 
| {{CamelSpringWebserviceSoapHeader}} | Source | *Camel 2.11.1:* Use this header to specify/access the SOAP headers of the message. | 
{div}  
...
{code}  
 h3. Using SOAP headers *Available as of Camel 2.11.1*  You can provide the SOAP header(s) as a Camel Message header when sending a message to a spring-ws endpoint, for example given the following SOAP header in a String {code} String body = ... String soapHeader = h:Header xmlns:h=\http://www.webserviceX.NET/\h:MessageID1234567890/h:MessageIDh:Nestedh:NestedID/h:NestedID/h:Nested/h:Header; {code}  We can set the body and header on the Camel Message as follows: {code} exchange.getIn().setBody(body); exchange.getIn().setHeader(SpringWebserviceConstants.SPRING_WS_SOAP_HEADER, soapHeader); {code}  And then send the Exchange to a {{spring-ws}} endpoint to call the Web Service.  Likewise the spring-ws consumer will also enrich the Camel Message with the SOAP header.  For an example see this [unit test|https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderTest.java].   
h3. The header and attachment propagation Spring WS Camel supports propagation of the headers and attachments into Spring-WS WebServiceMessage response since version *2.10.3*. 
...


Full Content

Spring Web Services Component

Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both clientside support, for accessing web services, and serverside support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x.

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference an org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher object in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 


 timeout 
 No 
 Camel 2.10: Sets the socket 

[CONF] Apache Camel Camel 2.12.0 Release

2013-04-27 Thread confluence







Camel 2.12.0 Release
Page edited by Claus Ibsen


 Changes (1)
 




...
* [Endpoint Annotations] along with automatically created HTML documentation for the endpoint parameters; this makes it easier for component developers to add a few refactoring-safe annotations to their Endpoint or Consumer implementations and, (along with javadoc comments on the field or setter method), get nice user documentation on how to use the endpoint for free. * [ComponentConfiguration] API provides a handy API for tools developers to introspect on a Component to find all the possible parameters, their types and any extra annotations (like Bean Validation Annotations) to be able to create/edit endpoints or URI strings so that tools can generate nicer UIs for configuring endpoints than just letting folks edit Strings. 
* [Spring Web Services] now supports setting/receiving SOAP headers more easily using a header on the Camel [Message]. 
 h3. Fixed Issues 
...


Full Content

Camel 2.12.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.12.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	Endpoint Annotations along with automatically created HTML documentation for the endpoint parameters; this makes it easier for component developers to add a few refactoring-safe annotations to their Endpoint or Consumer implementations and, (along with javadoc comments on the field or setter method), get nice user documentation on how to use the endpoint for free.
	ComponentConfiguration API provides a handy API for tools developers to introspect on a Component to find all the possible parameters, their types and any extra annotations (like Bean Validation Annotations) to be able to create/edit endpoints or URI strings so that tools can generate nicer UIs for configuring endpoints than just letting folks edit Strings.
	Spring Web Services now supports setting/receiving SOAP headers more easily using a header on the Camel Message.



Fixed Issues


	Fixed setting .id in Java DSL on some EIPs such as the Validate
	Fixed Dead Letter Channel always handled exception, which wasn't the case if an Exception Clause was in use, which didn't had handled=true.
	Fixed Using PropertyPlaceholder in attributes defined on camelContext.
	All Camel Components will configure their consumers when being created to ensure you can configure from URIs with consumer. as prefix.



New Enterprise Integration Patterns

New Components

New DSL

New Annotations

New Data Formats

New Languages

New Examples

New Tutorials

API breaking

Known Issues

Important changes to consider when upgrading

Getting the Distributions

Binary Distributions




 Description 
 Download Link 
 PGP Signature file of download 


 Windows Distribution 
 apache-camel-2.12.0.zip 
 apache-camel-2.12.0.zip.asc 


 Unix/Linux/Cygwin Distribution 
 apache-camel-2.12.0.tar.gz 
 apache-camel-2.12.0.tar.gz.asc 




The above URLs use redirectionThe above URLs use the Apache Mirror system to redirect you to a suitable mirror for your download. Some users have experienced issues with some versions of browsers (e.g. some Safari browsers). If the download doesn't seem to work for you from the above URL then try using FireFox

Source Distributions




 Description 
 Download Link 
 PGP Signature file of download 


 Source for Windows 
 apache-camel-2.12.0-src.zip 
 apache-camel-2.12.0-src.zip.asc 








 Source for Unix/Linux/Cygwin 
 apache-camel-2.12.0-src.tar.gz 
 apache-camel-2.12.0-src.tar.gz.asc 





Getting the Binaries using Maven 2

To use this release in your maven project, the proper dependency configuration that you should use in your Maven POM is:


dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-core/artifactId
  version2.12.0/version
/dependency



SVN Tag Checkout



svn co http://svn.apache.org/repos/asf/camel/tags/camel-2.12.0



Changelog

For a more detailed view of new features and bug fixes, see the:

	release notes for 2.12.0





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









svn commit: r860081 - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache camel-2120-release.html spring-web-services.html

2013-04-27 Thread buildbot
Author: buildbot
Date: Sat Apr 27 07:22:05 2013
New Revision: 860081

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/book-component-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/camel-2120-release.html
websites/production/camel/content/spring-web-services.html

Modified: websites/production/camel/content/book-component-appendix.html
==
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Sat Apr 27 
07:22:05 2013
@@ -16208,7 +16208,7 @@ spring-ws:[mapping-type:]address[?option
 h3a shape=rect name=BookComponentAppendix-Messageheaders/aMessage 
headers/h3
 
 div class=confluenceTableSmalldiv class=table-wrap
-table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Name /thth colspan=1 rowspan=1 
class=confluenceTh Type /thth colspan=1 rowspan=1 
class=confluenceTh Description /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttCamelSpringWebserviceEndpointUri/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd String /tdtd colspan=1 
rowspan=1 class=confluenceTd URI of the web service your accessing as a 
client, overrides emaddress/em part of the endpoint URI /td/trtrtd 
colspan=1 rowspan=1 class=confluenceTd 
ttCamelSpringWebserviceSoapAction/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd String /tdtd colspan=1 rowspan=1 
class=confluenceTd Header to specify the SOAP action of the message, 
overrides ttsoapAction/tt option if present /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd 
ttCamelSpringWebserviceAddressingAction/tt /tdtd
  colspan=1 rowspan=1 class=confluenceTd URI /tdtd colspan=1 
rowspan=1 class=confluenceTd Use this header to specify the WS-Addressing 
action of the message, overrides ttwsAddressingAction/tt option if present 
/td/tr/tbody/table
+table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Name /thth colspan=1 rowspan=1 
class=confluenceTh Type /thth colspan=1 rowspan=1 
class=confluenceTh Description /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttCamelSpringWebserviceEndpointUri/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd String /tdtd colspan=1 
rowspan=1 class=confluenceTd URI of the web service your accessing as a 
client, overrides emaddress/em part of the endpoint URI /td/trtrtd 
colspan=1 rowspan=1 class=confluenceTd 
ttCamelSpringWebserviceSoapAction/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd String /tdtd colspan=1 rowspan=1 
class=confluenceTd Header to specify the SOAP action of the message, 
overrides ttsoapAction/tt option if present /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd 
ttCamelSpringWebserviceAddressingAction/tt /tdtd
  colspan=1 rowspan=1 class=confluenceTd URI /tdtd colspan=1 
rowspan=1 class=confluenceTd Use this header to specify the WS-Addressing 
action of the message, overrides ttwsAddressingAction/tt option if present 
/td/trtrtd colspan=1 rowspan=1 class=confluenceTd 
ttCamelSpringWebserviceSoapHeader/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd Source /tdtd colspan=1 rowspan=1 
class=confluenceTd bCamel 2.11.1:/b Use this header to specify/access 
the SOAP headers of the message. /td/tr/tbody/table
 /div
 /div
 
@@ -16248,6 +16248,33 @@ template.requestBodyAndHeader(span clas
 /pre
 /div/div
 
+
+h3a shape=rect name=BookComponentAppendix-UsingSOAPheaders/aUsing 
SOAP headers/h3
+pbAvailable as of Camel 2.11.1/b/p
+
+pYou can provide the SOAP header(s) as a Camel Message header when sending a 
message to a spring-ws endpoint, for example given the following SOAP header in 
a String/p
+div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
+pre class=code-java
+span class=code-objectString/span body = ...
+span class=code-objectString/span soapHeader = span 
class=code-quotelt;h:Header xmlns:h=\/spanhttp:span 
class=code-comment//www.webserviceX.NET/\span 
class=code-quotegt;lt;h:MessageIDgt;1234567890lt;/h:MessageIDgt;lt;h:Nestedgt;lt;h:NestedIDgt;lt;/h:NestedIDgt;lt;/h:Nestedgt;lt;/h:Headergt;/span;/span
+/pre
+/div/div
+
+pWe can set the body and header on the Camel Message as follows:/p
+div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
+pre class=code-java
+exchange.getIn().setBody(body);
+exchange.getIn().setHeader(SpringWebserviceConstants.SPRING_WS_SOAP_HEADER, 
soapHeader);
+/pre
+/div/div
+
+pAnd then send the Exchange to a ttspring-ws/tt endpoint to call the Web 
Service./p
+
+pLikewise the spring-ws consumer will also enrich the Camel Message with the 
SOAP header./p
+
+pFor an example see this a shape=rect class=external-link 

svn commit: r1476521 - /camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java

2013-04-27 Thread davsclaus
Author: davsclaus
Date: Sat Apr 27 07:59:27 2013
New Revision: 1476521

URL: http://svn.apache.org/r1476521
Log:
Polished

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java?rev=1476521r1=1476520r2=1476521view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
 Sat Apr 27 07:59:27 2013
@@ -99,7 +99,6 @@ public class XmlConverter {
 DOM_TO_SAX_CLASS = cl;
 }
 
-
 public XmlConverter() {
 }
 
@@ -907,6 +906,7 @@ public class XmlConverter {
 
 // Properties
 //-
+
 public DocumentBuilderFactory getDocumentBuilderFactory() {
 if (documentBuilderFactory == null) {
 documentBuilderFactory = createDocumentBuilderFactory();
@@ -918,9 +918,20 @@ public class XmlConverter {
 this.documentBuilderFactory = documentBuilderFactory;
 }
 
+public TransformerFactory getTransformerFactory() {
+if (transformerFactory == null) {
+transformerFactory = createTransformerFactory();
+}
+return transformerFactory;
+}
+
+public void setTransformerFactory(TransformerFactory transformerFactory) {
+this.transformerFactory = transformerFactory;
+}
 
 // Helper methods
 //-
+
 public DocumentBuilderFactory createDocumentBuilderFactory() {
 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
 factory.setNamespaceAware(true);
@@ -929,7 +940,6 @@ public class XmlConverter {
 return factory;
 }
 
-
 public DocumentBuilder createDocumentBuilder() throws 
ParserConfigurationException {
 DocumentBuilderFactory factory = getDocumentBuilderFactory();
 return factory.newDocumentBuilder();
@@ -940,17 +950,6 @@ public class XmlConverter {
 return builder.newDocument();
 }
 
-public TransformerFactory getTransformerFactory() {
-if (transformerFactory == null) {
-transformerFactory = createTransformerFactory();
-}
-return transformerFactory;
-}
-
-public void setTransformerFactory(TransformerFactory transformerFactory) {
-this.transformerFactory = transformerFactory;
-}
-
 /**
  * @deprecated use {@link #createTransformer}, will be removed in Camel 3.0
  */




[CONF] Apache Camel AdviceWith

2013-04-27 Thread confluence







AdviceWith
Page edited by Claus Ibsen


 Changes (1)
 




...
The regular _expression_ is more advanced and allows you to match multiple ids, such as {{weaveById((foo\|bar))}} which will match both {{foo}} and {{bar}}.  
{tip} If you try to match a {{pattern}} on an exact endpoint uri, then mind that URI options ordering may influence, and hence its best to match by wildcard. For example: {code} mockEndpointsAndSkip(activemq:queue:foo?*) {code} To match the foo queue and disregard any options. {tip} 
 h3. Using weaveById 
...


Full Content

AdviceWith

Available as of Camel 2.1

AdviceWith is used for testing Camel routes where you can advice an existing route before its being tested. What adviceWith allows is to changes some factors on the route before the test is being run.

At current time you can advice an existing route by adding Intercept, Exception Clause etc. which then will apply for the route being advice.

For example in the route below we intercept sending a message to the mock:foo endpoint and detour the message.

public void testAdvised() throws Exception {
// advice the first route using the inlined route builder
context.getRouteDefinitions().get(0).adviceWith(context, new RouteBuilder() {
@Override
public void configure() throws Exception {
// intercept sending to mock:foo and do something else
interceptSendToEndpoint("mock:foo")
.skipSendToOriginalEndpoint()
.to("log:foo")
.to("mock:advised");
}
});

getMockEndpoint("mock:foo").expectedMessageCount(0);
getMockEndpoint("mock:advised").expectedMessageCount(1);
getMockEndpoint("mock:result").expectedMessageCount(1);

template.sendBody("direct:start", "Hello World");

assertMockEndpointsSatisfied();
}



RecommendationIt is recommended to only advice a given route once (you can of course advice multiple routes). If you do it multiple times, then it may not work as expected, especially when any kind of error handling is involved.
The Camel team plan for Camel 3.0 to support this as internal refactorings in the routing engine is needed to support this properly.

Telling Camel you are using adviceWithFrom Camel 2.9 onwards its recommended to override the isUseAdviceWith method and return true to tell Camel you are using advice with in your unit tests. Then after you have done the adviceWith, then you must start CamelContext manually. See further below for an example.

Using AdviceWithRouteBuilder

Available as of Camel 2.7

The AdviceWithRouteBuilder is a specialized RouteBuilder which has additional methods for advising routes. For example this allows you to manipulate the advised route, such as replacing a node with some other nodes.

The AdviceWithRouteBuilder offers the following extra methods




 Method 
 Description 


 mockEndpoints 
 Is used to easily mock all endpoints. See more details and examples at Mock. 


 mockEndpoints(patterns) 
 Is used to easily mock endpoints using a pattern. See more details and examples at Mock. See below for pattern matching. From Camel 2.10 onwards you can specify multiple patterns. 


 mockEndpointsAndSkip(patterns) 
 Is used to easily mock endpoints using a pattern, and skip sending to the original endpoint. See more details and examples at Mock. See below for pattern matching. You can specify multiple patterns. 


 weaveById(pattern) 
 Is used to select node(s) matching by id's, and weave in the following nodes. See below for pattern matching and examples. 


 weaveByToString(pattern) 
 Is used to select nodes(s) matching by their toString representation, and weave in the following nodes. See below for pattern matching and examples. 


 weaveByType(Class) 
 Camel 2.8: Is used to select node(s) matching by their class type (the classes from the org.apache.camel.model package), and weave in the following nodes. See below for examples. 


 weaveAddFirst 
 Camel 2.8: Is a short hand to easily weave in the following nodes in the start of the route. 


 weaveAddLast 
 Camel 2.8: Is a short hand to easily weave in the following nodes in the end of the route. 


 replaceFromWith(uri) 
 Camel 2.9: To replace the route input with a new endpoint uri. 





The pattern option is used for matching. It uses the same rules as the Intercept, which is applied in the following order:

	match exact
	match by wildcard
	match by regular _expression_



For example to match exact you can use weaveById("foo") which will match only the id in the route which has the value "foo".
The wildcard is when the pattern ends with a * char, such as: weaveById("foo*") which will match any id's starting with "foo", such as foo, foobar, foobie 

svn commit: r1476522 - /camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/AdviceWithIssueTest.java

2013-04-27 Thread davsclaus
Author: davsclaus
Date: Sat Apr 27 08:10:23 2013
New Revision: 1476522

URL: http://svn.apache.org/r1476522
Log:
CAMEL-6319: Added test

Added:

camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/AdviceWithIssueTest.java

Added: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/AdviceWithIssueTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/AdviceWithIssueTest.java?rev=1476522view=auto
==
--- 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/AdviceWithIssueTest.java
 (added)
+++ 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/AdviceWithIssueTest.java
 Sat Apr 27 08:10:23 2013
@@ -0,0 +1,66 @@
+/**
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * 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.
+ */
+package org.apache.camel.component.jms.issues;
+
+import java.util.Collections;
+
+import org.apache.camel.builder.AdviceWithRouteBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class AdviceWithIssueTest extends CamelTestSupport {
+
+final String pub = 
activemq:topic:integrations?allowNullBody=falseasyncConsumer=trueconcurrentConsumers=10jmsMessageType=MappreserveMessageQos=true;
+final String advicedPub = activemq:topic:integrations;
+
+@Override
+public boolean isUseAdviceWith() {
+return true;
+}
+
+@Test
+public void testAdviceWith() throws Exception {
+context.getRouteDefinition(starter).adviceWith(context, new 
AdviceWithRouteBuilder() {
+@Override
+public void configure() throws Exception {
+// when advicing then use wildcard as URI options cannot be 
matched
+mockEndpointsAndSkip(advicedPub + ?*);
+}
+});
+context.start();
+
+MockEndpoint topicEndpointMock = getMockEndpoint(mock: + advicedPub);
+topicEndpointMock.expectedMessageCount(1);
+
+template.sendBody(direct:start, Collections.singletonMap(foo, 
bar));
+
+assertMockEndpointsSatisfied();
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from(direct:start).routeId(starter)
+.to(pub).to(mock:result);
+}
+};
+}
+}




svn commit: r860086 - in /websites/production/camel/content: advicewith.html cache/main.pageCache

2013-04-27 Thread buildbot
Author: buildbot
Date: Sat Apr 27 08:18:46 2013
New Revision: 860086

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/advicewith.html
websites/production/camel/content/cache/main.pageCache

Modified: websites/production/camel/content/advicewith.html
==
--- websites/production/camel/content/advicewith.html (original)
+++ websites/production/camel/content/advicewith.html Sat Apr 27 08:18:46 2013
@@ -135,6 +135,13 @@ The Camel team plan for Camel 3.0 to sup
 The wildcard is when the pattern ends with a * char, such as: 
ttweaveById(foo*)/tt which will match any id's starting with 
ttfoo/tt, such as ttfoo, foobar, foobie/tt and so forth.br 
clear=none
 The regular expression is more advanced and allows you to match multiple ids, 
such as ttweaveById((foo|bar))/tt which will match both ttfoo/tt 
and ttbar/tt./p
 
+div class=panelMacrotable class=tipMacrocolgroup span=1col 
span=1 width=24col span=1/colgrouptrtd colspan=1 rowspan=1 
valign=topimg align=middle 
src=https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif; 
width=16 height=16 alt= border=0/tdtd colspan=1 rowspan=1If 
you try to match a ttpattern/tt on an exact endpoint uri, then mind that 
URI options ordering may influence, and hence its best to match by wildcard. 
For example:
+div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
+pre class=code-java
+mockEndpointsAndSkip(span class=code-quoteactivemq:queue:foo?*/span)
+/pre
+/div/div
+pTo match the foo queue and disregard any 
options./p/td/tr/table/div
 
 h3a shape=rect name=AdviceWith-UsingweaveById/aUsing weaveById/h3
 
@@ -147,7 +154,8 @@ The regular expression is more advanced 
 
 pFor example given the following route:/p
 div class=code panel style=border-width: 1px;div class=codeHeader 
panelHeader style=border-bottom-width: 1px;bRoute/b/divdiv 
class=codeContent panelContent
-pre class=code-javafrom(span class=code-quotedirect:start/span)
+pre class=code-java
+from(span class=code-quotedirect:start/span)
 .to(span class=code-quotemock:foo/span)
 .to(span class=code-quotemock:bar/span).id(span 
class=code-quotebar/span)
 .to(span class=code-quotemock:result/span);
@@ -275,7 +283,8 @@ You have to be a bit more careful when u
 
 pFor example to remove the first tt.to/tt node in route you can do as 
follows:/p
 div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
-pre 
class=code-javacontext.getRouteDefinitions().get(0).adviceWith(context, 
span class=code-keywordnew/span AdviceWithRouteBuilder() {
+pre class=code-java
+context.getRouteDefinitions().get(0).adviceWith(context, span 
class=code-keywordnew/span AdviceWithRouteBuilder() {
 @Override
 span class=code-keywordpublic/span void configure() span 
class=code-keywordthrows/span Exception {
 span class=code-comment// only remove the first to node in the 
route
@@ -294,7 +303,8 @@ You have to be a bit more careful when u
 
 pFor example if you want to send a message to a ttmock:input/tt endpoint 
you can do as follows:/p
 div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
-pre 
class=code-javacontext.getRouteDefinitions().get(0).adviceWith(context, 
span class=code-keywordnew/span AdviceWithRouteBuilder() {
+pre class=code-java
+context.getRouteDefinitions().get(0).adviceWith(context, span 
class=code-keywordnew/span AdviceWithRouteBuilder() {
 @Override
 span class=code-keywordpublic/span void configure() span 
class=code-keywordthrows/span Exception {
 span class=code-comment// send the incoming message to mock:input
@@ -306,7 +316,8 @@ You have to be a bit more careful when u
 
 pLikewise if you want to easily send a message to a ttmock:output/tt 
endpoint you can do as follows:/p
 div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
-pre 
class=code-javacontext.getRouteDefinitions().get(0).adviceWith(context, 
span class=code-keywordnew/span AdviceWithRouteBuilder() {
+pre class=code-java
+context.getRouteDefinitions().get(0).adviceWith(context, span 
class=code-keywordnew/span AdviceWithRouteBuilder() {
 @Override
 span class=code-keywordpublic/span void configure() span 
class=code-keywordthrows/span Exception {
 span class=code-comment// send the outgoing message to mock:output
@@ -318,7 +329,8 @@ You have to be a bit more careful when u
 
 pYou can of course combine those in the same advice with:/p
 div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
-pre 
class=code-javacontext.getRouteDefinitions().get(0).adviceWith(context, 
span class=code-keywordnew/span AdviceWithRouteBuilder() {
+pre class=code-java
+context.getRouteDefinitions().get(0).adviceWith(context, span 
class=code-keywordnew/span AdviceWithRouteBuilder() {
 @Override
 span class=code-keywordpublic/span void configure() 

svn commit: r1476524 - in /camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link: ./ BindySimpleFixedLengthWithLinkTest.java

2013-04-27 Thread cmoulliard
Author: cmoulliard
Date: Sat Apr 27 08:26:40 2013
New Revision: 1476524

URL: http://svn.apache.org/r1476524
Log:
Add unit test about camel-bindy @FixedLength using @Link

Added:

camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link/

camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link/BindySimpleFixedLengthWithLinkTest.java

Added: 
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link/BindySimpleFixedLengthWithLinkTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link/BindySimpleFixedLengthWithLinkTest.java?rev=1476524view=auto
==
--- 
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link/BindySimpleFixedLengthWithLinkTest.java
 (added)
+++ 
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link/BindySimpleFixedLengthWithLinkTest.java
 Sat Apr 27 08:26:40 2013
@@ -0,0 +1,150 @@
+/**
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * 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.
+ */
+package org.apache.camel.dataformat.bindy.fixed.link;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.bindy.annotation.DataField;
+import org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+import org.apache.camel.model.dataformat.BindyDataFormat;
+import org.apache.camel.model.dataformat.BindyType;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+/**
+ * This test validates that header and footer records are successfully
+ * marshalled / unmarshalled in conjunction with the primary data records
+ * defined for the bindy data format.
+ */
+public class BindySimpleFixedLengthWithLinkTest extends CamelTestSupport {
+
+public static final String URI_DIRECT_UNMARSHALL = direct:unmarshall;
+public static final String URI_MOCK_UNMARSHALL_RESULT = 
mock:unmarshall-result;
+
+private static final String TEST_RECORD = AAABBBCCC\r\n;
+
+@EndpointInject(uri = URI_MOCK_UNMARSHALL_RESULT)
+private MockEndpoint unmarshallResult;
+
+// 
*
+// TESTS
+// 
*
+
+@Test
+public void testUnmarshallMessage() throws Exception {
+
+unmarshallResult.expectedMessageCount(1);
+
+template.sendBody(URI_DIRECT_UNMARSHALL, TEST_RECORD);
+
+unmarshallResult.assertIsSatisfied();
+
+// check the model
+Exchange exchange = unmarshallResult.getReceivedExchanges().get(0);
+BindySimpleFixedLengthWithLinkTest.Order order = 
(BindySimpleFixedLengthWithLinkTest.Order) exchange.getIn().getBody();
+assertEquals(AAA, order.fieldA);
+assertEquals(BBB, order.subRec.fieldB);
+assertEquals(CCC, order.fieldC);
+
+}
+
+// 
*
+// ROUTES
+// 
*
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+RouteBuilder routeBuilder = new RouteBuilder() {
+
+@Override
+public void configure() throws Exception {
+BindyDataFormat bindy = new BindyDataFormat();
+
bindy.setClassType(BindySimpleFixedLengthWithLinkTest.Order.class);
+bindy.setLocale(en);
+bindy.setType(BindyType.Fixed);
+
+from(URI_DIRECT_UNMARSHALL)
+.unmarshal().bindy(BindyType.Fixed, 
BindySimpleFixedLengthWithLinkTest.Order.class)
+.to(URI_MOCK_UNMARSHALL_RESULT);
+}
+};
+
+return routeBuilder;
+}
+
+// *
+// DATA FORMATS
+// *
+

svn commit: r1476525 - in /camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds: JcloudsBlobStoreConsumerTest.java JcloudsSpringBlobstoreTest.java

2013-04-27 Thread bvahdat
Author: bvahdat
Date: Sat Apr 27 08:27:42 2013
New Revision: 1476525

URL: http://svn.apache.org/r1476525
Log:
Replaced the deprecated BlobStoreContextFactory usage with the new 
ContextBuilder API.

Modified:

camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumerTest.java

camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsSpringBlobstoreTest.java

Modified: 
camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumerTest.java?rev=1476525r1=1476524r2=1476525view=diff
==
--- 
camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumerTest.java
 (original)
+++ 
camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumerTest.java
 Sat Apr 27 08:27:42 2013
@@ -20,9 +20,9 @@ import com.google.common.collect.Lists;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.jclouds.ContextBuilder;
 import org.jclouds.blobstore.BlobStore;
 import org.jclouds.blobstore.BlobStoreContext;
-import org.jclouds.blobstore.BlobStoreContextFactory;
 import org.jclouds.io.payloads.StringPayload;
 import org.junit.Test;
 
@@ -36,9 +36,7 @@ public class JcloudsBlobStoreConsumerTes
 private static final String TEST_BLOB_IN_DIR = dir/testBlob;
 private static final String TEST_BLOB_IN_OTHER = other/testBlob;
 
-BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
-BlobStoreContext blobStoreContext = 
contextFactory.createContext(transient, identity, credential);
-BlobStore blobStore = blobStoreContext.getBlobStore();
+BlobStore blobStore = 
ContextBuilder.newBuilder(transient).credentials(id, 
credential).buildView(BlobStoreContext.class).getBlobStore();
 
 @Test
 public void testBlobStoreGetOneBlob() throws InterruptedException {

Modified: 
camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsSpringBlobstoreTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsSpringBlobstoreTest.java?rev=1476525r1=1476524r2=1476525view=diff
==
--- 
camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsSpringBlobstoreTest.java
 (original)
+++ 
camel/trunk/components/camel-jclouds/src/test/java/org/apache/camel/component/jclouds/JcloudsSpringBlobstoreTest.java
 Sat Apr 27 08:27:42 2013
@@ -19,8 +19,9 @@ package org.apache.camel.component.jclou
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.jclouds.ContextBuilder;
+import org.jclouds.blobstore.BlobStore;
 import org.jclouds.blobstore.BlobStoreContext;
-import org.jclouds.blobstore.BlobStoreContextFactory;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.springframework.context.support.AbstractApplicationContext;
@@ -28,19 +29,17 @@ import org.springframework.context.suppo
 
 public class JcloudsSpringBlobstoreTest extends CamelSpringTestSupport {
 
-
 @EndpointInject(uri = mock:result-foo)
 protected MockEndpoint resultFoo;
 
-
 @EndpointInject(uri = mock:result-bar)
 protected MockEndpoint resultBar;
 
 @BeforeClass
 public static void setUpClass() throws Exception {
-BlobStoreContext context = new 
BlobStoreContextFactory().createContext(transient, id, credential);
-context.getBlobStore().createContainerInLocation(null, foo);
-context.getBlobStore().createContainerInLocation(null, bar);
+BlobStore blobStore = 
ContextBuilder.newBuilder(transient).credentials(id, 
credential).buildView(BlobStoreContext.class).getBlobStore();
+blobStore.createContainerInLocation(null, foo);
+blobStore.createContainerInLocation(null, bar);
 }
 
 @Override




svn commit: r1476540 - in /camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor: AnnotatedBookServiceImpl.java BookService.java MixedPropagationTransactedTest.java

2013-04-27 Thread bvahdat
Author: bvahdat
Date: Sat Apr 27 09:17:50 2013
New Revision: 1476540

URL: http://svn.apache.org/r1476540
Log:
Since Spring 3.1 SimpleJdbcTemplate has been deprecated.

Modified:

camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookServiceImpl.java

camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/BookService.java

camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java

Modified: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookServiceImpl.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookServiceImpl.java?rev=1476540r1=1476539r2=1476540view=diff
==
--- 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookServiceImpl.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/AnnotatedBookServiceImpl.java
 Sat Apr 27 09:17:50 2013
@@ -21,7 +21,7 @@ import javax.sql.DataSource;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.ProducerTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -52,7 +52,7 @@ public class AnnotatedBookServiceImpl im
 }
 
 // create new local datasource to store in DB
-new SimpleJdbcTemplate(dataSource).update(insert into books (title) 
values (?), title);
+new JdbcTemplate(dataSource).update(insert into books (title) values 
(?), title);
 
 template.sendBody(title);
 }

Modified: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/BookService.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/BookService.java?rev=1476540r1=1476539r2=1476540view=diff
==
--- 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/BookService.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/BookService.java
 Sat Apr 27 09:17:50 2013
@@ -18,7 +18,7 @@ package org.apache.camel.spring.intercep
 
 import javax.sql.DataSource;
 
-import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+import org.springframework.jdbc.core.JdbcTemplate;
 
 /**
  * Used for unit testing
@@ -26,13 +26,13 @@ import org.springframework.jdbc.core.sim
 // START SNIPPET: e1
 public class BookService {
 
-private SimpleJdbcTemplate jdbc;
+private JdbcTemplate jdbc;
 
 public BookService() {
 }
 
 public void setDataSource(DataSource ds) {
-jdbc = new SimpleJdbcTemplate(ds);
+jdbc = new JdbcTemplate(ds);
 }
 
 public void orderBook(String title) throws Exception {

Modified: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java?rev=1476540r1=1476539r2=1476540view=diff
==
--- 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/MixedPropagationTransactedTest.java
 Sat Apr 27 09:17:50 2013
@@ -24,14 +24,14 @@ import org.apache.camel.spring.SpringRou
 import org.apache.camel.spring.SpringTestSupport;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+import org.springframework.jdbc.core.JdbcTemplate;
 
 /**
  * For testing with mixed transacted propagation (required, requires new)
  */
 public class MixedPropagationTransactedTest extends SpringTestSupport {
 
-protected SimpleJdbcTemplate jdbc;
+protected JdbcTemplate jdbc;
 protected boolean useTransactionErrorHandler = true;
 
 protected AbstractXmlApplicationContext createApplicationContext() {
@@ -45,7 +45,7 @@ public class MixedPropagationTransactedT
 
 // create database and insert dummy data
 final DataSource ds = getMandatoryBean(DataSource.class, dataSource);
-jdbc = new SimpleJdbcTemplate(ds);
+jdbc = 

svn commit: r1476545 - in /camel/trunk/examples: camel-example-cxf-blueprint/ camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/ camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blue

2013-04-27 Thread ningjiang
Author: ningjiang
Date: Sat Apr 27 10:03:28 2013
New Revision: 1476545

URL: http://svn.apache.org/r1476545
Log:
CAMEL-6322 Fixed the warning issues of camel-example-cxf-osgi and 
camel-example-blueprint-osgi

Modified:
camel/trunk/examples/camel-example-cxf-blueprint/pom.xml

camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl

camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml

camel/trunk/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml
camel/trunk/examples/camel-example-cxf-osgi/pom.xml

camel/trunk/examples/camel-example-cxf-osgi/src/main/resources/META-INF/spring/camel-context.xml

camel/trunk/examples/camel-example-cxf-osgi/src/main/resources/META-INF/wsdl/report_incident.wsdl

camel/trunk/examples/camel-example-cxf-osgi/src/test/resources/camel-context.xml

Modified: camel/trunk/examples/camel-example-cxf-blueprint/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf-blueprint/pom.xml?rev=1476545r1=1476544r2=1476545view=diff
==
--- camel/trunk/examples/camel-example-cxf-blueprint/pom.xml (original)
+++ camel/trunk/examples/camel-example-cxf-blueprint/pom.xml Sat Apr 27 
10:03:28 2013
@@ -61,6 +61,11 @@
   scopetest/scope
 /dependency
 dependency
+ groupIdorg.apache.camel/groupId
+ artifactIdcamel-jaxb/artifactId
+ scopetest/scope
+   /dependency
+dependency
   groupIdjunit/groupId
   artifactIdjunit/artifactId
   scopetest/scope

Modified: 
camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl?rev=1476545r1=1476544r2=1476545view=diff
==
--- 
camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl
 (original)
+++ 
camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl
 Sat Apr 27 10:03:28 2013
@@ -84,7 +84,7 @@
 
 !-- Service definition --
 wsdl:service name=ReportIncidentEndpointService
-wsdl:port name=ReportIncidentService 
binding=tns:ReportIncidentBinding
+wsdl:port name=ReportIncidentEndpoint 
binding=tns:ReportIncidentBinding
 soap:address 
location=http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident/
 /wsdl:port
 /wsdl:service

Modified: 
camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml?rev=1476545r1=1476544r2=1476545view=diff
==
--- 
camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
 (original)
+++ 
camel/trunk/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
 Sat Apr 27 10:03:28 2013
@@ -30,8 +30,11 @@
 
   camelcxf:cxfEndpoint id=reportIncident
 
address=/camel-example-cxf-blueprint/webservices/incident
+endpointName=s:ReportIncidentEndpoint
+serviceName=s:ReportIncidentEndpointService
 wsdlURL=META-INF/wsdl/report_incident.wsdl
-
serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint/
+
serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint
+
xmlns:s=http://reportincident.example.camel.apache.org/
 
   bean id=reportIncidentRoutes 
class=org.apache.camel.example.reportincident.ReportIncidentRoutes/
 

Modified: 
camel/trunk/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml?rev=1476545r1=1476544r2=1476545view=diff
==
--- 
camel/trunk/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml
 (original)
+++ 
camel/trunk/examples/camel-example-cxf-blueprint/src/test/resources/camel-context.xml
 Sat Apr 27 10:03:28 2013
@@ -28,7 +28,10 @@
 cxf:cxfEndpoint id=reportIncident
  
address=http://localhost:{{port}}/cxf/camel-example-cxf-blueprint/webservices/incident;
  wsdlURL=META-INF/wsdl/report_incident.wsdl
- 
serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint
+ 

svn commit: r1476546 - in /camel/branches/camel-2.11.x: ./ components/camel-http/ components/camel-jms/ components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest

2013-04-27 Thread bvahdat
Author: bvahdat
Date: Sat Apr 27 10:05:29 2013
New Revision: 1476546

URL: http://svn.apache.org/r1476546
Log:
Merged revisions 1476448 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk


  r1476448 | bvahdat | 2013-04-27 01:18:01 +0200 (Sa, 27 Apr 2013) | 1 line
  
  Polished.


Modified:
camel/branches/camel-2.11.x/   (props changed)
camel/branches/camel-2.11.x/components/camel-http/   (props changed)
camel/branches/camel-2.11.x/components/camel-jms/   (props changed)

camel/branches/camel-2.11.x/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java

Propchange: camel/branches/camel-2.11.x/
--
  Merged /camel/trunk:r1476448

Propchange: camel/branches/camel-2.11.x/
--
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Apr 27 10:05:29 2013
@@ -1 +1 @@
-/camel/trunk:1-1468763,1469704,1469819,1470420,1470426-1470427,1470429,1470508,1471293,1471330,1471407-1471408,1471543,1475657,1475677,1475742,1475786,1476113,1476428,1476442,1476502
+/camel/trunk:1-1468763,1469704,1469819,1470420,1470426-1470427,1470429,1470508,1471293,1471330,1471407-1471408,1471543,1475657,1475677,1475742,1475786,1476113,1476428,1476442,1476448,1476502

Propchange: camel/branches/camel-2.11.x/components/camel-http/
--
  Merged /camel/trunk/components/camel-http:r1476448

Propchange: camel/branches/camel-2.11.x/components/camel-jms/
--
  Merged /camel/trunk/components/camel-jms:r1476448

Modified: 
camel/branches/camel-2.11.x/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.11.x/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java?rev=1476546r1=1476545r2=1476546view=diff
==
--- 
camel/branches/camel-2.11.x/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java
 (original)
+++ 
camel/branches/camel-2.11.x/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java
 Sat Apr 27 10:05:29 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.test.blueprint;
 
-import org.junit.Assert;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.model.ProcessorDefinition;
 import org.junit.Test;
@@ -27,9 +25,8 @@ import org.junit.Test;
 // and add your unit tests methods as shown below.
 public class DebugBlueprintTest extends CamelBlueprintTestSupport {
 
-public boolean wasDebugBeforeCalled = false;
-public boolean wasDebugAfterCalled = false;
-
+private boolean debugBeforeMethodCalled;
+private boolean debugAfterMethodCalled;
 
 // override this method, and return the location of our Blueprint XML file 
to be used for testing
 @Override
@@ -37,7 +34,7 @@ public class DebugBlueprintTest extends 
 return org/apache/camel/test/blueprint/camelContext.xml;
 }

-// here we have regular Junit @Test method
+// here we have regular JUnit @Test method
 @Test
 public void testRoute() throws Exception {
 
@@ -49,10 +46,11 @@ public class DebugBlueprintTest extends 
 
 // assert mocks
 assertMockEndpointsSatisfied();
-Assert.assertTrue(wasDebugBeforeCalled);
-Assert.assertTrue(wasDebugAfterCalled);
-}
 
+// assert on the debugBefore/debugAfter methods below being called as 
we've enabled the debugger
+assertTrue(debugBeforeMethodCalled);
+assertTrue(debugAfterMethodCalled);
+}
 
 @Override
 public boolean isUseDebugger() {
@@ -60,18 +58,16 @@ public class DebugBlueprintTest extends 
 return true;
 }
 
-
 @Override
 protected void debugBefore(Exchange exchange, org.apache.camel.Processor 
processor, ProcessorDefinition? definition, String id, String label) {
 log.info(Before  + definition +  with body  + 
exchange.getIn().getBody());
-wasDebugBeforeCalled = true;
+debugBeforeMethodCalled = true;
 }
 
-
 @Override
 protected void debugAfter(Exchange exchange, org.apache.camel.Processor 
processor, ProcessorDefinition? definition, String id, String label, long 
timeTaken) {
 log.info(After  + definition +  with body  + 
exchange.getIn().getBody());
-wasDebugAfterCalled = true;
+debugAfterMethodCalled = true;
 }
 }
 // END SNIPPET: example
\ No newline at end of file