Class EphemeralPorts
java.lang.Object
org.terracotta.utilities.test.net.EphemeralPorts
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classstatic classprivate static interfaceprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final EphemeralPorts.Rangeprivate static final org.slf4j.Loggerprivate static EphemeralPorts.Range -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecute a command and return anIterablewith all response lines.private static PropertiesasProperties(String... cmd) Execute a command and return aPropertiesinstance composed from the output.private static EphemeralPorts.Rangeprivate static StringExecute a command and return the first response line.static EphemeralPorts.RangegetRange()static void
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
IANA_DEFAULT_RANGE
-
range
-
-
Constructor Details
-
EphemeralPorts
public EphemeralPorts()
-
-
Method Details
-
getRange
-
findRange
-
firstLine
Execute a command and return the first response line.- Parameters:
cmd- the command to execute- Returns:
- the first response line
- Throws:
IndexOutOfBoundsException- if the command response is emptyIOException- if an error is encountered while executing the command
-
allLines
Execute a command and return anIterablewith all response lines.- Parameters:
cmd- the command to execute- Returns:
- an
Iterableover all response lines - Throws:
IOException- if an error is encountered while executing the command
-
asProperties
Execute a command and return aPropertiesinstance composed from the output.- Parameters:
cmd- the command to execute- Returns:
- a new
Propertiesinstance - Throws:
IOException- if an error is encountered while executing the command or loading thePropertiesinstance
-
main
-