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.2.3 2003/10/23 18:20:43 vmassol 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.
 long getStartUpWait()
           
 org.apache.tools.ant.types.Environment.Variable[] getSystemProperties()
           
 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(DeployableFile 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 setStartUpWait(long theStartUpWait)
          Sets the time to wait after the container has been started up.
 void setSystemProperties(org.apache.tools.ant.types.Environment.Variable[] theProperties)
          Sets the system properties that will be passed to the JVM in which the server will execute.
 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

setStartUpWait

public void setStartUpWait(long theStartUpWait)
Sets the time to wait after the container has been started up. The default time is 1 second. Note: This is a hack while waiting for container specific solutions that tell exactly when the server is started or not. ATM, the only known issue is with JBoss, where the servlet engine is started before the full JBoss is started and thus it may happen that we try to shutdown JBoss before it has finished starting, leading to an exception.

Parameters:
theStartUpWait - The time to wait in milliseconds

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

getStartUpWait

public long getStartUpWait()
Specified by:
getStartUpWait in interface Container
Returns:
the time to wait after the container has been started up.
See Also:
Container.getStartUpWait()

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(DeployableFile 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(org.apache.cactus.integration.ant.container.DeployableFile)

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)

setSystemProperties

public void setSystemProperties(org.apache.tools.ant.types.Environment.Variable[] theProperties)
Description copied from interface: Container
Sets the system properties that will be passed to the JVM in which the server will execute.

Specified by:
setSystemProperties in interface Container
Parameters:
theProperties - the list of system properties to set in the container JVM
See Also:
Container.setSystemProperties(org.apache.tools.ant.types.Environment.Variable[])

getSystemProperties

public org.apache.tools.ant.types.Environment.Variable[] getSystemProperties()
Specified by:
getSystemProperties in interface Container
Returns:
the list of system properties that will be set in the container JVM
See Also:
Container.getSystemProperties()


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