On JBossMessaging we have a super class where we use setUp and tearDown to synchronize server and client logs.
It is true though we aways call super.tearDown and super.setUp in all sub classes. Maybe it's possible to do the same thing with some double check on sub-classes.
I don't know how this would behave with deployment setups from JBossTestCase, but it is a good idea to at least have the className on server side logs.
but given that it would only be used with the testsuite, this may not lead to a great saving
In my personal opinion this would be a nice thing to have, if this can be done without breaking other stuff.
This sounds like a nice solution. Understanding testsuite server logs has always been difficult b ecause there was no correlation.
This should definitely be on by default for every test suite run. I see no reason why you wouldn't want this information.
I guess this is the kind of thing that when we think about it we wonder why nobody has done it before :-)
Ok enough hugs & kisses. Let's see some code!
A long time ago, I wrote an aspect that lets you pull down the logging
done on your server side thread and dump it in the client log:
Its basically just a log4j plugin. ThreadLocalAppender
Of course this assumes you are using AOP Remoting to make the request
so it piggy back the log records in the InvocationResponse.
Richard, this should probably be implemented using setUp() and tearDown() which, as per the contract, will be called for each test* method.
FYI, for reading the free memory on the server there is the jboss.system:type=ServerInfo mbean.
For the total heap space, it has the following attributes:
FreeMemory (total - used)
TotalMemory (i.e. currently committed memory)
But there is also the listMemoryPools(true/false) operation to give you the same information displayed by JConsole.