[Design of Messaging on JBoss (Messaging/JBoss)] - ProxyAssertSupport
by clebert.suconic@jboss.com
I have added ProxyAssertSupport into org.jboss.test.messaging.util.
If you want to enable it... you could just change MessagingTestCase to extend ProxyAssertSupport instead of TestCase.
This class make it easier to analyze log traces...
For example:
Before the AssertProxy:
| 17:29:59,574 TRACE @main [MessageCallbackHandler] MessageCallbackHandler[11] receive() returning delegator->JBossMessage[4101]:PERSISTENT
| 17:29:59,574 TRACE @main [ClientLogInterceptor] ConsumerDelegate[15886558, ID=11].receive() returned delegator->JBossMessage[4101]:PERSISTENT
| 17:29:59,574 INFO @main [MergeQueueTest] msg = message 15
| 17:29:59,581 TRACE @main [ClientLogInterceptor] invoking ConnectionDelegate[17456161, ID=5, SID=0].closing()
| 17:29:59,581 TRACE @main [ClientLogInterceptor] invoking SessionDelegate[10163824, ID=6].closing()
| 17:29:59,581 TRACE @main [ClientLogInterceptor] invoking ConsumerDelegate[15886558, ID=11].closing()
|
After:
| 17:29:59,574 TRACE @main [MessageCallbackHandler] MessageCallbackHandler[11] receive() returning delegator->JBossMessage[4101]:PERSISTENT
| 17:29:59,574 TRACE @main [ClientLogInterceptor] ConsumerDelegate[15886558, ID=11].receive() returned delegator->JBossMessage[4101]:PERSISTENT
| 17:29:59,574 INFO @main [MergeQueueTest] msg = message 15
| 17:29:59,576 WARN @main [ProxyAssertSupport] AssertionFailure::junit.framework.ComparisonFailure: expected:<......> but was:<...1...>
| junit.framework.ComparisonFailure: expected:<......> but was:<...1...>
| at junit.framework.Assert.assertEquals(Assert.java:81)
| at junit.framework.Assert.assertEquals(Assert.java:87)
| at org.jboss.test.messaging.util.ProxyAssertSupport.assertEquals(ProxyAssertSupport.java:165)
| at org.jboss.test.messaging.jms.clustering.MergeQueueTest.testMergeQueue2(MergeQueueTest.java:220)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:324)
| at junit.framework.TestCase.runTest(TestCase.java:154)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at junit.framework.TestSuite.runTest(TestSuite.java:208)
| at junit.framework.TestSuite.run(TestSuite.java:203)
| at junit.textui.TestRunner.doRun(TestRunner.java:116)
| at junit.textui.TestRunner.start(TestRunner.java:172)
| at org.jboss.test.messaging.tools.junit.SelectiveTestRunner.main(SelectiveTestRunner.java:58)
| 17:29:59,581 TRACE @main [ClientLogInterceptor] invoking ConnectionDelegate[17456161, ID=5, SID=0].closing()
| 17:29:59,581 TRACE @main [ClientLogInterceptor] invoking SessionDelegate[10163824, ID=6].closing()
| 17:29:59,581 TRACE @main [ClientLogInterceptor] invoking ConsumerDelegate[15886558, ID=11].closing()
|
With the first example you would require more time to identify where the test failed.. making it more visible and find bugs on the testsuite.
I didn't commit the change on MessagingTestCase though.. You can try this yourself and if everybody likes it we could make it permanent.. or just give up the idea.
Clebert
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023382#4023382
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023382
17 years, 10 months