THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Tests that use port numbers will fail if that port is already on use. AvailablePortFinder
provides methods for finding unused port numbers at runtime.
Code Block |
---|
// Get the next available port number starting from the default starting port of 1024 int port1 = AvailablePortFinder.getNextAvailable(); /* * Get another port. Note that just getting a port number does not reserverreserve it so * we look starting one past the last port number we got. */ int port2 = AvailablePortFinder.getNextAvailable(port1 + 1); |
Wiki Markup |
---|
{snippet:id=e1|lang=java|url=camel/trunk/components/camel-test/src/main/java/org/apache/camel/component/mina/MinaConsumerTest.java} |