1.0.0

org.eclipse.soda.dk.testagent.framework
Class ConfiguredTestCase

java.lang.Object
  extended by TestCase
      extended by org.eclipse.soda.dk.testagent.framework.ConfiguredTestCase
Direct Known Subclasses:
ConfigurationTestCase, NotificationClientTestCase, SynchronizationTestCase

public abstract class ConfiguredTestCase
extends TestCase

Version:
1.2.0

Constructor Summary
protected ConfiguredTestCase()
          No-arg constructor to enable serialization.
protected ConfiguredTestCase(java.lang.String name)
          Constructs a test case with the given name.
 
Method Summary
static void assertEquals(boolean expected, boolean actual)
          Asserts that two booleans are equal.
static void assertEquals(double expected, double actual, double delta)
          Asserts that two doubles are equal concerning a delta.
static void assertEquals(java.lang.String message, boolean expected, boolean actual)
          Asserts that two booleans are equal.
static void assertEquals(java.lang.String message, double expected, double actual, double delta)
          Asserts that two doubles are equal concerning a delta.
 boolean getBoolean(java.lang.String key, boolean defaultBoolean)
          Get boolean with the specified key and default boolean parameters and return the boolean result.
 boolean[] getBooleanArray(java.lang.String key, boolean[] defaultBooleanArray)
          Get boolean array with the specified key and default boolean array parameters and return the boolean[] result.
 byte getByte(java.lang.String key, byte defaultByte)
          Get byte with the specified key and default byte parameters and return the byte result.
 byte[] getByteArray(java.lang.String key, byte[] defaultBytes)
          Get byte array with the specified key and default bytes parameters and return the byte result.
 char getChar(java.lang.String key, char defaultChar)
          Get char with the specified key and default char parameters and return the char result.
 char[] getCharArray(java.lang.String key, char[] defaultCharArray)
          Get char array with the specified key and default char array parameters and return the char[] result.
 ConfigurationService getConfigurationService()
          Gets the configuration service value.
 TestContext getContext()
          Gets the context (TestContext) value.
 double getDouble(java.lang.String key, double defaultDouble)
          Get double with the specified key and default float parameters and return the double result.
 double[] getDouble(java.lang.String key, double[] defaultDoubleArray)
          Deprecated. Use getDoubleArray(String,double[]) instead
 double[] getDoubleArray(java.lang.String key, double[] defaultDoubleArray)
          Get double with the specified key and default double array parameters and return the double[] result.
 float getFloat(java.lang.String key, float defaultFloat)
          Get float with the specified key and default float parameters and return the float result.
 float[] getFloatArray(java.lang.String key, float[] defaultFloatArray)
          Get float array with the specified key and default float array parameters and return the float[] result.
 int getInt(java.lang.String key, int defaultInt)
          Get int with the specified key and default int parameters and return the int result.
 int[] getIntArray(java.lang.String key, int[] defaultIntArray)
          Get int array with the specified key and default int array parameters and return the int[] result.
 long getLong(java.lang.String key, long defaultLong)
          Get long with the specified key and default long parameters and return the long result.
 long[] getLongArray(java.lang.String key, long[] defaultLongArray)
          Get long array with the specified key and default long array parameters and return the long[] result.
 java.lang.Object getObject(java.lang.String key, java.lang.Object defaultObject)
          Get object with the specified key and default object parameters and return the Object result.
 java.lang.Object[] getObject(java.lang.String key, java.lang.Object[] defaultObjectArray)
          Deprecated. Use getObjectArray(String,Object[]) instead
 java.lang.Object[] getObjectArray(java.lang.String key, java.lang.Object[] defaultObjectArray)
          Get object with the specified key and default object array parameters and return the Object[] result.
 java.util.Dictionary getProperties()
          Gets the properties (Dictionary) value.
 short getShort(java.lang.String key, short defaultShort)
          Get short with the specified key and default short parameters and return the short result.
 short[] getShort(java.lang.String key, short[] defaultShortArray)
          Deprecated. Use getShortArray(String,short[]) instead
 short[] getShortArray(java.lang.String key, short[] defaultShortArray)
          Get short with the specified key and default short array parameters and return the short[] result.
 java.lang.String getString(java.lang.String key, java.lang.String defaultString)
          Get string with the specified key and default string parameters and return the String result.
 java.lang.String[] getStringArray(java.lang.String key, java.lang.String[] defaultStringArray)
          Get string array with the specified key and default string array parameters and return the String[] result.
 TestSynchronizationService getSynchronizationService()
          Gets the synchronization service (TestSynchronizationService) value.
 boolean requestConfirmation(java.lang.String prompt)
          Request confirmation with the specified prompt parameter and return the boolean result.
 java.lang.String toString()
          Returns the string value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfiguredTestCase

protected ConfiguredTestCase()
No-arg constructor to enable serialization. This method is not intended to be used by mere mortals without calling setName().

See Also:
ConfiguredTestCase(String)

ConfiguredTestCase

protected ConfiguredTestCase(java.lang.String name)
Constructs a test case with the given name.

Parameters:
name - The name (String) parameter.
See Also:
ConfiguredTestCase()
Method Detail

assertEquals

public static void assertEquals(boolean expected,
                                boolean actual)
Asserts that two booleans are equal. This method is re-implemented to avoid a runtime error due to incompatibility of junit with OSGi/Minimum.

Parameters:
expected - The expected (boolean) parameter.
actual - The actual (boolean) parameter.
See Also:
Assert, assertEquals(double,double,double), assertEquals(String,boolean,boolean), assertEquals(String,double,double,double)

assertEquals

public static void assertEquals(double expected,
                                double actual,
                                double delta)
Asserts that two doubles are equal concerning a delta. If the expected value is infinity then the delta value is ignored. This method is re-implemented to avoid a runtime error due to incompatibility of junit with OSGi/Minimum.

Parameters:
expected - The expected (double) parameter.
actual - The actual (double) parameter.
delta - The delta (double) parameter.
See Also:
Assert, assertEquals(boolean,boolean), assertEquals(String,boolean,boolean), assertEquals(String,double,double,double)

assertEquals

public static void assertEquals(java.lang.String message,
                                boolean expected,
                                boolean actual)
Asserts that two booleans are equal. If they are not an AssertionFailedError is thrown with the given message. This method is re-implemented to avoid a runtime error due to incompatibility of junit with OSGi/Minimum.

Parameters:
message - The message (String) parameter.
expected - The expected (boolean) parameter.
actual - The actual (boolean) parameter.
See Also:
Assert, assertEquals(boolean,boolean), assertEquals(double,double,double), assertEquals(String,double,double,double)

assertEquals

public static void assertEquals(java.lang.String message,
                                double expected,
                                double actual,
                                double delta)
Asserts that two doubles are equal concerning a delta. If they are not an AssertionFailedError is thrown with the given message. If the expected value is infinity then the delta value is ignored. This method is re-implemented to avoid a runtime error due to incompatibility of junit with OSGi/Minimum.

Parameters:
message - The message (String) parameter.
expected - The expected (double) parameter.
actual - The actual (double) parameter.
delta - The delta (double) parameter.
See Also:
Assert, assertEquals(boolean,boolean), assertEquals(double,double,double), assertEquals(String,boolean,boolean)

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean defaultBoolean)
Get boolean with the specified key and default boolean parameters and return the boolean result.

Parameters:
key - The key (String) parameter.
defaultBoolean - The default boolean (boolean) parameter.
Returns:
Results of the get boolean (boolean) value.

getBooleanArray

public boolean[] getBooleanArray(java.lang.String key,
                                 boolean[] defaultBooleanArray)
Get boolean array with the specified key and default boolean array parameters and return the boolean[] result.

Parameters:
key - The key (String) parameter.
defaultBooleanArray - The default boolean array (boolean[]) parameter.
Returns:
Results of the get boolean array (boolean[]) value.
Since:
1.2

getByte

public byte getByte(java.lang.String key,
                    byte defaultByte)
Get byte with the specified key and default byte parameters and return the byte result.

Parameters:
key - The key (String) parameter.
defaultByte - The default byte (byte) parameter.
Returns:
Results of the get byte (byte) value.
Since:
1.2

getByteArray

public byte[] getByteArray(java.lang.String key,
                           byte[] defaultBytes)
Get byte array with the specified key and default bytes parameters and return the byte result.

Parameters:
key - The key (String) parameter.
defaultBytes - The default bytes (byte[]) parameter.
Returns:
Results of the get byte array (byte[]) value.
Since:
1.2

getChar

public char getChar(java.lang.String key,
                    char defaultChar)
Get char with the specified key and default char parameters and return the char result.

Parameters:
key - The key (String) parameter.
defaultChar - The default char (char) parameter.
Returns:
Results of the get char (char) value.
Since:
1.2

getCharArray

public char[] getCharArray(java.lang.String key,
                           char[] defaultCharArray)
Get char array with the specified key and default char array parameters and return the char[] result.

Parameters:
key - The key (String) parameter.
defaultCharArray - The default char array (char[]) parameter.
Returns:
Results of the get char array (char[]) value.
Since:
1.2

getConfigurationService

public ConfigurationService getConfigurationService()
Gets the configuration service value.

Returns:
the configurationService

getContext

public TestContext getContext()
Gets the context (TestContext) value.

Returns:
the context

getDouble

public double getDouble(java.lang.String key,
                        double defaultDouble)
Get double with the specified key and default float parameters and return the double result.

Parameters:
key - The key (String) parameter.
defaultDouble - The default double (double) parameter.
Returns:
Results of the get double (double) value.
Since:
1.2
See Also:
getDoubleArray(String,double[])

getDouble

public double[] getDouble(java.lang.String key,
                          double[] defaultDoubleArray)
Deprecated. Use getDoubleArray(String,double[]) instead

Get double with the specified key and default double array parameters and return the double[] result.

Parameters:
key - The key (String) parameter.
defaultDoubleArray - The default double array (double[]) parameter.
Returns:
Results of the get double (double[]) value.
Since:
1.2
See Also:
getDouble(String,double)

getDoubleArray

public double[] getDoubleArray(java.lang.String key,
                               double[] defaultDoubleArray)
Get double with the specified key and default double array parameters and return the double[] result.

Parameters:
key - The key (String) parameter.
defaultDoubleArray - The default double array (double[]) parameter.
Returns:
Results of the get double (double[]) value.
Since:
1.2
See Also:
getDouble(String,double)

getFloat

public float getFloat(java.lang.String key,
                      float defaultFloat)
Get float with the specified key and default float parameters and return the float result.

Parameters:
key - The key (String) parameter.
defaultFloat - The default float (float) parameter.
Returns:
Results of the get float (float) value.

getFloatArray

public float[] getFloatArray(java.lang.String key,
                             float[] defaultFloatArray)
Get float array with the specified key and default float array parameters and return the float[] result.

Parameters:
key - The key (String) parameter.
defaultFloatArray - The default float array (float[]) parameter.
Returns:
Results of the get float array (float[]) value.
Since:
1.2

getInt

public int getInt(java.lang.String key,
                  int defaultInt)
Get int with the specified key and default int parameters and return the int result.

Parameters:
key - The key (String) parameter.
defaultInt - The default int (int) parameter.
Returns:
Results of the get int (int) value.

getIntArray

public int[] getIntArray(java.lang.String key,
                         int[] defaultIntArray)
Get int array with the specified key and default int array parameters and return the int[] result.

Parameters:
key - The key (String) parameter.
defaultIntArray - The default int array (int[]) parameter.
Returns:
Results of the get int array (int[]) value.
Since:
1.2

getLong

public long getLong(java.lang.String key,
                    long defaultLong)
Get long with the specified key and default long parameters and return the long result.

Parameters:
key - The key (String) parameter.
defaultLong - The default long (long) parameter.
Returns:
Results of the get long (long) value.

getLongArray

public long[] getLongArray(java.lang.String key,
                           long[] defaultLongArray)
Get long array with the specified key and default long array parameters and return the long[] result.

Parameters:
key - The key (String) parameter.
defaultLongArray - The default long array (long[]) parameter.
Returns:
Results of the get long array (long[]) value.
Since:
1.2

getObject

public java.lang.Object getObject(java.lang.String key,
                                  java.lang.Object defaultObject)
Get object with the specified key and default object parameters and return the Object result.

Parameters:
key - The key (String) parameter.
defaultObject - The default object (Object) parameter.
Returns:
Results of the get object (Object) value.
See Also:
getObjectArray(String,Object[])

getObject

public java.lang.Object[] getObject(java.lang.String key,
                                    java.lang.Object[] defaultObjectArray)
Deprecated. Use getObjectArray(String,Object[]) instead

Get object with the specified key and default object array parameters and return the Object[] result.

Parameters:
key - The key (String) parameter.
defaultObjectArray - The default object array (Object[]) parameter.
Returns:
Results of the get object (Object[]) value.
Since:
1.2
See Also:
getObject(String,Object)

getObjectArray

public java.lang.Object[] getObjectArray(java.lang.String key,
                                         java.lang.Object[] defaultObjectArray)
Get object with the specified key and default object array parameters and return the Object[] result.

Parameters:
key - The key (String) parameter.
defaultObjectArray - The default object array (Object[]) parameter.
Returns:
Results of the get object (Object[]) value.
Since:
1.2
See Also:
getObject(String,Object)

getProperties

public java.util.Dictionary getProperties()
Gets the properties (Dictionary) value.

Returns:
The properties (Dictionary) value.

getShort

public short getShort(java.lang.String key,
                      short defaultShort)
Get short with the specified key and default short parameters and return the short result.

Parameters:
key - The key (String) parameter.
defaultShort - The default short (short) parameter.
Returns:
Results of the get short (short) value.
Since:
1.2
See Also:
getShortArray(String,short[])

getShort

public short[] getShort(java.lang.String key,
                        short[] defaultShortArray)
Deprecated. Use getShortArray(String,short[]) instead

Get short with the specified key and default short array parameters and return the short[] result.

Parameters:
key - The key (String) parameter.
defaultShortArray - The default short array (short[]) parameter.
Returns:
Results of the get short (short[]) value.
Since:
1.2
See Also:
getShort(String,short)

getShortArray

public short[] getShortArray(java.lang.String key,
                             short[] defaultShortArray)
Get short with the specified key and default short array parameters and return the short[] result.

Parameters:
key - The key (String) parameter.
defaultShortArray - The default short array (short[]) parameter.
Returns:
Results of the get short (short[]) value.
Since:
1.2
See Also:
getShort(String,short)

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String defaultString)
Get string with the specified key and default string parameters and return the String result.

Parameters:
key - The key (String) parameter.
defaultString - The default string (String) parameter.
Returns:
Results of the get string (String) value.
See Also:
toString()

getStringArray

public java.lang.String[] getStringArray(java.lang.String key,
                                         java.lang.String[] defaultStringArray)
Get string array with the specified key and default string array parameters and return the String[] result.

Parameters:
key - The key (String) parameter.
defaultStringArray - The default string array (String[]) parameter.
Returns:
Results of the get string array (String[]) value.
Since:
1.2

getSynchronizationService

public TestSynchronizationService getSynchronizationService()
Gets the synchronization service (TestSynchronizationService) value.

Returns:
the synchronizationService

requestConfirmation

public boolean requestConfirmation(java.lang.String prompt)
                            throws java.lang.InterruptedException,
                                   java.io.IOException
Request confirmation with the specified prompt parameter and return the boolean result.

Parameters:
prompt - The prompt (String) parameter.
Returns:
Results of the request confirmation (boolean) value.
Throws:
java.lang.InterruptedException - Interrupted Exception.
java.io.IOException - IOException.

toString

public java.lang.String toString()
Returns the string value.

Returns:
The string (String) value.
See Also:
getString(String,String)

1.0.0

Copyright (c) 2007, 2009 IBM