public class RandomPortServerSetup
extends com.icegreen.greenmail.util.ServerSetup
ServerSetup
to handle random port.
Range (min and max port numbers) must be specified.ALL, CONNECTION_TIMEOUT, IMAP, IMAPS, POP3, POP3S, PORT_IMAP, PORT_IMAPS, PORT_POP3, PORT_POP3S, PORT_SMTP, PORT_SMTPS, PROTOCOL_IMAP, PROTOCOL_IMAPS, PROTOCOL_POP3, PROTOCOL_POP3S, PROTOCOL_SMTP, PROTOCOL_SMTPS, PROTOCOLS, READ_TIMEOUT, SERVER_STARTUP_TIMEOUT, SMTP, SMTP_IMAP, SMTP_POP3, SMTP_POP3_IMAP, SMTPS, SMTPS_IMAPS, SMTPS_POP3S, SMTPS_POP3S_IMAPS
Constructor and Description |
---|
RandomPortServerSetup(int minPort,
int maxPort,
String protocol)
Initialize the range of ports for a particular protocol.
|
RandomPortServerSetup(int minPort,
int maxPort,
String bindAddress,
String protocol)
Initialize the range of ports for a particular protocol.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getPort() |
int |
hashCode() |
void |
resetPort()
Add possibility to reset port in order to reuse the same server instance
and configuration on different port when restarted.
|
configureJavaMailSessionProperties, createCopy, createCopy, createCopy, dynamicPort, dynamicPort, getBindAddress, getConnectionTimeout, getDefaultBindAddress, getLocalHostAddress, getProtocol, getReadTimeout, getServerStartupTimeout, getWriteTimeout, isDynamicPort, isSecure, isVerbose, setConnectionTimeout, setReadTimeout, setServerStartupTimeout, setVerbose, setWriteTimeout, toString, verbose, withPort
public RandomPortServerSetup(int minPort, int maxPort, String protocol)
"127.0.0.1"
defined by
ServerSetup
).minPort
- the minimum port valuemaxPort
- the maximum port valueprotocol
- the protocolpublic RandomPortServerSetup(int minPort, int maxPort, String bindAddress, String protocol)
null
can be specified to use default bind
address).minPort
- the minimum port valuemaxPort
- the maximum port valuebindAddress
- the bind addressprotocol
- the protocolpublic int getPort()
getPort
in class com.icegreen.greenmail.util.ServerSetup
public void resetPort()
public boolean equals(Object obj)
equals
in class com.icegreen.greenmail.util.ServerSetup
public int hashCode()
hashCode
in class com.icegreen.greenmail.util.ServerSetup
Copyright © 2021. All rights reserved.