edu.cornell.cs.sam.ui
Class TestScript

java.lang.Object
  extended by edu.cornell.cs.sam.ui.TestScript

public class TestScript
extends java.lang.Object

This class holds an execution script to test multiple sam files and report the results.


Nested Class Summary
static class TestScript.Test
          Represents one single test
static class TestScript.TestScriptException
           
static class TestScript.TestThread
           
 
Field Summary
protected  Memory mem
           
protected  Processor proc
           
protected  java.io.File sourceFile
           
protected  Sys sys
           
protected  java.util.List<TestScript.Test> tests
           
 
Constructor Summary
TestScript()
          Creates a new TestScript
 
Method Summary
protected static void addIO(org.w3c.dom.Document xmlDoc, org.w3c.dom.Element testElem, java.lang.String classParam, java.lang.Object o)
           
protected static void addIOType(org.w3c.dom.Document xmlDoc, org.w3c.dom.Element testElem, java.lang.String classParam, java.util.Collection<?> coll)
           
 void clearTests()
          Remove all tests from this script
 void deleteTests()
          Deletes all of the tests that have been marked
 java.io.File getSourceFile()
          Returns the file this TestScript is using
 java.util.List<TestScript.Test> getTests()
          Return the vector of the tests
 void load(java.io.InputStream toParse)
          Loads the provided input stream
protected  TestScript.Test processTest(org.w3c.dom.Element e)
          Processes an individual test element
 void save(java.io.File toSave)
          Saves the test script to a file
 void setSourceFile(java.io.File file)
          Sets the file this testscript will load
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sys

protected Sys sys

proc

protected Processor proc

mem

protected Memory mem

tests

protected java.util.List<TestScript.Test> tests

sourceFile

protected java.io.File sourceFile
Constructor Detail

TestScript

public TestScript()
Creates a new TestScript

Method Detail

getSourceFile

public java.io.File getSourceFile()
Returns the file this TestScript is using

Returns:
the source file

setSourceFile

public void setSourceFile(java.io.File file)
Sets the file this testscript will load

Parameters:
file - the file to load

load

public void load(java.io.InputStream toParse)
          throws TestScript.TestScriptException
Loads the provided input stream

Parameters:
toParse - The stream on which the XML file can be read
Throws:
TestScript.TestScriptException - if there is a problem parsing the XML file

processTest

protected TestScript.Test processTest(org.w3c.dom.Element e)
                               throws TestScript.TestScriptException
Processes an individual test element

Throws:
TestScript.TestScriptException

save

public void save(java.io.File toSave)
          throws TestScript.TestScriptException
Saves the test script to a file

Parameters:
toSave - the file to save the XML test script to
Throws:
TestScript.TestScriptException - if there is an error writing the file

addIOType

protected static void addIOType(org.w3c.dom.Document xmlDoc,
                                org.w3c.dom.Element testElem,
                                java.lang.String classParam,
                                java.util.Collection<?> coll)

addIO

protected static void addIO(org.w3c.dom.Document xmlDoc,
                            org.w3c.dom.Element testElem,
                            java.lang.String classParam,
                            java.lang.Object o)

getTests

public java.util.List<TestScript.Test> getTests()
Return the vector of the tests

Returns:
the tests

clearTests

public void clearTests()
Remove all tests from this script


deleteTests

public void deleteTests()
Deletes all of the tests that have been marked

See Also:
TestScript.Test.delete()