Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321788 - [RemoteSrvs][JMS] Use embedded broken to avoid separate VM
Summary: [RemoteSrvs][JMS] Use embedded broken to avoid separate VM
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.test (show other bugs)
Version: 3.3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.4.0   Edit
Assignee: Markus Kuppe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 15:55 EDT by Markus Kuppe CLA
Modified: 2010-08-06 01:55 EDT (History)
1 user (show)

See Also:


Attachments
mylyn/context/zip (7.78 KB, application/octet-stream)
2010-08-04 17:14 EDT, Markus Kuppe CLA
no flags Details
mylyn/context/zip (1.63 KB, application/octet-stream)
2010-08-06 01:55 EDT, Markus Kuppe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Kuppe CLA 2010-08-04 15:55:15 EDT
When unit testing code with JMS you'll typically want to avoid the overhead of running separate proceses; plus you'll want to increase startup time as fast as possible as you tend to run unit tests often and want immediate feedback. Also persistence can often cause problems - as previous test case results can adversely affect future test case runs - so you often need to purge queues on startup. [0]

[0] http://activemq.apache.org/how-to-unit-test-jms-code.html
Comment 1 Scott Lewis CLA 2010-08-04 16:15:44 EDT
(In reply to comment #0)
> When unit testing code with JMS you'll typically want to avoid the overhead of
> running separate proceses; plus you'll want to increase startup time as fast as
> possible as you tend to run unit tests often and want immediate feedback. Also
> persistence can often cause problems - as previous test case results can
> adversely affect future test case runs - so you often need to purge queues on
> startup. [0]
> 
> [0] http://activemq.apache.org/how-to-unit-test-jms-code.html


Two points:

1) Having everything in one process (including broker) may be easier, but it also results in less useful testing...since the timing and graceful handling of failure in inter-process communication is frequently the 'hard part' of testing remote services...and the timing and failure of things is affected significantly by not having separate processes.

2) We don't currently have an embedded broker container.  It would probably be fairly simple to create given the instructions on [1], but we don't have it.  Further, it would/will likely require a number of third party libs (that activemq depends upon)...and should probably be therefore introduced via a new bundle so as not burden the org.eclipse.ecf.provider.jms.activemq bundle with more/larger code.
Comment 2 Markus Kuppe CLA 2010-08-04 17:14:37 EDT
(In reply to comment #1)
 
> 1) Having everything in one process (including broker) may be easier, but it
> also results in less useful testing...since the timing and graceful handling of
> failure in inter-process communication is frequently the 'hard part' of testing
> remote services...and the timing and failure of things is affected
> significantly by not having separate processes.

In the long run I totally agree with you. Eventually we definitely want to test ECF providers under real world conditions. But as long as we don't have a full featured test bed (e.g. simulating network outages), running tests in separate VMs IMO causes more problems/work than what it buys us. I see the current tests more like API tests/verification.

> 2) We don't currently have an embedded broker container.  It would probably be
> fairly simple to create given the instructions on [1], but we don't have it. 
> Further, it would/will likely require a number of third party libs (that
> activemq depends upon)...and should probably be therefore introduced via a new
> bundle so as not burden the org.eclipse.ecf.provider.jms.activemq bundle with
> more/larger code.

From my local tests it looks like we just have to change org.eclipse.ecf.tests.provider.jms.activemq.ActiveMQ.TARGET_NAME to "vm://localhost/?broker.persistent=false". No extra jars no nothing. Anyway, for the moment I simply switched to a system property and overwrite the standalone URL with the embedded one in the new .launch. Better than no tests at all. :)
Comment 3 Markus Kuppe CLA 2010-08-04 17:14:40 EDT
Created attachment 175890 [details]
mylyn/context/zip
Comment 4 Markus Kuppe CLA 2010-08-06 01:55:09 EDT
Added jSLP discovery container to build deps
Comment 5 Markus Kuppe CLA 2010-08-06 01:55:11 EDT
Created attachment 175999 [details]
mylyn/context/zip