com.googlecode.lightest.core
Class TestEnvironment

java.lang.Object
  extended by com.googlecode.lightest.core.TestEnvironment
All Implemented Interfaces:
ITestEnvironment, groovy.lang.GroovyObject, Cloneable

public class TestEnvironment
extends Object
implements groovy.lang.GroovyObject, ITestEnvironment

A convenient base class for defining custom test environments. Subclasses should only add simple property value definitions - i.e. Date, String, etc.


Constructor Summary
TestEnvironment()
           
TestEnvironment(String id)
           
 
Method Summary
 String getId()
          Returns a unique identifier for the environment
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String name)
           
 void initializeProperties(groovy.util.Node config)
          Sets properties of the environment based on a Node configuration, whose child Nodes contain name-value pairs, retrievable by name() and value(), respectively.
 Object invokeMethod(String name, Object args)
           
 void setId(String value)
           
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
 Map settings()
          Returns a map of setting names to their values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestEnvironment

public TestEnvironment()

TestEnvironment

public TestEnvironment(String id)
Method Detail

getId

public String getId()
Description copied from interface: ITestEnvironment
Returns a unique identifier for the environment

Specified by:
getId in interface ITestEnvironment

setId

public void setId(String value)
Specified by:
setId in interface ITestEnvironment

settings

public Map settings()
Description copied from interface: ITestEnvironment
Returns a map of setting names to their values. This collection excludes Groovy MOP properties, as well as the id. This method name is not prefixed with "get" to make the implementation easier.

Specified by:
settings in interface ITestEnvironment

initializeProperties

public void initializeProperties(groovy.util.Node config)
Sets properties of the environment based on a Node configuration, whose child Nodes contain name-value pairs, retrievable by name() and value(), respectively. This is chiefly useful for later enumerating properties initialized in this way in the same order they were specified, i.e. by calling settings().

Parameters:
config -

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject


Copyright © 2009. All Rights Reserved.