You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Benjamin Graf (JIRA)" <ji...@apache.org> on 2012/09/14 08:35:07 UTC
[jira] [Created] (CAMEL-5611) Issue with JndiContext in camel tests
Benjamin Graf created CAMEL-5611:
------------------------------------
Summary: Issue with JndiContext in camel tests
Key: CAMEL-5611
URL: https://issues.apache.org/jira/browse/CAMEL-5611
Project: Camel
Issue Type: Bug
Components: camel-test
Affects Versions: 2.10.1
Reporter: Benjamin Graf
Priority: Minor
If you configure the jndiregistry in a unit test produced by
CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5611) Issue with JndiContext in camel tests
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-5611:
-------------------------------
Attachment: CAMEL-5611.patch
A patch in camel-core to return already created context.
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Bug
> Components: camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Priority: Minor
> Attachments: CAMEL-5611.patch, cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5611) Issue with JndiContext in camel
tests
Posted by "Benjamin Graf (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455744#comment-13455744 ]
Benjamin Graf commented on CAMEL-5611:
--------------------------------------
That's why I wrote the new class CamelInitialContextTestSupport to offer a second factory especially for unit testing. I never intended to patch the original CamelInitialContextFactory as has been done by your patch adaption.
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Bug
> Components: camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Priority: Minor
> Attachments: CAMEL-5611.patch, cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-5611) Issue with JndiContext in camel
tests
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-5611:
----------------------------------
Assignee: Claus Ibsen
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Bug
> Components: camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Assignee: Claus Ibsen
> Priority: Minor
> Attachments: CAMEL-5611.patch, cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5611) Issue with JndiContext in camel
tests
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455738#comment-13455738 ]
Claus Ibsen commented on CAMEL-5611:
------------------------------------
This is not yet an ideal patch, as static variables is *bad*. When you have multiple camel contexts in the JVM etc.
I think we can offer 2 kind of ctx factory. Then you can chose the ones you want. One with the static reference, which is more suited for unit testing.
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Bug
> Components: camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Priority: Minor
> Attachments: CAMEL-5611.patch, cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5611) Issue with JndiContext in camel tests
Posted by "Benjamin Graf (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Graf updated CAMEL-5611:
---------------------------------
Description: If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call. (was: If you configure the jndiregistry in a unit test produced by
CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.)
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Bug
> Components: camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Priority: Minor
> Attachments: cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5611) Issue with JndiContext in camel tests
Posted by "Benjamin Graf (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Graf updated CAMEL-5611:
---------------------------------
Attachment: cameljnditest.zip
Test Case with patch
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Bug
> Components: camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Priority: Minor
> Attachments: cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by
> CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5611) Issue with JndiContext in camel tests
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-5611:
-------------------------------
Component/s: camel-core
Issue Type: Improvement (was: Bug)
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Improvement
> Components: camel-core, camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.11.0
>
> Attachments: CAMEL-5611.patch, cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-5611) Issue with JndiContext in camel
tests
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-5611.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.11.0
Thanks for the patch.
I added a org.apache.camel.util.jndi.CamelSingletonInitialContextFactory to camel-core. Then in unit tests you can use that factory for the singleton use cases.
> Issue with JndiContext in camel tests
> -------------------------------------
>
> Key: CAMEL-5611
> URL: https://issues.apache.org/jira/browse/CAMEL-5611
> Project: Camel
> Issue Type: Bug
> Components: camel-core, camel-test
> Affects Versions: 2.10.1
> Reporter: Benjamin Graf
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.11.0
>
> Attachments: CAMEL-5611.patch, cameljnditest.zip
>
>
> If you configure the jndiregistry in a unit test produced by CamelInitialContextFactory via jndi.properties you'll always get a new empty JndiContext if any library or component in between does a new InitialContext() call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira