public class DynamicPort extends SystemProperty
@Rule
public DynamicPort serverPort = new DynamicPort("server_port");
In order to use static dynamic ports:
@ClassRule
public static DynamicPort dynamicPort = new DynamicPort("server_port");
| Modifier and Type | Field and Description |
|---|---|
protected static FreePortFinder |
freePortFinder |
static String |
MAX_PORT_SYSTEM_PROPERTY |
static String |
MIN_PORT_SYSTEM_PROPERTY |
initialized, value| Constructor and Description |
|---|
DynamicPort(String name)
Creates a dynamic port resource for a given port name.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doCleanUp() |
int |
getNumber() |
String |
getValue() |
after, before, callWithProperty, getName, restoreOldValuepublic static final String MIN_PORT_SYSTEM_PROPERTY
public static final String MAX_PORT_SYSTEM_PROPERTY
protected static FreePortFinder freePortFinder
public DynamicPort(String name)
name - the name assigned to the port number. On resource creation a new system property will be created with that name
and the value will be the port number.public String getValue()
getValue in class SystemPropertyprotected void doCleanUp()
doCleanUp in class SystemPropertypublic int getNumber()
Copyright © 2003–2022 MuleSoft, Inc.. All rights reserved.