junit.extensions
Class ConfigurableTestSetup

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.extensions.TestDecorator
              |
              +--junit.extensions.TestSetup
                    |
                    +--junit.extensions.ConfigurableTestSetup
All Implemented Interfaces:
ConfigurableTest, junit.framework.Test

public class ConfigurableTestSetup
extends TestSetup
implements ConfigurableTest

A Decorator to set up and tear down additional fixture state using configuration.

Author:
Siegfried GOESCHL, Dima STADNIK

Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
ConfigurableTestSetup(junit.framework.Test test)
          Creates test setup instance.
 
Method Summary
 boolean getBoolean(java.lang.String key)
          Retrieves boolean number from configuration.
 byte getByte(java.lang.String key)
          Retrieves byte from configuration.
 char getChar(java.lang.String key)
          Retrieves character from configuration.
protected  Configuration getConfiguration()
          Retrieves configuration of this test case.
 double getDouble(java.lang.String key)
          Retrieves double number from configuration.
 float getFloat(java.lang.String key)
          Retrieves float number from configuration.
 int getInteger(java.lang.String key)
          Retrieves integer number from configuration.
 long getLong(java.lang.String key)
          Retrieves long number from configuration.
 short getShort(java.lang.String key)
          Retrieves short number from configuration.
 java.lang.String getString(java.lang.String key)
          Retrieves string from configuration.
 java.lang.String[] getStrings(java.lang.String key)
          Retrieves array of strings from configuration.
 
Methods inherited from class junit.extensions.TestSetup
run, setUp, tearDown
 
Methods inherited from class junit.extensions.TestDecorator
basicRun, countTestCases, getTest, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface junit.framework.Test
countTestCases, run
 

Constructor Detail

ConfigurableTestSetup

public ConfigurableTestSetup(junit.framework.Test test)
Creates test setup instance.
Parameters:
test - Test for which this setup is created.
Method Detail

getConfiguration

protected Configuration getConfiguration()
Retrieves configuration of this test case.
Returns:
Configuration of this test case.

getBoolean

public boolean getBoolean(java.lang.String key)
                   throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves boolean number from configuration.
Specified by:
getBoolean in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Boolean value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getByte

public byte getByte(java.lang.String key)
             throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves byte from configuration.
Specified by:
getByte in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Byte value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getChar

public char getChar(java.lang.String key)
             throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves character from configuration.
Specified by:
getChar in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Char value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getDouble

public double getDouble(java.lang.String key)
                 throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves double number from configuration.
Specified by:
getDouble in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Double value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getFloat

public float getFloat(java.lang.String key)
               throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves float number from configuration.
Specified by:
getFloat in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
name - Configuration parameter name.
Returns:
Float value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getInteger

public int getInteger(java.lang.String key)
               throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves integer number from configuration.
Specified by:
getInteger in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Integer value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getLong

public long getLong(java.lang.String key)
             throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves long number from configuration.
Specified by:
getLong in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Long value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getShort

public short getShort(java.lang.String key)
               throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves short number from configuration.
Specified by:
getShort in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Short value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getString

public java.lang.String getString(java.lang.String key)
                           throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves string from configuration.
Specified by:
getString in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
String value of configuration parameter.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.

getStrings

public java.lang.String[] getStrings(java.lang.String key)
                              throws java.lang.IllegalArgumentException
Description copied from interface: ConfigurableTest
Retrieves array of strings from configuration.
Specified by:
getStrings in interface ConfigurableTest
Following copied from interface: junit.extensions.ConfigurableTest
Parameters:
key - Configuration parameter name.
Returns:
Value of configuration parameter as array of strings.
Throws:
java.lang.IllegalArgumentException - Parameter was not found or can't be retrieved.


Copyright © 2001-2002 IT20one GmbH. All Rights Reserved.