cdx.scorebot.net.tests
Class TestItem

java.lang.Object
  extended by cdx.scorebot.net.tests.TestItem
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TestItem>

public class TestItem
extends java.lang.Object
implements java.lang.Comparable<TestItem>, java.io.Serializable

contains a specific instance of a Test and the configuration information for when and how to run it

Author:
David Underhill
See Also:
Serialized Form

Constructor Summary
TestItem(Test testType)
          Creates a TestItem for the specified test with its default option values.
TestItem(Test testType, Configuration config)
          Creates a TestItem for the specified test with its default option values.
 
Method Summary
 int compareTo(TestItem anotherTestItem)
          Compares the names of two test items lexicographically, ignoring case considerations
 boolean equals(java.lang.Object o)
           
 Configuration getConfig()
          gets the config values to run the test with (may include variables)
 Test getConfiguredTest()
          Gets a configured copy of the Test type in this TestItem
 java.lang.String getDescription()
          gets what this test item does
 java.lang.String getName()
          gets unique name of this test item (will not contain spaces)
 java.util.Vector<java.lang.String> getResultNames()
          gets the results the test this contains will return (from the scorebot static info file)
 TestSchedule getSchedule()
          gets when to run this test item's test
 java.lang.String getTestDescription()
          gets a description of the test
 java.lang.String getTestName()
          gets the name of the test
 Test getTestType()
          gets the test this item configures (used to instantiate configured copies of this test)
 int hashCode()
          creates a hashcode by comining the hashcodes for name, description, and test name into a long and using its hashcode
 void setDescription(java.lang.String description)
          sets what this test item does
 void setName(java.lang.String name)
          sets unique name of this test item (no spaces are allowed, so all spaces are replaced with underscores)
 java.lang.String toString()
          returns the name of this test item
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestItem

public TestItem(Test testType)
Creates a TestItem for the specified test with its default option values.

Parameters:
testType - the type of test this item configures

TestItem

public TestItem(Test testType,
                Configuration config)
Creates a TestItem for the specified test with its default option values.

Parameters:
testType - the type of test this item configures
Method Detail

compareTo

public int compareTo(TestItem anotherTestItem)
Compares the names of two test items lexicographically, ignoring case considerations

Specified by:
compareTo in interface java.lang.Comparable<TestItem>
Parameters:
anotherTestItem - the TestItem to be compared
Returns:
a negative integer, zero, or a positive integer as this TestItem's name comes before or after, or is equal to, the specified TestItem.

equals

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

getConfiguredTest

public Test getConfiguredTest()
Gets a configured copy of the Test type in this TestItem

Returns:
A configured instantation of the Test type which this TestItem contains. This is configured which means a copy of the configuration has been given to it. Any ConfigVariableOption options have been advanced appropriately.

hashCode

public int hashCode()
creates a hashcode by comining the hashcodes for name, description, and test name into a long and using its hashcode

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
returns the name of this test item

Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()
gets unique name of this test item (will not contain spaces)


setName

public void setName(java.lang.String name)
             throws IllegalArgValException
sets unique name of this test item (no spaces are allowed, so all spaces are replaced with underscores)

Throws:
IllegalArgValException

getDescription

public java.lang.String getDescription()
gets what this test item does


setDescription

public void setDescription(java.lang.String description)
sets what this test item does


getSchedule

public TestSchedule getSchedule()
gets when to run this test item's test


getConfig

public Configuration getConfig()
gets the config values to run the test with (may include variables)


getTestType

public Test getTestType()
gets the test this item configures (used to instantiate configured copies of this test)


getResultNames

public java.util.Vector<java.lang.String> getResultNames()
gets the results the test this contains will return (from the scorebot static info file)


getTestName

public java.lang.String getTestName()
gets the name of the test


getTestDescription

public java.lang.String getTestDescription()
gets a description of the test