Thanks everyone for your time and the comments.
"ALRubinger" wrote : * Constants like SERVER_STARTING should be marked "final"?
Agreed. That was my silly mistake.
"ALRubinger" wrote :
| * MockServerMonitor has hardcoded "localhost" used by the ServerSocket. If we've gotta specify a port, might as well specify a host bind address (to bind to 2 unique hosts using same port for example)
|
Sure, will change it to allow the host bind address to be a parameter.
I'll consider the rest of the comments too:
- Not good OO pratice
- Chances of the test case waiting indefinitely
- The static instance of MockServer in itself.
Thanks again, for the inputs :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187213#4187213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187213
Then I prefer leaving the dependencies as is, because we cannot and (don't want) to guarantee server-manager will run within the AS test suite only.
Moreover jboss-test depends on server-manager so there will be possible problems with the "provided" scope.
One possible improvement to server-manager would be to use the versions specified in component-matrix.pom but
1. I don't know how to do it without pulling in the dependencies from it
2. Why is JBoss AS using junit 3.8.2-brew !?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187202#4187202
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187202
"ALRubinger" wrote : * In MockServerMonitor.waitForServerStartup(), there's a "while not started" loop. Let's throw a Thread.sleep(100) or something in there as to relax the CPU a bit
|
| * RemoteAccessTestCase now has "mockServerMonitor.waitForServerStartup();", which will block indefinitely - what if server does not start? Recommend making a "private volatile boolean remoteServerStarted" field, spawning off the check to "waitForServerStartup" into a j.u.c.FutureTask, and then call "getResult()" on it with a sensible timeout value. The FutureTask's job would be to set the "remoteServerStarted" to true, and then the RemoteAccessTestCase can poll for that. In the case of a timeout of the FutureTask, throw an exception and fail the test
This has nothing to do with CPU, it's a blocking I/O case.
Use NIO or Remoting 3 here.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187195#4187195
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187195