org.apache.james.mpt
Class ExternalHostSystem

java.lang.Object
  extended by org.apache.james.mpt.ExternalSessionFactory
      extended by org.apache.james.mpt.ExternalHostSystem
All Implemented Interfaces:
HostSystem, SessionFactory

public class ExternalHostSystem
extends ExternalSessionFactory
implements HostSystem

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 task suitable for this use case.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.james.mpt.HostSystem
HostSystem.Continuation
 
Field Summary
 
Fields inherited from class org.apache.james.mpt.ExternalSessionFactory
address, IMAP_SHABANG, monitor, shabang
 
Constructor Summary
ExternalHostSystem(java.lang.String host, int port, Monitor monitor, java.lang.String shabang, UserAdder userAdder)
          Constructs a host system suitable for connection to an open port.
 
Method Summary
 void addUser(java.lang.String user, java.lang.String password)
          Add a user for testing.
 
Methods inherited from class org.apache.james.mpt.ExternalSessionFactory
newSession, reset, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.james.mpt.HostSystem
reset
 
Methods inherited from interface org.apache.james.mpt.SessionFactory
newSession
 

Constructor Detail

ExternalHostSystem

public ExternalHostSystem(java.lang.String host,
                          int port,
                          Monitor monitor,
                          java.lang.String shabang,
                          UserAdder userAdder)
Constructs a host system suitable for connection to an open port.

Parameters:
host - host name that will be connected to, not null
port - port on host that will be connected to, not null
monitor - monitors the conduct of the connection
shabang - 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 replacement
userAdder - null when test system has appropriate users already set
Method Detail

addUser

public void addUser(java.lang.String user,
                    java.lang.String password)
             throws java.lang.Exception
Description copied from interface: HostSystem
Add a user for testing.

Specified by:
addUser in interface HostSystem
Parameters:
user - user name
password - user password
Throws:
java.lang.Exception


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.