testEnvironment
Class ClientSimulator

java.lang.Object
  extended by java.lang.Thread
      extended by testEnvironment.ClientSimulator
All Implemented Interfaces:
java.lang.Runnable

final class ClientSimulator
extends java.lang.Thread

Simulates a Clients behavior using its InputStream and OutputStream according to the following logic: "Send K bytes of data with a delay of L ms between sending, M times."

K, L and M are taken from the property file (TestEnvironmentProperties.txt).

Author:
Karl-Peter Fuchs

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected ClientSimulator()
          Generates a new ClientSimulator that can be used to simulates a Clients behavior using its InputStream and OutputStream according to the following logic: "Send K bytes of data with a delay of L ms between sending, M times."
 
Method Summary
protected static int getVariable(java.lang.String variableKey)
          Returns the value of one of the variables X, Y, Z, K, L, or M from property file (as specified by the bypassed value).
 void run()
          Simulates a Client's behavior.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientSimulator

protected ClientSimulator()
Generates a new ClientSimulator that can be used to simulates a Clients behavior using its InputStream and OutputStream according to the following logic: "Send K bytes of data with a delay of L ms between sending, M times."

K, L and M are taken from the property file (TestEnvironmentProperties.txt).

Method Detail

run

public void run()
Simulates a Client's behavior.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getVariable

protected static int getVariable(java.lang.String variableKey)
Returns the value of one of the variables X, Y, Z, K, L, or M from property file (as specified by the bypassed value).

Parameters:
variableKey - Name (=key) of the variable (=property) to be returned.
Returns:
Value of the specified variable.