Build test fixes

Three fixes for tests that are constantly failing under CI.

This test is wrong. If you use a dynamic port, then the chances of finding an open socket listening its almost zero.
The problem, is that this test is not testing anything.
1099 is the default port used for the RMI registry agent, to what needs to be dynamic is that port, so you can have multiple opened sockets without no problem