2008-02-07 1.1.0

org.eclipse.soda.dk.transport.testcase
Class TransportTestcase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eclipse.soda.dk.transport.testcase.TransportTestcase
All Implemented Interfaces:
junit.framework.Test, ErrorListener, MessageListener, TransportListener

public abstract class TransportTestcase
extends junit.framework.TestCase
implements TransportListener

Version:
1.1.0

Field Summary
protected  java.lang.Object stateWait
          Define the state wait (Object) field.
protected  TransportService transport
          Define the transport (TestTransport) field.
 
Constructor Summary
protected TransportTestcase()
          Constructs an instance of this class.
protected TransportTestcase(java.lang.String name)
           
 
Method Summary
abstract  TransportService createTransport()
          Create transport and return the TransportService result.
 void errorOccurred(java.lang.Object source, java.lang.Object timestamp, java.lang.Object data)
          The errorOccurred method is called when an error has occurred.
 TransportService getTransport()
          Gets the transport (TransportService) value.
 void messageReceived(TransportService transportService, java.lang.Object timestamp, MessageService message)
          This API will be called each time the TransportService receives a valid message.
 void setTransport(TransportService transport)
           
protected  void setUp()
          Set up.
 void startTransport()
          Start transport.
 void test_Fields()
          Test_ fields.
 void test_Interfaces()
          Test_ interfaces.
 void transportChanged(TransportService transportService, java.lang.Object timestamp, int newState, int oldState)
          This method will be called when the state of the TransportService changes.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transport

protected TransportService transport
Define the transport (TestTransport) field.


stateWait

protected final java.lang.Object stateWait
Define the state wait (Object) field.

Constructor Detail

TransportTestcase

protected TransportTestcase()
Constructs an instance of this class.

See Also:
TransportTestcase(String)

TransportTestcase

protected TransportTestcase(java.lang.String name)
Parameters:
name - The name (String) parameter.
See Also:
TransportTestcase()
Method Detail

createTransport

public abstract TransportService createTransport()
Create transport and return the TransportService result.

Returns:
Results of the create transport (TransportService) value.
See Also:
getTransport(), setTransport(TransportService), startTransport()

errorOccurred

public void errorOccurred(java.lang.Object source,
                          java.lang.Object timestamp,
                          java.lang.Object data)
Description copied from interface: ErrorListener
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.

getTransport

public TransportService getTransport()
Gets the transport (TransportService) value.

Returns:
The transport (TransportService) value.
See Also:
createTransport(), setTransport(TransportService), startTransport()

messageReceived

public void messageReceived(TransportService transportService,
                            java.lang.Object timestamp,
                            MessageService message)
Description copied from interface: MessageListener
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.

setTransport

public void setTransport(TransportService transport)
Parameters:
transport - The transport (TransportService) parameter.
See Also:
createTransport(), getTransport(), startTransport()

setUp

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

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception - Exception.

startTransport

public void startTransport()
                    throws java.lang.Exception
Start transport.

Throws:
java.lang.Exception - Exception.
See Also:
createTransport(), getTransport(), setTransport(TransportService)

test_Fields

public void test_Fields()
Test_ fields.


test_Interfaces

public void test_Interfaces()
Test_ interfaces.


transportChanged

public void transportChanged(TransportService transportService,
                             java.lang.Object timestamp,
                             int newState,
                             int oldState)
Description copied from interface: TransportListener
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.

2008-02-07 1.1.0

Copyright (c) 1999, 2008 IBM and others. See license in Legal section. OSGi Framework Version 3.3.1.R33x_v20070828