cdx.scorebot.net
Class NetworkTestPackage

java.lang.Object
  extended by cdx.scorebot.net.NetworkTestPackage
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class NetworkTestPackage
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Contains a TestSuite for each service to be tested on a given network.

Author:
David Underhill
See Also:
Serialized Form

Nested Class Summary
 class NetworkTestPackage.Owner
          info which uniquely identifies the team who is being tested by this package
 
Field Summary
static java.lang.String EXT
          extension to use for files holding this type
 
Constructor Summary
NetworkTestPackage()
          default constructor => empty fields
 
Method Summary
 void addTestSuite(TestSuite ts)
          Adds a TestSuite to be tested.
 NetworkTestPackage clone()
          creates a deep copy of this NetworkTestPackage
 boolean equals(java.lang.Object o)
           
 java.lang.String getBasePath(java.lang.String inputPathRoot)
          gets the base path of this NTP (inputPathRoot/competitionName/teamName)
 java.lang.String getDescription()
          gets a description of this package
 int getInitScore()
          gets the initial score
 java.io.File[] getManualScoreEventFiles(java.lang.String inputPathRoot)
          gets the files which hold manual events which have exist for the specified configuration
 java.util.Vector<ManualScoreEvent> getManualScoreEvents(java.lang.String inputPathRoot)
          gets the manual score events which have exist for the specified configuration
 java.lang.String getManualScoreEventSavePath(java.lang.String inputPathRoot)
          gets the path where Manual events are saved for the specified configuration
 int getMaxScore()
          gets the maximum possible score
 int getMinScore()
          gets the minimum possible score
 NetworkTestPackage.Owner getOwner()
          gets what team is being tested
 java.lang.String getPath()
          gets the path to folder in which this network test pacakge's contents are saved (never returns null; returns the empty string instead of null)
 java.io.File[] getTestEventFiles(java.lang.String inputPathRoot)
          gets the files which hold test events which have exist for the specified configuration
 java.util.Vector<TestEvent> getTestEvents(java.lang.String inputPathRoot)
          gets the test events which have exist for the specified configuration
 java.lang.String getTestEventSavePath(java.lang.String inputPathRoot)
          gets the path where test events are saved for the specified configuration
 java.io.File[] getTestScoreEventFiles(java.lang.String inputPathRoot)
          gets the test events which have exist for the specified configuration
 java.util.Vector<TestScoreEvent> getTestScoreEvents(java.lang.String inputPathRoot)
          gets the test score events which have exist for the specified configuration
 java.lang.String getTestScoreEventSavePath(java.lang.String inputPathRoot)
          gets the path where test events are saved for the specified configuration
 TestSuite getTestSuite(int index)
          Gets the specified TestSuite
 java.util.Vector<TestSuite> getTestSuites()
          gets the test suites being tested
 boolean isTemplate()
          gets whether or not this is a template
 void removeTestSuite(int index)
          Removes the TestSuite from this NetworkTestPackage
 void setDescription(java.lang.String desc)
          sets the description of this package
 void setInitScore(int initScore)
          sets the initial score
 void setMaxScore(int maxScore)
          sets the maximum possible score
 void setMinScore(int minScore)
          sets the minimum possible score
 void setPath(java.lang.String path)
          sets the path to folder in which this network test pacakge's contents are saved
 void setTemplate(boolean template)
          sets whether or not this is a template
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXT

public static final java.lang.String EXT
extension to use for files holding this type

See Also:
Constant Field Values
Constructor Detail

NetworkTestPackage

public NetworkTestPackage()
default constructor => empty fields

Method Detail

clone

public NetworkTestPackage clone()
creates a deep copy of this NetworkTestPackage

Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getPath

public java.lang.String getPath()
gets the path to folder in which this network test pacakge's contents are saved (never returns null; returns the empty string instead of null)


setPath

public void setPath(java.lang.String path)
sets the path to folder in which this network test pacakge's contents are saved


getOwner

public NetworkTestPackage.Owner getOwner()
gets what team is being tested


getDescription

public java.lang.String getDescription()
gets a description of this package


setDescription

public void setDescription(java.lang.String desc)
sets the description of this package


addTestSuite

public void addTestSuite(TestSuite ts)
Adds a TestSuite to be tested.

Parameters:
ts - the TestSuite to add to this NetworkTestPackage

removeTestSuite

public void removeTestSuite(int index)
                     throws java.lang.ArrayIndexOutOfBoundsException
Removes the TestSuite from this NetworkTestPackage

Parameters:
index - remove the TestSuite at the specified index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.

getTestSuite

public TestSuite getTestSuite(int index)
                       throws java.lang.ArrayIndexOutOfBoundsException
Gets the specified TestSuite

Returns:
the TestSuite at the specified index in the TestSuite vector
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.

getTestSuites

public java.util.Vector<TestSuite> getTestSuites()
gets the test suites being tested


isTemplate

public boolean isTemplate()
gets whether or not this is a template


setTemplate

public void setTemplate(boolean template)
sets whether or not this is a template


getMinScore

public int getMinScore()
gets the minimum possible score


setMinScore

public void setMinScore(int minScore)
sets the minimum possible score


getMaxScore

public int getMaxScore()
gets the maximum possible score


setMaxScore

public void setMaxScore(int maxScore)
sets the maximum possible score


getInitScore

public int getInitScore()
gets the initial score


setInitScore

public void setInitScore(int initScore)
sets the initial score


getBasePath

public java.lang.String getBasePath(java.lang.String inputPathRoot)
gets the base path of this NTP (inputPathRoot/competitionName/teamName)


getTestEventSavePath

public java.lang.String getTestEventSavePath(java.lang.String inputPathRoot)
gets the path where test events are saved for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information

getTestEventFiles

public java.io.File[] getTestEventFiles(java.lang.String inputPathRoot)
gets the files which hold test events which have exist for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information

getTestEvents

public java.util.Vector<TestEvent> getTestEvents(java.lang.String inputPathRoot)
                                          throws com.thoughtworks.xstream.core.BaseException,
                                                 java.io.FileNotFoundException
gets the test events which have exist for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information
Throws:
com.thoughtworks.xstream.core.BaseException - if the object cannot be deserialized
java.io.FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

getManualScoreEventSavePath

public java.lang.String getManualScoreEventSavePath(java.lang.String inputPathRoot)
gets the path where Manual events are saved for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information

getManualScoreEventFiles

public java.io.File[] getManualScoreEventFiles(java.lang.String inputPathRoot)
gets the files which hold manual events which have exist for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information

getManualScoreEvents

public java.util.Vector<ManualScoreEvent> getManualScoreEvents(java.lang.String inputPathRoot)
                                                        throws com.thoughtworks.xstream.core.BaseException,
                                                               java.io.FileNotFoundException
gets the manual score events which have exist for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information
Throws:
com.thoughtworks.xstream.core.BaseException - if the object cannot be deserialized
java.io.FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

getTestScoreEventSavePath

public java.lang.String getTestScoreEventSavePath(java.lang.String inputPathRoot)
gets the path where test events are saved for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information

getTestScoreEventFiles

public java.io.File[] getTestScoreEventFiles(java.lang.String inputPathRoot)
gets the test events which have exist for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information

getTestScoreEvents

public java.util.Vector<TestScoreEvent> getTestScoreEvents(java.lang.String inputPathRoot)
                                                    throws com.thoughtworks.xstream.core.BaseException,
                                                           java.io.FileNotFoundException
gets the test score events which have exist for the specified configuration

Parameters:
inputPathRoot - path to the folder which contains the owner's information
Throws:
com.thoughtworks.xstream.core.BaseException - if the object cannot be deserialized
java.io.FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason