Package org.apache.camel.test
Class AvailablePortFinderPropertiesFunction
- java.lang.Object
-
- org.apache.camel.test.AvailablePortFinderPropertiesFunction
-
- All Implemented Interfaces:
org.apache.camel.spi.PropertiesFunction
@Deprecated public class AvailablePortFinderPropertiesFunction extends Object implements org.apache.camel.spi.PropertiesFunction
Deprecated.APropertiesFunctionthat reserves network ports and place them in a cache for reuse. The first time the function is invoked for a given name, an unused network port is determined and cached in an hash map with the given name as key so each time this function is invoked for the same name, the previously discovered port will be returned. This is useful for testing purpose where you can write a route like:
And then you can invoke withfrom("undertow:http://0.0.0.0:{{available-port:server-port}}") .to("mock:result");ProducerTemplatelike:
Doing so avoid the need to compute the port and pass it to the various method or store it as a global variable in the test class.template.sendBody("undertow:http://0.0.0.0:{{available-port:server-port}}", "the body");- See Also:
AvailablePortFinder
-
-
Constructor Summary
Constructors Constructor Description AvailablePortFinderPropertiesFunction()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stringapply(String remainder)Deprecated.StringgetName()Deprecated.
-