1.0.0

org.eclipse.soda.dk.transport.test
Class TransportTest

java.lang.Object
  extended by org.eclipse.soda.dk.core.EscObject
      extended by org.eclipse.soda.dk.transport.test.TransportTest
All Implemented Interfaces:
java.lang.Runnable, ErrorListener, MessageListener, TransportListener, TransportTestService

public class TransportTest
extends EscObject
implements java.lang.Runnable, TransportListener, TransportTestService

Version:
1.0.0

Field Summary
static java.lang.String CLASS_NAME
          Defines the class name.
protected  boolean configurationSave
          Define the configuration save (boolean) field.
static int DEFAULT_PRIORITY
          Define the default priority (int) constant.
static int DEFAULT_TEST_COUNT
          Define the default test count (int) constant.
static long DEFAULT_TEST_DELAY
          Define the default test delay (long) constant.
static long DEFAULT_TOTAL_TEST_TIME
          Define the default total test time (long) constant.
protected static int TRANSPORT_TEST_ACTIVE_STATE_RESOURCE
          Define the transport test active state resource (int) constant.
protected static int TRANSPORT_TEST_ALIVE_STATE_RESOURCE
          Define the transport test alive state resource (int) constant.
protected static int TRANSPORT_TEST_CONNECTED_STATE_RESOURCE
          Define the transport test connected state resource (int) constant.
protected static int TRANSPORT_TEST_CREATED_STATE_RESOURCE
          Define the transport test created state resource (int) constant.
protected static int TRANSPORT_TEST_DEAD_STATE_RESOURCE
          Define the transport test dead state resource (int) constant.
protected static int TRANSPORT_TEST_ERROR_NOTIFICATION_RESOURCE
          Define the transport test error notification resource (int) constant.
protected static int TRANSPORT_TEST_EXIT_EXECUTION_RESOURCE
          Define the transport test exit execution resource (int) constant.
protected static int TRANSPORT_TEST_MESSAGE_NOTIFICATION_RESOURCE
          Define the transport test message notification resource (int) constant.
protected static int TRANSPORT_TEST_SEND_EXCEPTION_RESOURCE
          Define the transport test send exception resource (int) constant.
protected static int TRANSPORT_TEST_START_EXECUTION_RESOURCE
          Define the transport test start execution resource (int) constant.
protected static int TRANSPORT_TEST_START_RESOURCE
          Define the transport test start resource (int) constant.
protected static int TRANSPORT_TEST_STARTED_STATE_RESOURCE
          Define the transport test started state resource (int) constant.
protected static int[] TRANSPORT_TEST_STATE_RESOURCE_TABLE
          Define the transport test state resource table (int[]) constant.
protected static int TRANSPORT_TEST_STOP_EXECUTION_RESOURCE
          Define the transport test stop execution resource (int) constant.
protected static int TRANSPORT_TEST_STOP_RESOURCE
          Define the transport test stop resource (int) constant.
protected static int TRANSPORT_TEST_TRANSPORT_CONFIGURATION_MISCOMPARE_RESOURCE
          Define the transport test transport configuration miscompare resource (int) constant.
protected static int TRANSPORT_TEST_WAITING_RESOURCE
          Define the transport test waiting resource (int) constant.
 
Fields inherited from class org.eclipse.soda.dk.core.EscObject
CLONE_EXCEPTION_RESOURCE, EMPTY_BYTES, EMPTY_STRING, ERROR_OCCURRED_EXCEPTION_RESOURCE, ID_FILTER_KEY, ID_KEY, ID_KEY_ANY, INTEGER_TABLE, KEY_KEY, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_TRACE, LOG_WARNING, PREFIX_KEY, RESOURCE_BUNDLE, SLEEP_EXCEPTION_RESOURCE, SYSTEM_INFO_RESOURCE, TO_STRING_CONFIGURATION_KEYS, TRACE_LEVEL_HIGH, TRACE_LEVEL_LOW, TRACE_LEVEL_MAX, TRACE_LEVEL_MIN, TRACE_LEVEL_NONE, TRACE_LEVEL_NORMAL, TRACELEVEL_KEY, UNKNOWN_ERROR_RESOURCE
 
Fields inherited from interface org.eclipse.soda.dk.transport.test.service.TransportTestService
SERVICE_NAME
 
Constructor Summary
TransportTest()
          Constructs a new instance of the RfidMatricsRdr001TransportTest class.
 
Method Summary
 void endTests()
          End tests.
 void errorOccurred(java.lang.Object source, java.lang.Object timestamp, java.lang.Object data)
          The errorOccurred method is called when an error has occurred.
 void exit()
          Exit.
 java.util.Dictionary getConfigurationInformation()
          Return the property table.
 java.lang.Object getConfigurationInformation(java.lang.String propertyName)
          Return the property value.
 ConfigurationService getConfigurationService()
          Gets the configuration service value.
 java.lang.String getCopyright()
          Gets the copyright (String) value.
 TransportService getDefaultTransport()
          Gets the default transport (TransportService) value.
protected  int getErrorSeverity(int errorNumber, java.lang.Throwable error)
          Get error severity with the specified error number and error parameters and return the int result.
 java.lang.Object getLogDetails4()
          Gets the log details4 (Object) value.
 java.lang.Object getLogDetails5()
          Gets the log details5 (Object) value.
 NotificationService getNotificationService()
          Gets the notification service value.
 int getPriority()
          Gets the priority (int) value.
 java.lang.String getResource(int resourceId)
          Gets the string resource using the supplied resourceId.
 int getTestCount()
          Gets the test count (int) value.
 long getTestDelay()
          Gets the test delay (long) value.
 java.lang.Thread getThread()
          Gets the thread to be used in testing.
 long getTotalTestTime()
          Gets the total test time (long) value.
 TransportService getTransport()
          Gets the transport to be tested.
 java.util.Dictionary getTransportConfigurationInformation()
          Gets the transport configuration information (Dictionary) value.
 java.lang.String getVendor()
          Gets the vendor (String) value.
 boolean isConfigurationSave()
          Gets the configuration save (boolean) value.
 boolean isStarted()
          Gets the started status.
 void messageReceived(TransportService transportService, java.lang.Object timestamp, MessageService message)
          This API will be called each time the TransportService receives a valid message.
 void putConfigurationInformation(java.lang.String propertyName, java.lang.Object value)
          Set the specified property value.
 void run()
          Run tests for the transport.
 void run(java.lang.String[] args)
          Run with the specified args parameter.
 void runTests()
          Run tests.
 void send(MessageService message)
          Send with the specified message parameter.
 void setConfigurationInformation(java.util.Dictionary configurationInformation)
          Sets the configuration information value.
 void setConfigurationSave(boolean configurationSave)
          Sets the configuration save value.
 void setNotificationService(NotificationService notificationService)
          Sets the notification service value.
 void setPriority(int priority)
          Sets the priority value.
 void setStarted(boolean started)
          Sets the started status.
 void setTestCount(int testCount)
          Sets the test count value.
 void setTestDelay(long testDelay)
          Sets the test delay value.
 void setThread(java.lang.Thread thread)
          Sets the thread.
 void setTotalTestTime(long totalTestTime)
          Sets the total test time value.
 void setTransport(TransportService transport)
          Sets the transport to be tested.
 void setTransportConfigurationInformation(java.util.Dictionary transportConfigurationInformation)
          Sets the transport configuration information value.
 void setup()
          Setup.
 void start()
          Start the test case.
 void startTests()
          Start tests.
 void stop()
          Stops the test case.
 void test()
          Tests the transport.
 java.lang.String toString()
          Returns the string value.
 void transportChanged(TransportService transportService, java.lang.Object timestamp, int newState, int oldState)
          This method will be called when the state of the TransportService changes.
 void transportConfigurationCompare()
          Transport configuration compare.
 void transportConfigurationSave()
          Transport configuration save.
 
Methods inherited from class org.eclipse.soda.dk.core.EscObject
attemptRecoveryFromError, createDefaultLogService, createException, createException, createInteger, createIntegerTable, createNumber, format, getBoolean, getCurrentTimestamp, getDefaultLogService, getDefaultResource, getFloat, getInt, getLoadLibraryName, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails6, getLogDetails7, getLogService, getLong, getObject, getOutputName, getSimpleClassName, getStaticBoolean, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticString, getString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleError, handleStaticError, handleStaticException, isDebug, isTrace, loadService, log, log, report, report, report, report, report, report, reportError, reportSystemInfo, setDebug, setDefaultLogService, setLogService, setTraceLevel, shouldLog, sleep, startupEscStatic, toStringConfigurationKeys, toStringInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final java.lang.String CLASS_NAME
Defines the class name.


DEFAULT_PRIORITY

public static final int DEFAULT_PRIORITY
Define the default priority (int) constant.

See Also:
Constant Field Values

DEFAULT_TEST_COUNT

public static final int DEFAULT_TEST_COUNT
Define the default test count (int) constant.

See Also:
Constant Field Values

DEFAULT_TEST_DELAY

public static final long DEFAULT_TEST_DELAY
Define the default test delay (long) constant.

See Also:
Constant Field Values

DEFAULT_TOTAL_TEST_TIME

public static final long DEFAULT_TOTAL_TEST_TIME
Define the default total test time (long) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_DEAD_STATE_RESOURCE

protected static final int TRANSPORT_TEST_DEAD_STATE_RESOURCE
Define the transport test dead state resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_CREATED_STATE_RESOURCE

protected static final int TRANSPORT_TEST_CREATED_STATE_RESOURCE
Define the transport test created state resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_ALIVE_STATE_RESOURCE

protected static final int TRANSPORT_TEST_ALIVE_STATE_RESOURCE
Define the transport test alive state resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_CONNECTED_STATE_RESOURCE

protected static final int TRANSPORT_TEST_CONNECTED_STATE_RESOURCE
Define the transport test connected state resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_ACTIVE_STATE_RESOURCE

protected static final int TRANSPORT_TEST_ACTIVE_STATE_RESOURCE
Define the transport test active state resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_STARTED_STATE_RESOURCE

protected static final int TRANSPORT_TEST_STARTED_STATE_RESOURCE
Define the transport test started state resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_STATE_RESOURCE_TABLE

protected static final int[] TRANSPORT_TEST_STATE_RESOURCE_TABLE
Define the transport test state resource table (int[]) constant.


TRANSPORT_TEST_ERROR_NOTIFICATION_RESOURCE

protected static final int TRANSPORT_TEST_ERROR_NOTIFICATION_RESOURCE
Define the transport test error notification resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_MESSAGE_NOTIFICATION_RESOURCE

protected static final int TRANSPORT_TEST_MESSAGE_NOTIFICATION_RESOURCE
Define the transport test message notification resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_START_RESOURCE

protected static final int TRANSPORT_TEST_START_RESOURCE
Define the transport test start resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_STOP_RESOURCE

protected static final int TRANSPORT_TEST_STOP_RESOURCE
Define the transport test stop resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_WAITING_RESOURCE

protected static final int TRANSPORT_TEST_WAITING_RESOURCE
Define the transport test waiting resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_SEND_EXCEPTION_RESOURCE

protected static final int TRANSPORT_TEST_SEND_EXCEPTION_RESOURCE
Define the transport test send exception resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_START_EXECUTION_RESOURCE

protected static final int TRANSPORT_TEST_START_EXECUTION_RESOURCE
Define the transport test start execution resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_STOP_EXECUTION_RESOURCE

protected static final int TRANSPORT_TEST_STOP_EXECUTION_RESOURCE
Define the transport test stop execution resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_EXIT_EXECUTION_RESOURCE

protected static final int TRANSPORT_TEST_EXIT_EXECUTION_RESOURCE
Define the transport test exit execution resource (int) constant.

See Also:
Constant Field Values

TRANSPORT_TEST_TRANSPORT_CONFIGURATION_MISCOMPARE_RESOURCE

protected static final int TRANSPORT_TEST_TRANSPORT_CONFIGURATION_MISCOMPARE_RESOURCE
Define the transport test transport configuration miscompare resource (int) constant.

See Also:
Constant Field Values

configurationSave

protected boolean configurationSave
Define the configuration save (boolean) field.

Constructor Detail

TransportTest

public TransportTest()
Constructs a new instance of the RfidMatricsRdr001TransportTest class.

Method Detail

endTests

public void endTests()
End tests.

See Also:
runTests(), startTests()

errorOccurred

public void errorOccurred(java.lang.Object source,
                          java.lang.Object timestamp,
                          java.lang.Object data)
The errorOccurred method is called when an error has occurred. Since other notifications are blocked until this method returns, implementors of this method should: The source object that detected the error. The time at which the error was detected. Contains any data about the error.

Specified by:
errorOccurred in interface ErrorListener
Parameters:
source - The source (Object) parameter.
timestamp - The timestamp (Object) parameter.
data - The data (Object) parameter.

exit

public void exit()
Exit.

Specified by:
exit in interface TransportTestService

getConfigurationInformation

public java.util.Dictionary getConfigurationInformation()
Return the property table.

Specified by:
getConfigurationInformation in interface TransportTestService
Returns:
Results of the get configuration information (Dictionary) value.
See Also:
getConfigurationInformation(String), getTransportConfigurationInformation(), putConfigurationInformation(String,Object), setConfigurationInformation(Dictionary), setTransportConfigurationInformation(Dictionary)

getConfigurationInformation

public java.lang.Object getConfigurationInformation(java.lang.String propertyName)
Return the property value. The property name (String) parameter.

Parameters:
propertyName - The property name (String) parameter.
Returns:
Results of the get configuration information (Object) value.
See Also:
getConfigurationInformation(), getTransportConfigurationInformation(), putConfigurationInformation(String,Object), setConfigurationInformation(Dictionary), setTransportConfigurationInformation(Dictionary)

getConfigurationService

public ConfigurationService getConfigurationService()
Gets the configuration service value.

Overrides:
getConfigurationService in class EscObject
Returns:
The configuration service (ConfigurationService) value.

getCopyright

public java.lang.String getCopyright()
Gets the copyright (String) value.

Returns:
The copyright (String) value.

getDefaultTransport

public TransportService getDefaultTransport()
Gets the default transport (TransportService) value.

Returns:
The default transport (TransportService) value.

getErrorSeverity

protected int getErrorSeverity(int errorNumber,
                               java.lang.Throwable error)
Get error severity with the specified error number and error parameters and return the int result. The error number (int) parameter. The error (Throwable) parameter.

Overrides:
getErrorSeverity in class EscObject
Parameters:
errorNumber - The error number (int) parameter.
error - The error (Throwable) parameter.
Returns:
Results of the get error severity (int) value.
See Also:
LogService

getLogDetails4

public java.lang.Object getLogDetails4()
Gets the log details4 (Object) value.

Overrides:
getLogDetails4 in class EscObject
Returns:
The log details4 (Object) value.

getLogDetails5

public java.lang.Object getLogDetails5()
Gets the log details5 (Object) value.

Overrides:
getLogDetails5 in class EscObject
Returns:
The log details5 (Object) value.

getNotificationService

public NotificationService getNotificationService()
Gets the notification service value.

Specified by:
getNotificationService in interface TransportTestService
Returns:
The notification service (NotificationService) value.
See Also:
setNotificationService(NotificationService)

getPriority

public int getPriority()
Gets the priority (int) value.

Returns:
The priority (int) value.
See Also:
setPriority(int)

getResource

public java.lang.String getResource(int resourceId)
Gets the string resource using the supplied resourceId. The resource id (int) parameter.

Overrides:
getResource in class EscObject
Parameters:
resourceId - The resource id (int) parameter.
Returns:
Results of the get resource (String) value.
See Also:
EscObject.getDefaultResource(int)

getTestCount

public int getTestCount()
Gets the test count (int) value.

Returns:
The test count (int) value.
See Also:
setTestCount(int)

getTestDelay

public long getTestDelay()
Gets the test delay (long) value.

Returns:
The test delay (long) value.
See Also:
setTestDelay(long)

getThread

public java.lang.Thread getThread()
Gets the thread to be used in testing.

Returns:
Results of the get thread (Thread) value.
See Also:
setThread(Thread)

getTotalTestTime

public long getTotalTestTime()
Gets the total test time (long) value.

Returns:
The total test time (long) value.
See Also:
setTotalTestTime(long)

getTransport

public TransportService getTransport()
Gets the transport to be tested.

Returns:
The transport to be tested.
See Also:
getDefaultTransport(), setTransport(TransportService)

getTransportConfigurationInformation

public java.util.Dictionary getTransportConfigurationInformation()
Gets the transport configuration information (Dictionary) value.

Returns:
The transport configuration information (Dictionary) value.
See Also:
setTransportConfigurationInformation(Dictionary)

getVendor

public java.lang.String getVendor()
Gets the vendor (String) value.

Returns:
The vendor (String) value.

isConfigurationSave

public boolean isConfigurationSave()
Gets the configuration save (boolean) value.

Returns:
The configuration save (boolean) value.
See Also:
setConfigurationSave(boolean), transportConfigurationSave()

isStarted

public boolean isStarted()
Gets the started status. If true, then tests are running.

Returns:
Return the started status. Return true if started.
See Also:
setStarted(boolean)

messageReceived

public void messageReceived(TransportService transportService,
                            java.lang.Object timestamp,
                            MessageService message)
This API will be called each time the TransportService receives a valid message. Since other notifications are blocked until this method returns, implementors of this method should: The transport that received the message. The timestamp when the message was detected. The message received.

Specified by:
messageReceived in interface MessageListener
Parameters:
transportService - The transport service (TransportService) parameter.
timestamp - The timestamp (Object) parameter.
message - The message (MessageService) parameter.

putConfigurationInformation

public void putConfigurationInformation(java.lang.String propertyName,
                                        java.lang.Object value)
Set the specified property value. The property name (String) parameter. The value (Object) parameter.

Parameters:
propertyName - The property name (String) parameter.
value - The value (Object) parameter.
See Also:
getConfigurationInformation(), getConfigurationInformation(String), getTransportConfigurationInformation(), setConfigurationInformation(Dictionary), setTransportConfigurationInformation(Dictionary)

run

public void run()
Run tests for the transport.

Specified by:
run in interface java.lang.Runnable
See Also:
run(String[])

run

public void run(java.lang.String[] args)
Run with the specified args parameter. The args (String[]) parameter.

Parameters:
args - The args (String[]) parameter.
See Also:
run()

runTests

public void runTests()
Run tests.

See Also:
endTests(), startTests()

send

public void send(MessageService message)
Send with the specified message parameter. The message (MessageService) parameter.

Parameters:
message - The message (MessageService) parameter.

setConfigurationInformation

public void setConfigurationInformation(java.util.Dictionary configurationInformation)
Sets the configuration information value. The configuration information (Dictionary) parameter.

Specified by:
setConfigurationInformation in interface TransportTestService
Parameters:
configurationInformation - The configuration information (Dictionary) parameter.
See Also:
getConfigurationInformation(), getConfigurationInformation(String), getTransportConfigurationInformation(), putConfigurationInformation(String,Object), setTransportConfigurationInformation(Dictionary)

setConfigurationSave

public void setConfigurationSave(boolean configurationSave)
Sets the configuration save value. The configuration save (boolean) parameter.

Parameters:
configurationSave - The configuration save (boolean) parameter.
See Also:
isConfigurationSave(), transportConfigurationSave()

setNotificationService

public void setNotificationService(NotificationService notificationService)
Sets the notification service value.

Specified by:
setNotificationService in interface TransportTestService
Parameters:
notificationService - The notification service (NotificationService) parameter.
See Also:
getNotificationService()

setPriority

public void setPriority(int priority)
Sets the priority value. The priority (int) parameter.

Parameters:
priority - The priority (int) parameter.
See Also:
getPriority()

setStarted

public void setStarted(boolean started)
Sets the started status. The started (boolean) parameter.

Parameters:
started - The started (boolean) parameter.
See Also:
isStarted()

setTestCount

public void setTestCount(int testCount)
Sets the test count value. The test count (int) parameter.

Parameters:
testCount - The test count (int) parameter.
See Also:
getTestCount()

setTestDelay

public void setTestDelay(long testDelay)
Sets the test delay value. The test delay (long) parameter.

Parameters:
testDelay - The test delay (long) parameter.
See Also:
getTestDelay()

setThread

public void setThread(java.lang.Thread thread)
Sets the thread. The thread (Thread) parameter.

Parameters:
thread - The thread (Thread) parameter.
See Also:
getThread()

setTotalTestTime

public void setTotalTestTime(long totalTestTime)
Sets the total test time value. The total test time (long) parameter.

Parameters:
totalTestTime - The total test time (long) parameter.
See Also:
getTotalTestTime()

setTransport

public void setTransport(TransportService transport)
Sets the transport to be tested. The transport (TransportService) parameter.

Specified by:
setTransport in interface TransportTestService
Parameters:
transport - The transport (TransportService) parameter.
See Also:
getDefaultTransport(), getTransport()

setTransportConfigurationInformation

public void setTransportConfigurationInformation(java.util.Dictionary transportConfigurationInformation)
Sets the transport configuration information value. The transportConfigurationInformation (Dictionary) parameter.

Parameters:
transportConfigurationInformation - The transport configuration information (Dictionary) parameter.
See Also:
getTransportConfigurationInformation()

setup

public void setup()
Setup.


start

public void start()
Start the test case.

Specified by:
start in interface TransportTestService

startTests

public void startTests()
Start tests.

See Also:
endTests(), runTests()

stop

public void stop()
Stops the test case.

Specified by:
stop in interface TransportTestService

test

public void test()
Tests the transport.


toString

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

Overrides:
toString in class EscObject
Returns:
The string (String) value.
See Also:
EscObject.getStaticString(String,String), EscObject.getString(String,String)

transportChanged

public void transportChanged(TransportService transportService,
                             java.lang.Object timestamp,
                             int newState,
                             int oldState)
This method will be called when the state of the TransportService changes. Since other notifications are blocked until this method returns, implementors of this method should: Because of the multiple threads and quickly changing states, the current state of the transport may not be the same as the newState input parameter. org.eclipse.soda.dk.transport.service.TransportService java.lang.Object The new state of the TransportService when the notification process started. The old state of the TransportService.

Specified by:
transportChanged in interface TransportListener
Parameters:
transportService - The transport service (TransportService) parameter.
timestamp - The timestamp (Object) parameter.
newState - The new state (int) parameter.
oldState - The old state (int) parameter.

transportConfigurationCompare

public void transportConfigurationCompare()
Transport configuration compare.


transportConfigurationSave

public void transportConfigurationSave()
Transport configuration save.

See Also:
isConfigurationSave(), setConfigurationSave(boolean)

1.0.0

Copyright (c) 1999, 2007 IBM