org.apache.james.mpt.ant
Class MailProtocolTestTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.james.mpt.ant.MailProtocolTestTask
All Implemented Interfaces:
java.lang.Cloneable, Monitor

public class MailProtocolTestTask
extends org.apache.tools.ant.Task
implements Monitor

Task executes MPT scripts against a server running on a given port and host.


Nested Class Summary
 class MailProtocolTestTask.AddUser
          Adds a user.
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
MailProtocolTestTask()
           
 
Method Summary
 void add(org.apache.tools.ant.types.ResourceCollection resources)
           
 MailProtocolTestTask.AddUser createAddUser()
           
 void debug(char character)
           
 void debug(java.lang.String message)
           
 void execute()
           
 java.lang.String getErrorProperty()
          Gets the error property.
 java.lang.String getHost()
          Gets the host (either name or number) against which this test will run.
 int getPort()
          Gets the port against which this test will run.
 java.io.File getScript()
          Gets the script to execute.
 java.lang.String getShabang()
          Gets script shabang.
 boolean isQuiet()
          Should progress output be suppressed?
 boolean isSkip()
          Should the execution be skipped?
 void note(java.lang.String message)
           
 void setErrorProperty(java.lang.String errorProperty)
          Sets the error property.
 void setHost(java.lang.String host)
          Sets the host (either name or number) against which this test will run.
 void setPort(int port)
          Sets the port aginst which this test will run.
 void setQuiet(boolean quiet)
          Sets whether progress output should be suppressed/
 void setScript(java.io.File script)
          Sets the script to execute.
 void setShabang(java.lang.String shabang)
          Sets the script shabang.
 void setSkip(boolean skip)
          Sets execution skipping.
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailProtocolTestTask

public MailProtocolTestTask()
Method Detail

getErrorProperty

public java.lang.String getErrorProperty()
Gets the error property.

Returns:
name of the ant property to be set on error, null if the script should terminate on error

setErrorProperty

public void setErrorProperty(java.lang.String errorProperty)
Sets the error property.

Parameters:
errorProperty - name of the ant property to be set on error, nul if the script should terminate on error

isQuiet

public boolean isQuiet()
Should progress output be suppressed?

Returns:
true if progress information should be suppressed, false otherwise

setQuiet

public void setQuiet(boolean quiet)
Sets whether progress output should be suppressed/

Parameters:
quiet - true if progress information should be suppressed, false otherwise

isSkip

public boolean isSkip()
Should the execution be skipped?

Returns:
true if exection should be skipped, otherwise false

setSkip

public void setSkip(boolean skip)
Sets execution skipping.

Parameters:
skip - true to skip excution

getHost

public java.lang.String getHost()
Gets the host (either name or number) against which this test will run.

Returns:
host, not null

setHost

public void setHost(java.lang.String host)
Sets the host (either name or number) against which this test will run.

Parameters:
host - not null

getPort

public int getPort()
Gets the port against which this test will run.

Returns:
port number

setPort

public void setPort(int port)
Sets the port aginst which this test will run.

Parameters:
port - port number

getScript

public java.io.File getScript()
Gets the script to execute.

Returns:
file containing test script

setScript

public void setScript(java.io.File script)
Sets the script to execute.

Parameters:
script - not null

getShabang

public java.lang.String getShabang()
Gets script shabang. This will be substituted for the first server response.

Returns:
script shabang, or null for no shabang

setShabang

public void setShabang(java.lang.String shabang)
Sets the script shabang. When not null, this value will be used to be substituted for the first server response.

Parameters:
shabang - script shabang, or null for no shabang.

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

add

public void add(org.apache.tools.ant.types.ResourceCollection resources)

createAddUser

public MailProtocolTestTask.AddUser createAddUser()

note

public void note(java.lang.String message)
Specified by:
note in interface Monitor

debug

public void debug(char character)
Specified by:
debug in interface Monitor

debug

public void debug(java.lang.String message)
Specified by:
debug in interface Monitor


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