1.0.0

org.eclipse.soda.dk.profile.test.agent
Class ProfileAbstractTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eclipse.soda.dk.testagent.framework.ConfiguredTestCase
              extended by org.eclipse.soda.dk.testagent.framework.NotificationClientTestCase
                  extended by org.eclipse.soda.dk.profile.test.agent.ProfileAbstractTestCase
All Implemented Interfaces:
junit.framework.Test, ConfigurationService

public abstract class ProfileAbstractTestCase
extends org.eclipse.soda.dk.testagent.framework.NotificationClientTestCase

Version:
1.0.0

Field Summary
static int DEFAULT_MAX_RESPONSE_WAITING_TIME
          Define the max response waiting time (int) constant.
static int DEFAULT_MAX_STATUS_WAITING_TIME
          Define the default max status waiting time (int) constant.
protected static java.lang.String EMPTY_STRING
          Define the empty string (String) constant.
protected  int maxResponseWaitingTimeProperty
          Define the max response waiting time property (int) field.
protected  int maxStatusWaitingTimeProperty
          Define the max status waiting time property (int) field.
protected  java.lang.String prefixProperty
          Define the prefix property (String) field.
static java.lang.String STATUS_EXTERNAL_KEY
          Defines the Status external key.
static char TOPIC_DELIMITER
          Define the topic delimiter (char) constant.
 
Constructor Summary
ProfileAbstractTestCase(java.lang.String name)
          Constructs a new instance of the ProfileAbstractTestCase class.
 
Method Summary
protected  void executeCommand(java.lang.String topicKey, java.lang.Object dataValue)
          Execute command with the specified topic key and data value parameters.
protected  void executeCommand(java.lang.String topicKey, java.lang.String dataKey, java.lang.Object dataValue)
          Execute command with the specified topic key, data key and data value parameters.
protected  java.lang.String[] getExternalKeys()
          Gets the external keys (String[]) value.
protected  void getKeysAndSettingsFromProperties()
          Get keys and settings from properties.
protected  java.lang.Object getMeasurement(java.lang.String topicKey)
          Get measurement with the specified topic key parameter and return the Object result.
protected  java.lang.Object getMeasurement(java.lang.String topicKey, java.lang.String dataKey)
          Get measurement with the specified topic key and data key parameters and return the Object result.
static java.lang.String[] parseDelimitedByToken(java.lang.String target, java.lang.String delimiter)
          Parse comma delimited with the specified comma delimited parameter and return the String[] result.
static byte[] parseHexSpaceDelimited(java.lang.String spaceDelimitedHex)
          Parse hex space delimited with the specified space delimited hex parameter and return the byte[] result.
static InterestService parseInterestMask(java.lang.String maskConfig)
          Parse interest mask with the specified comma delimited pattern and comma delimited care parameters and return the InterestMask result.
protected  java.lang.String prependPrefix(java.lang.String topic)
          Prepend prefix with the specified topic parameter and return the String result.
protected  java.lang.Object readMeasurement(java.lang.String topicKey)
          Read measurement with the specified topic key parameter and return the Object result.
protected  java.lang.Object readMeasurement(java.lang.String topicKey, java.lang.String dataKey)
          Read measurement with the specified topic key and data key parameters and return the Object result.
protected  void reportMeasurement(java.lang.String topicKey, java.lang.Object dataValue)
          Report measurement with the specified topic key and data value parameters.
protected  void reportMeasurement(java.lang.String topicKey, java.lang.String dataKey, java.lang.Object dataValue)
          Report measurement with the specified topic key, data key and data value parameters.
protected  void setUp()
          Set up.
static byte[] toBytes(java.lang.String string)
          To bytes with the specified string parameter and return the byte[] result.
protected  void waitForProfileStart(java.lang.String profileName)
          Wait for profile start with the specified profile name parameter.
protected  void waitForProfileState(java.lang.String profileName, int expectedState)
          Wait for profile state with the specified profile name and expected state parameters.
protected  int waitForSignal(java.lang.String topicKey, int expectedCount, int duration)
          Wait for signal with the specified topic key, expected count and duration parameters and return the int result.
protected  void writeInvalidMeasurement(java.lang.String topicKey, java.lang.Object dataValue)
          Write invalid measurement with the specified topic key and data value parameters.
protected  void writeMeasurement(java.lang.String topicKey, java.lang.Object dataValue)
          Write measurement with the specified topic key and data value parameters.
protected  void writeMeasurement(java.lang.String topicKey, java.lang.String dataKey, java.lang.Object dataValue)
          Write measurement with the specified topic key, data key and data value parameters.
 
Methods inherited from class org.eclipse.soda.dk.testagent.framework.NotificationClientTestCase
broadcast, broadcast, getNotificationService, getProbe, register, register, tearDown, unregister
 
Methods inherited from class org.eclipse.soda.dk.testagent.framework.ConfiguredTestCase
getBoolean, getConfigurationService, getContext, getFloat, getInt, getLong, getObject, getProperties, getString, getSynchronizationService, requestConfirmation, toString
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOPIC_DELIMITER

public static final char TOPIC_DELIMITER
Define the topic delimiter (char) constant.

See Also:
Constant Field Values

EMPTY_STRING

protected static final java.lang.String EMPTY_STRING
Define the empty string (String) constant.

See Also:
Constant Field Values

STATUS_EXTERNAL_KEY

public static final java.lang.String STATUS_EXTERNAL_KEY
Defines the Status external key.

See Also:
Constant Field Values

DEFAULT_MAX_RESPONSE_WAITING_TIME

public static final int DEFAULT_MAX_RESPONSE_WAITING_TIME
Define the max response waiting time (int) constant.

See Also:
Constant Field Values

DEFAULT_MAX_STATUS_WAITING_TIME

public static final int DEFAULT_MAX_STATUS_WAITING_TIME
Define the default max status waiting time (int) constant.

See Also:
Constant Field Values

prefixProperty

protected java.lang.String prefixProperty
Define the prefix property (String) field.


maxResponseWaitingTimeProperty

protected int maxResponseWaitingTimeProperty
Define the max response waiting time property (int) field.


maxStatusWaitingTimeProperty

protected int maxStatusWaitingTimeProperty
Define the max status waiting time property (int) field.

Constructor Detail

ProfileAbstractTestCase

public ProfileAbstractTestCase(java.lang.String name)
Constructs a new instance of the ProfileAbstractTestCase class.

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

parseDelimitedByToken

public static java.lang.String[] parseDelimitedByToken(java.lang.String target,
                                                       java.lang.String delimiter)
Parse comma delimited with the specified comma delimited parameter and return the String[] result.

Parameters:
commaDelimited - The comma delimited (String) parameter.
target - The target (String) parameter.
delimiter - The delimiter (String) parameter.
Returns:
Results of the parse comma delimited (String[]) value.

parseHexSpaceDelimited

public static byte[] parseHexSpaceDelimited(java.lang.String spaceDelimitedHex)
Parse hex space delimited with the specified space delimited hex parameter and return the byte[] result.

Parameters:
spaceDelimitedHex - The space delimited hex (String) parameter.
Returns:
Results of the parse hex space delimited (byte[]) value.

parseInterestMask

public static InterestService parseInterestMask(java.lang.String maskConfig)
Parse interest mask with the specified comma delimited pattern and comma delimited care parameters and return the InterestMask result.

Parameters:
maskConfig - The mask config (String) parameter.
Returns:
Result of the parse interest mask (InterestMask) value.

toBytes

public static byte[] toBytes(java.lang.String string)
                      throws java.lang.RuntimeException
To bytes with the specified string parameter and return the byte[] result.

Parameters:
string - The string (String) parameter.
Returns:
Results of the to bytes (byte[]) value.
Throws:
java.lang.RuntimeException - Runtime Exception.

executeCommand

protected void executeCommand(java.lang.String topicKey,
                              java.lang.String dataKey,
                              java.lang.Object dataValue)
Execute command with the specified topic key, data key and data value parameters.

Parameters:
topicKey - The topic key (String) parameter.
dataKey - The data key (String) parameter.
dataValue - The data value (Dictionary) parameter.
See Also:
executeCommand(String,Object)

executeCommand

protected void executeCommand(java.lang.String topicKey,
                              java.lang.Object dataValue)
Execute command with the specified topic key and data value parameters.

Parameters:
topicKey - The topic key (String) parameter.
dataValue - The data value (Dictionary) parameter.
See Also:
executeCommand(String,String,Object)

getExternalKeys

protected java.lang.String[] getExternalKeys()
Gets the external keys (String[]) value.

Overrides:
getExternalKeys in class org.eclipse.soda.dk.testagent.framework.NotificationClientTestCase
Returns:
The external keys (String[]) value.

getKeysAndSettingsFromProperties

protected void getKeysAndSettingsFromProperties()
Get keys and settings from properties.


getMeasurement

protected java.lang.Object getMeasurement(java.lang.String topicKey,
                                          java.lang.String dataKey)
                                   throws java.lang.InterruptedException
Get measurement with the specified topic key and data key parameters and return the Object result.

Parameters:
topicKey - The topic key (String) parameter.
dataKey - The data key (String) parameter.
Returns:
Results of the get measurement (Object) value.
Throws:
java.lang.InterruptedException - Interrupted Exception.
See Also:
getMeasurement(String), readMeasurement(String,String), readMeasurement(String), reportMeasurement(String,String,Object), reportMeasurement(String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,String,Object), writeMeasurement(String,Object)

getMeasurement

protected java.lang.Object getMeasurement(java.lang.String topicKey)
                                   throws java.lang.InterruptedException
Get measurement with the specified topic key parameter and return the Object result.

Parameters:
topicKey - The topic key (String) parameter.
Returns:
Results of the get measurement (Object) value.
Throws:
java.lang.InterruptedException - Interrupted Exception.
See Also:
getMeasurement(String,String), readMeasurement(String,String), readMeasurement(String), reportMeasurement(String,String,Object), reportMeasurement(String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,String,Object), writeMeasurement(String,Object)

prependPrefix

protected java.lang.String prependPrefix(java.lang.String topic)
Prepend prefix with the specified topic parameter and return the String result.

Parameters:
topic - The topic (String) parameter.
Returns:
Results of the prepend prefix (String) value.

readMeasurement

protected java.lang.Object readMeasurement(java.lang.String topicKey,
                                           java.lang.String dataKey)
                                    throws java.lang.InterruptedException
Read measurement with the specified topic key and data key parameters and return the Object result.

Parameters:
topicKey - The topic key (String) parameter.
dataKey - The data key (String) parameter.
Returns:
Results of the read measurement (Object) value.
Throws:
java.lang.InterruptedException - Interrupted Exception.
See Also:
getMeasurement(String,String), getMeasurement(String), readMeasurement(String), reportMeasurement(String,String,Object), reportMeasurement(String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,String,Object), writeMeasurement(String,Object)

readMeasurement

protected java.lang.Object readMeasurement(java.lang.String topicKey)
                                    throws java.lang.InterruptedException
Read measurement with the specified topic key parameter and return the Object result.

Parameters:
topicKey - The topic key (String) parameter.
Returns:
Results of the read measurement (Object) value.
Throws:
java.lang.InterruptedException - Interrupted Exception.
See Also:
getMeasurement(String,String), getMeasurement(String), readMeasurement(String,String), reportMeasurement(String,String,Object), reportMeasurement(String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,String,Object), writeMeasurement(String,Object)

reportMeasurement

protected void reportMeasurement(java.lang.String topicKey,
                                 java.lang.String dataKey,
                                 java.lang.Object dataValue)
Report measurement with the specified topic key, data key and data value parameters.

Parameters:
topicKey - The topic key (String) parameter.
dataKey - The data key (String) parameter.
dataValue - The data value (Object) parameter.
See Also:
getMeasurement(String,String), getMeasurement(String), readMeasurement(String,String), readMeasurement(String), reportMeasurement(String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,String,Object), writeMeasurement(String,Object)

reportMeasurement

protected void reportMeasurement(java.lang.String topicKey,
                                 java.lang.Object dataValue)
Report measurement with the specified topic key and data value parameters.

Parameters:
topicKey - The topic key (String) parameter.
dataValue - The data value (Object) parameter.
See Also:
getMeasurement(String,String), getMeasurement(String), readMeasurement(String,String), readMeasurement(String), reportMeasurement(String,String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,String,Object), writeMeasurement(String,Object)

setUp

protected void setUp()
              throws java.lang.Exception
Set up.

Overrides:
setUp in class org.eclipse.soda.dk.testagent.framework.NotificationClientTestCase
Throws:
java.lang.Exception

waitForProfileStart

protected void waitForProfileStart(java.lang.String profileName)
                            throws java.lang.InterruptedException
Wait for profile start with the specified profile name parameter.

Parameters:
profileName - The profile name (String) parameter.
Throws:
java.lang.InterruptedException - Interrupted Exception.

waitForProfileState

protected void waitForProfileState(java.lang.String profileName,
                                   int expectedState)
                            throws java.lang.InterruptedException
Wait for profile state with the specified profile name and expected state parameters.

Parameters:
profileName - The profile name (String) parameter.
expectedState - The expected state (int) parameter.
Throws:
java.lang.InterruptedException - Interrupted Exception.

waitForSignal

protected int waitForSignal(java.lang.String topicKey,
                            int expectedCount,
                            int duration)
                     throws java.lang.InterruptedException
Wait for signal with the specified topic key, expected count and duration parameters and return the int result.

Parameters:
topicKey - The topic key (String) parameter.
expectedCount - The expected count (int) parameter.
duration - The duration (int) parameter.
Returns:
Results of the wait for signal (int) value.
Throws:
java.lang.InterruptedException - Interrupted Exception.

writeInvalidMeasurement

protected void writeInvalidMeasurement(java.lang.String topicKey,
                                       java.lang.Object dataValue)
                                throws java.lang.InterruptedException
Write invalid measurement with the specified topic key and data value parameters.

Parameters:
topicKey - The topic key (String) parameter.
dataValue - The data value (Object) parameter.
Throws:
java.lang.InterruptedException - Interrupted Exception.

writeMeasurement

protected void writeMeasurement(java.lang.String topicKey,
                                java.lang.String dataKey,
                                java.lang.Object dataValue)
Write measurement with the specified topic key, data key and data value parameters.

Parameters:
topicKey - The topic key (String) parameter.
dataKey - The data key (String) parameter.
dataValue - The data value (Object) parameter.
See Also:
getMeasurement(String,String), getMeasurement(String), readMeasurement(String,String), readMeasurement(String), reportMeasurement(String,String,Object), reportMeasurement(String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,Object)

writeMeasurement

protected void writeMeasurement(java.lang.String topicKey,
                                java.lang.Object dataValue)
                         throws java.lang.InterruptedException
Write measurement with the specified topic key and data value parameters.

Parameters:
topicKey - The topic key (String) parameter.
dataValue - The data value (Object) parameter.
Throws:
java.lang.InterruptedException - Interrupted Exception.
See Also:
getMeasurement(String,String), getMeasurement(String), readMeasurement(String,String), readMeasurement(String), reportMeasurement(String,String,Object), reportMeasurement(String,Object), writeInvalidMeasurement(String,Object), writeMeasurement(String,String,Object)

1.0.0

Copyright (c) 1999, 2007 IBM