This is the mail archive of the mauve-discuss@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tests with rmic


On Monday 17 October 2005 12:13, Nicolas Geoffray wrote:
> rmiregistry &
> jamvm ReceiveObjectImpl &
> jamvm Main
>
> Any suggestions?

Mauve style guidelines aside (because I have no idea what they would encourage 
here), I'd encourage you not to start the default rmiregistry in any test 
framework, as it creates a dependency on the runtime environment. 
(Specifically that whoever is running the testcase doesn't already have an 
rmi registry up.) Instead, I'd suggest that the ReceiveObjectImpl class binds 
your own registry to an off the wall port that you've selected, and then in 
the test case, you locate on that same port. This does create the problem 
that you'll have to pick a port that's not in use, one solution to that is to 
use a fallback pattern to select the port and write it to a file that the 
test case loads to find out where the registry is. Also, by creating the 
registry in the test server, you ensure that it goes away when the test is 
done. The test server should also have a dead man's switch to exit after a 
finite amount of time, otherwise you have to try to ensure some cleanup 
externally, and most of the ways I've seen of doing that have some *bad* side 
effects. (case in point at work, we have a few very large shared development 
machines, occasionally, folks would get failures in some of the test buckets 
they were running that just didn't make sense... further digging found a test 
case like this that wanted to clean up after itself, so it did a ps list and 
killed any task with it's name in it. This works fine as long as there is 
only one instance of the test suite running. Another routinely killed the 
snmpd on the system, because the test case fired up it's own with a unique 
config, on the default port, and then when the test failed because it was 
running iwht the wrong snmpd config, it blasted all instances of snmpd on the 
box.)  Anyway, client/server test cases usually need some extra thought put 
into them was my only point before I started rambling.

/me re-lurks now.

-- 
Never make a technical decision based upon the politics of the situation.
Never make a political decision based upon technical issues.
The only place these realms meet is in the mind of the unenlightened.
			-- Geoffrey James, The Zen of Programming


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]