org.apache.cactus.integration.ant.container
Class AbstractContainer

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.cactus.integration.ant.container.AbstractContainer
All Implemented Interfaces:
Container
Direct Known Subclasses:
AbstractJavaContainer, GenericContainer

public abstract class AbstractContainer
extends org.apache.tools.ant.ProjectComponent
implements Container

Abstract base class for supporting specific containers as nested elements in the CactusTask.

Version:
$Id: AbstractContainer.java,v 1.6 2003/06/11 16:17:26 cmlenz Exp $
Author:
Christopher Lenz

Constructor Summary
AbstractContainer()
           
 
Method Summary
 org.apache.tools.ant.types.PatternSet.NameEntry createExclude()
          Creates a nested exclude element that is added to the pattern set.
 java.lang.String[] getExcludePatterns()
          Returns the exclude patterns.
 java.io.File getToDir()
          Returns the value of the 'todir' attribute.
 void init()
          The default implementation does nothing.
 boolean isEnabled()
          Returns whether the container element is enabled, which is determined by the evaluation of the if- and unless conditions
 boolean isExcluded(java.lang.String theTestName)
          Returns whether a specific test case is to be excluded from being run in the container.
 void setAntTaskFactory(AntTaskFactory theFactory)
          Sets the factory to use for creating Ant tasks.
 void setDeployableFile(java.io.File theDeployableFile)
          Sets the file that should be deployed to the container.
 void setIf(java.lang.String theIfCondition)
          Sets the name of a property that must exist in the project if tests are to be run on the container.
 void setLog(org.apache.commons.logging.Log theLog)
          Sets the log which the implementation should use.
 void setToDir(java.io.File theToDir)
          Sets the directory to which the test reports should be written.
 void setUnless(java.lang.String theUnlessCondition)
          Sets the name of a property that must not exist in the project if tests are to be run on the container.
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, log, log, setProject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cactus.integration.ant.container.Container
getName, getPort, shutDown, startUp
 

Constructor Detail

AbstractContainer

public AbstractContainer()
Method Detail

createExclude

public final org.apache.tools.ant.types.PatternSet.NameEntry createExclude()
Creates a nested exclude element that is added to the pattern set.

Returns:
The created exclude element

getExcludePatterns

public final java.lang.String[] getExcludePatterns()
Returns the exclude patterns.

Returns:
The exclude patterns

setIf

public final void setIf(java.lang.String theIfCondition)
Sets the name of a property that must exist in the project if tests are to be run on the container.

Parameters:
theIfCondition - The property name to set

setToDir

public final void setToDir(java.io.File theToDir)
Sets the directory to which the test reports should be written.

Parameters:
theToDir - The output directory to set

setUnless

public final void setUnless(java.lang.String theUnlessCondition)
Sets the name of a property that must not exist in the project if tests are to be run on the container.

Parameters:
theUnlessCondition - The property name to set

getToDir

public final java.io.File getToDir()
Description copied from interface: Container
Returns the value of the 'todir' attribute.

Specified by:
getToDir in interface Container
Returns:
The output directory
See Also:
Container.getToDir()

init

public void init()
The default implementation does nothing.

Specified by:
init in interface Container
See Also:
Container.init()

isEnabled

public final boolean isEnabled()
Description copied from interface: Container
Returns whether the container element is enabled, which is determined by the evaluation of the if- and unless conditions

Specified by:
isEnabled in interface Container
Returns:
true if the container is enabled
See Also:
Container.isEnabled()

isExcluded

public final boolean isExcluded(java.lang.String theTestName)
Description copied from interface: Container
Returns whether a specific test case is to be excluded from being run in the container.

Specified by:
isExcluded in interface Container
Parameters:
theTestName - The fully qualified name of the test fixture class
Returns:
true if the test should be excluded, otherwise false
See Also:
Container.isExcluded(java.lang.String)

setAntTaskFactory

public final void setAntTaskFactory(AntTaskFactory theFactory)
Description copied from interface: Container
Sets the factory to use for creating Ant tasks.

Specified by:
setAntTaskFactory in interface Container
Parameters:
theFactory - The factory to use for creating Ant tasks
See Also:
Container.setAntTaskFactory(org.apache.cactus.integration.ant.util.AntTaskFactory)

setDeployableFile

public final void setDeployableFile(java.io.File theDeployableFile)
Description copied from interface: Container
Sets the file that should be deployed to the container. This can be either a WAR or an EAR file, depending on the capabilities of the container.

Specified by:
setDeployableFile in interface Container
Parameters:
theDeployableFile - The file to deploy
See Also:
Container.setDeployableFile(java.io.File)

setLog

public final void setLog(org.apache.commons.logging.Log theLog)
Description copied from interface: Container
Sets the log which the implementation should use.

Specified by:
setLog in interface Container
Parameters:
theLog - The log to set
See Also:
Container.setLog(org.apache.commons.logging.Log)


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.