test
Class TestUtils

java.lang.Object
  extended by test.TestUtils

public class TestUtils
extends java.lang.Object

Generic convenience methods for tests.


Constructor Summary
TestUtils(java.util.List<ConnectionListener> cl, java.util.List<MessageListener> ml, Settings settings)
          Creates a test utils object suitable for creating new hosts.
 
Method Summary
 DTNHost createHost()
          Creates a host to location (0,0) with stationary movement model and default name.
 DTNHost createHost(Coord loc)
          Creates a host to a location with stationary movement model and default name.
 DTNHost createHost(Coord loc, java.lang.String name)
          Creates a host to a location with stationary movement model and MessageRouter router.
 DTNHost createHost(MovementModel mmProto, java.lang.String name)
          Creates a host with defined movement model
 java.util.List<DTNHost> getAllHosts()
           
 void setConListeners(java.util.List<ConnectionListener> conListeners)
           
 void setGroupId(java.lang.String groupId)
           
 void setMessageRouterProto(MessageRouter mr)
           
 void setMsgListeners(java.util.List<MessageListener> msgListeners)
           
 void setTransmitRange(int transmitRange)
           
 void setTransmitSpeed(int transmitSpeed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestUtils

public TestUtils(java.util.List<ConnectionListener> cl,
                 java.util.List<MessageListener> ml,
                 Settings settings)
Creates a test utils object suitable for creating new hosts.

Parameters:
cl - Connection listeners for the hosts
ml - Message -"-
settings - Setting object given to message router
Method Detail

setMessageRouterProto

public void setMessageRouterProto(MessageRouter mr)

setConListeners

public void setConListeners(java.util.List<ConnectionListener> conListeners)
Parameters:
conListeners - the ConnectionListeners to set

setGroupId

public void setGroupId(java.lang.String groupId)
Parameters:
groupId - the groupId to set

setMsgListeners

public void setMsgListeners(java.util.List<MessageListener> msgListeners)
Parameters:
msgListeners - the MessageListeners to set

setTransmitRange

public void setTransmitRange(int transmitRange)
Parameters:
transmitRange - the transmitRange to set

setTransmitSpeed

public void setTransmitSpeed(int transmitSpeed)
Parameters:
transmitSpeed - the transmitSpeed to set

createHost

public DTNHost createHost(Coord loc,
                          java.lang.String name)
Creates a host to a location with stationary movement model and MessageRouter router.

Parameters:
loc - The location of the host
name - Name of the host (or null for default)
Returns:
The new host

createHost

public DTNHost createHost(MovementModel mmProto,
                          java.lang.String name)
Creates a host with defined movement model

Parameters:
mmProto - The prototy of the movement model
name - name of the host
Returns:
the host

createHost

public DTNHost createHost(Coord loc)
Creates a host to a location with stationary movement model and default name.

Parameters:
loc - The location of the host
Returns:
The new host

createHost

public DTNHost createHost()
Creates a host to location (0,0) with stationary movement model and default name.

Returns:
The new host

getAllHosts

public java.util.List<DTNHost> getAllHosts()