You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2008/06/24 15:37:00 UTC
[jira] Created: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
SpringTestSupport - should support spring xml files loaded from file system
---------------------------------------------------------------------------
Key: CAMEL-633
URL: https://issues.apache.org/activemq/browse/CAMEL-633
Project: Apache Camel
Issue Type: Improvement
Components: camel-spring
Affects Versions: 1.4.0
Reporter: Claus Ibsen
Fix For: 1.5.0
Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
{code}
public class MyRouteTest extends SpringTestSupport {
protected ClassPathXmlApplicationContext createApplicationContext() {
return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
}
}
{code}
There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
Posted by "Jonathan Anstey (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44820#action_44820 ]
Jonathan Anstey commented on CAMEL-633:
---------------------------------------
Looking into this.
> SpringTestSupport - should support spring xml files loaded from file system
> ---------------------------------------------------------------------------
>
> Key: CAMEL-633
> URL: https://issues.apache.org/activemq/browse/CAMEL-633
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 1.4.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 1.5.0
>
>
> Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
> The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
> {code}
> public class MyRouteTest extends SpringTestSupport {
> protected ClassPathXmlApplicationContext createApplicationContext() {
> return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
> }
> }
> {code}
> There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
Posted by "Jonathan Anstey (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Anstey updated CAMEL-633:
----------------------------------
Attachment: useAbstractXmlAppContext.patch
With this patch you can use file based application contexts like:
{code:language=java}
public class MyRouteTest extends SpringTestSupport {
protected AbstractXmlApplicationContext createApplicationContext() {
return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
}
}
{code}
> SpringTestSupport - should support spring xml files loaded from file system
> ---------------------------------------------------------------------------
>
> Key: CAMEL-633
> URL: https://issues.apache.org/activemq/browse/CAMEL-633
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 1.4.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 1.5.0
>
> Attachments: useAbstractXmlAppContext.patch
>
>
> Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
> The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
> {code}
> public class MyRouteTest extends SpringTestSupport {
> protected ClassPathXmlApplicationContext createApplicationContext() {
> return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
> }
> }
> {code}
> There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-633:
------------------------------
Priority: Minor (was: Major)
> SpringTestSupport - should support spring xml files loaded from file system
> ---------------------------------------------------------------------------
>
> Key: CAMEL-633
> URL: https://issues.apache.org/activemq/browse/CAMEL-633
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 1.4.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 1.5.0
>
>
> Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
> The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
> {code}
> public class MyRouteTest extends SpringTestSupport {
> protected ClassPathXmlApplicationContext createApplicationContext() {
> return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
> }
> }
> {code}
> There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43684#action_43684 ]
Claus Ibsen commented on CAMEL-633:
-----------------------------------
You can do
{code}
protected ClassPathXmlApplicationContext createApplicationContext() {
ApplicationContext ctx = new FileSystemXmlApplicationContext(
"src/main/webapp/WEB-INF/helloworld.xml");
return new ClassPathXmlApplicationContext(ctx);
}
{code}
Lets see in Camel 1.5 if we can just let it accept an ApplicationContext
> SpringTestSupport - should support spring xml files loaded from file system
> ---------------------------------------------------------------------------
>
> Key: CAMEL-633
> URL: https://issues.apache.org/activemq/browse/CAMEL-633
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 1.4.0
> Reporter: Claus Ibsen
> Fix For: 1.5.0
>
>
> Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
> The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
> {code}
> public class MyRouteTest extends SpringTestSupport {
> protected ClassPathXmlApplicationContext createApplicationContext() {
> return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
> }
> }
> {code}
> There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-633.
-------------------------------
Resolution: Fixed
Applied patch with thanks to Jonathan.
> SpringTestSupport - should support spring xml files loaded from file system
> ---------------------------------------------------------------------------
>
> Key: CAMEL-633
> URL: https://issues.apache.org/activemq/browse/CAMEL-633
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 1.4.0
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 1.5.0
>
> Attachments: useAbstractXmlAppContext.patch
>
>
> Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
> The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
> {code}
> public class MyRouteTest extends SpringTestSupport {
> protected ClassPathXmlApplicationContext createApplicationContext() {
> return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
> }
> }
> {code}
> There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-633:
---------------------------------
Assignee: Claus Ibsen
> SpringTestSupport - should support spring xml files loaded from file system
> ---------------------------------------------------------------------------
>
> Key: CAMEL-633
> URL: https://issues.apache.org/activemq/browse/CAMEL-633
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 1.4.0
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 1.5.0
>
> Attachments: useAbstractXmlAppContext.patch
>
>
> Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
> The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
> {code}
> public class MyRouteTest extends SpringTestSupport {
> protected ClassPathXmlApplicationContext createApplicationContext() {
> return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
> }
> }
> {code}
> There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-633) SpringTestSupport - should support
spring xml files loaded from file system
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43686#action_43686 ]
Claus Ibsen commented on CAMEL-633:
-----------------------------------
The workaround above doens't work.
> SpringTestSupport - should support spring xml files loaded from file system
> ---------------------------------------------------------------------------
>
> Key: CAMEL-633
> URL: https://issues.apache.org/activemq/browse/CAMEL-633
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 1.4.0
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 1.5.0
>
>
> Now you must use ClassPath based xml files as Camel expects a ClassPathXmlApplicationContext.
> The code below is not possible, but desired for unit testing camel projects where spring configuration resides in WEB-INF and not on the classpath etc.
> {code}
> public class MyRouteTest extends SpringTestSupport {
> protected ClassPathXmlApplicationContext createApplicationContext() {
> return new FileSystemXmlApplicationContext("src/main/webapp/WEB-INF/helloworld.xml");
> }
> }
> {code}
> There must be a common spring interface we can return in createApplicationContext instead of the classpath based.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.