"rachmatowicz(a)jboss.com" wrote :
| All in all, I am in favour of using a simpler approach, based on the simplified scheme
described above, where test cases
| continue to sublass from JBossTestCase
|
No the point is to write unit tests. You are not testing JBoss integration!
The tests should be written against the microcontainer:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=76657
I said this should be based on a JMSAdmin like the JORAM tests.
Not that it should use the JORAM admin implementation.
Once we have our own admin implementation, the JORAM tests
can use that as a delegate.
The general outline should be something like:
// A base class
| public abstract class AbstractJMSTest extends MicrocontainerTest
| {
| /**
| * Get the delegate
| *
| * @return the delegate
| */
| protected JMSTestDelegate getJMSDelegate()
| {
| return (JMSTestDelegate) getDelegate();
| }
|
| // helper methods that delegate/admin
| }
|
// The delegate that encapsulates the admin/implementation
| public class JMSTestDelegate extends MicrocontainerTestDelegate
| {
| static JMSAdmin admin;
|
| static
| {
| // Possible rules
| // 1) Look at system property
| // 2) Is JBoss Messaging in the classpath
| // 3) Is JBossMQ in the classpath
| admin = initialiseAdmin();
| }
| }
|
// Real tests just use the infrastructure
| public class RealTest extends AbstractJMSTest
| {
| public void testSomething()
| {
| ConnectionFactory cf = super.getConnectionFactory();
| Queue queue = super.createQueue("something");
| ...
| }
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975119#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...