ParkNPark.tests
Class RunOne

java.lang.Object
  extended by ParkNPark.tests.RunOne
All Implemented Interfaces:
Runnable

public class RunOne
extends Object
implements Runnable

Class that runs one test configuration


Field Summary
protected  Set<String> allClients
          All clients that are defined, because we need to kill them all on startup
protected  Set<String> allServers
          All servers that are defined, because we need to kill them all on startup
protected  Set<ProcessInfo> clients
          Our clients
protected  int detectionTimeout
          The wait timeout to use during fault detections
protected  boolean faultInjection
          Whether or not fault injection is enabled
protected  int faultInjectionMaxDelay
          The maximum delay of the fault injection in milliseconds
protected  int faultInjectionMinDelay
          The minimum delay of the fault injection in milliseconds
protected  int getLotsModeCount
          When not 0, how many invocations of getLotsMode should be performed
protected  int interRequestTime
          Time between requests
private  String jdbcPassword
          The JDBC password
private  String jdbcURL
          The JDBC URL
private  String jdbcUsername
          The JDBC user name
protected  boolean killOnly
          When true, the testing manager will only kill everything
protected  ORB orb
          Object request broker
protected static ProcessInfoComparator<ProcessInfo> processInfoComparator
          Singleton instance of the ProcessInfoComparator
protected  String projectRoot
          The project root folder
protected  int recoveryTimeout
          The wait timeout to use during fault recoveries
protected  int replySize
          Size of reply
protected  ProcessInfo sacredServer
          Our name and replication server
protected  Set<ProcessInfo> servers
          Our servers
protected  BufferedWriter stdErrWriter
          A writer for stderr
 
Constructor Summary
RunOne(String projectRoot, int numClients, int numServers, int interRequestTime, int replySize, boolean faultInjection, int faultInjectionMinDelay, int faultInjectionMaxDelay, boolean killOnly, int getLotsMode, int detectionTimeout, int recoveryTimeout, String jdbcURL, String jdbcUsername, String jdbcPassword)
          Creates a new test case runner
 
Method Summary
protected  void ensureOutputFoldersExist()
          Ensures that the output folders exist, which the programs write stdout or stderr to, depending on the program
static void main(String[] args)
          Run the tests as specified on the command line
protected static void populateSet(Set<String> set, Reader input)
          Populates a Set from individual lines of a reader
 void run()
          Runs this test's configuration by cleaning out any old server instances, starting the name service from scratch, starting the replication manager, starting the servers, starting the clients, waiting for the clients to exit, telling the servers to exit, and waiting for the servers to exit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interRequestTime

protected int interRequestTime
Time between requests


replySize

protected int replySize
Size of reply


processInfoComparator

protected static final ProcessInfoComparator<ProcessInfo> processInfoComparator
Singleton instance of the ProcessInfoComparator


servers

protected Set<ProcessInfo> servers
Our servers


allServers

protected Set<String> allServers
All servers that are defined, because we need to kill them all on startup


clients

protected Set<ProcessInfo> clients
Our clients


allClients

protected Set<String> allClients
All clients that are defined, because we need to kill them all on startup


sacredServer

protected ProcessInfo sacredServer
Our name and replication server


projectRoot

protected String projectRoot
The project root folder


faultInjection

protected boolean faultInjection
Whether or not fault injection is enabled


faultInjectionMinDelay

protected int faultInjectionMinDelay
The minimum delay of the fault injection in milliseconds


faultInjectionMaxDelay

protected int faultInjectionMaxDelay
The maximum delay of the fault injection in milliseconds


killOnly

protected boolean killOnly
When true, the testing manager will only kill everything


getLotsModeCount

protected int getLotsModeCount
When not 0, how many invocations of getLotsMode should be performed


recoveryTimeout

protected int recoveryTimeout
The wait timeout to use during fault recoveries


detectionTimeout

protected int detectionTimeout
The wait timeout to use during fault detections


orb

protected ORB orb
Object request broker


jdbcURL

private String jdbcURL
The JDBC URL


jdbcUsername

private String jdbcUsername
The JDBC user name


jdbcPassword

private String jdbcPassword
The JDBC password


stdErrWriter

protected BufferedWriter stdErrWriter
A writer for stderr

Constructor Detail

RunOne

public RunOne(String projectRoot,
              int numClients,
              int numServers,
              int interRequestTime,
              int replySize,
              boolean faultInjection,
              int faultInjectionMinDelay,
              int faultInjectionMaxDelay,
              boolean killOnly,
              int getLotsMode,
              int detectionTimeout,
              int recoveryTimeout,
              String jdbcURL,
              String jdbcUsername,
              String jdbcPassword)
       throws IOException
Creates a new test case runner

Parameters:
projectRoot - The project's root folder to use for this test case run
numClients - The number of clients to use in this test case run
numServers - The number of servers to use in this test case run
interRequestTime - The amount of time in milliseconds to wait between client invocations
replySize - The size of the replies from the server in bytes
faultInjection - True if fault injection is enabled or false if it is disabled
faultInjectionMinDelay - The minimum delay of the fault injector in milliseconds
faultInjectionMaxDelay - The maximum delay of the fault injector in milliseconds
getLotsMode - When not zero, this is the number of iterations to run in getLotsMode on the client. When zero or less, the client is run with the predefined test suite
detectionTimeout - The fault detection timeout value to pass to the replication manager
recoveryTimeout - The fault recovery timeout value to pass to clients
jdbcURL - The JDBC URL to use in the database connection
jdbcUsername - The username to use in the database connection
jdbcPassword - The password to use in the database connection
Throws:
IOException - Thrown if an IOException is thrown during the processing
Method Detail

main

public static void main(String[] args)
Run the tests as specified on the command line

Parameters:
args - The command line arguments

populateSet

protected static void populateSet(Set<String> set,
                                  Reader input)
                           throws IOException
Populates a Set from individual lines of a reader

Parameters:
set - The Set to populate
input - The Reader to read lines from
Throws:
IOException - Thrown if an IOException arises during processing

ensureOutputFoldersExist

protected void ensureOutputFoldersExist()
Ensures that the output folders exist, which the programs write stdout or stderr to, depending on the program


run

public void run()
Runs this test's configuration by cleaning out any old server instances, starting the name service from scratch, starting the replication manager, starting the servers, starting the clients, waiting for the clients to exit, telling the servers to exit, and waiting for the servers to exit

Specified by:
run in interface Runnable