public class ExternalHostSystem extends ExternalSessionFactory implements ImapHostSystem
Connects to a host system serving on an open port.
This is typically used for functional integration testing of a complete server system (including sockets). Apache James MPT AntLib provides an Ant task suitable for this use case.
address, IMAP_SHABANG, monitor, shabang
Constructor and Description |
---|
ExternalHostSystem(ImapFeatures features,
Monitor monitor,
String shabang,
UserAdder userAdder) |
ExternalHostSystem(ImapFeatures features,
String host,
int port,
Monitor monitor,
String shabang,
UserAdder userAdder)
Constructs a host system suitable for connection to an open port.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addUser(String user,
String password)
Add a user for testing.
|
void |
afterTest() |
void |
afterTests() |
void |
beforeTest() |
void |
beforeTests() |
void |
createMailbox(org.apache.james.mailbox.model.MailboxPath mailboxPath) |
void |
setQuotaLimits(long maxMessageQuota,
long maxStorageQuota) |
boolean |
supports(ImapFeatures.Feature... features) |
getAddress, newSession, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
newSession
public ExternalHostSystem(ImapFeatures features, String host, int port, Monitor monitor, String shabang, UserAdder userAdder)
features
- set of features supported by the systemhost
- host name that will be connected to, not nullport
- port on host that will be connected to, not nullmonitor
- monitors the conduct of the connectionshabang
- protocol shabang will be sent to the script test in the place
of the first line received from the server. Many protocols
pass server specific information in the first line. When not
null, this line will be replaced. Or null when the first line
should be passed without replacementuserAdder
- null when test system has appropriate users already setpublic ExternalHostSystem(ImapFeatures features, Monitor monitor, String shabang, UserAdder userAdder)
public boolean addUser(String user, String password) throws Exception
HostSystem
addUser
in interface HostSystem
user
- user namepassword
- user passwordException
public void createMailbox(org.apache.james.mailbox.model.MailboxPath mailboxPath) throws Exception
createMailbox
in interface ImapHostSystem
Exception
public void beforeTests() throws Exception
beforeTests
in interface HostSystem
Exception
public void afterTests() throws Exception
afterTests
in interface HostSystem
Exception
public void beforeTest() throws Exception
beforeTest
in interface HostSystem
Exception
public void afterTest() throws Exception
afterTest
in interface HostSystem
Exception
public boolean supports(ImapFeatures.Feature... features)
supports
in interface ImapHostSystem
public void setQuotaLimits(long maxMessageQuota, long maxStorageQuota) throws Exception
setQuotaLimits
in interface ImapHostSystem
Exception
Copyright © 2008-2017 The Apache Software Foundation. All Rights Reserved.