org.benow.web.test
Class TesterServiceImpl

java.lang.Object
  extended by org.benow.web.test.TesterServiceImpl
All Implemented Interfaces:
org.benow.java.spec.Markup, org.benow.service.Service, TesterService

public class TesterServiceImpl
extends java.lang.Object
implements TesterService


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.benow.java.spec.Markup
org.benow.java.spec.Markup.ParamName, org.benow.java.spec.Markup.ReturnDescription
 
Field Summary
static java.lang.String SESSION_RECORDING
           
 
Constructor Summary
TesterServiceImpl()
           
 
Method Summary
 void addTest(TestStep test)
          Add a given test
 TestResult getLastRun(java.lang.Object key)
          Get the last run test of the given key
 ResultStreamer getResultDiff(java.lang.Object fromKey, java.lang.Object toKey)
          Gets a graphical diff between two runs
 ResultWriter getResultStream(java.lang.Object key)
          Get the html stream for given key
 TestStep getTest(java.lang.Object key)
          Get the test with the given key
 java.util.List<TestResult> getTestHistory(java.lang.Object key)
           
 TestResult getTestRun(java.lang.Object key)
          Get run with given key
 java.util.List<TestStep> getTests()
           
 void removeTestRuns(java.util.List<TestResult> runs)
          Remove the given runs
 void removeTests(java.util.List<TestStep> tests)
          Remove the given tests
 TestResult runTest(java.lang.Object key)
          Run the given test.
 void runTests()
          Run all tests
 void stampAll()
          Accept all current result values.
 void stampAsExpected(java.lang.Object key)
          Use the given result as the expected for the step
 void startRecording()
          Start recording tests.
 void stopRecording()
          Stop recording tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_RECORDING

public static final java.lang.String SESSION_RECORDING
See Also:
Constant Field Values
Constructor Detail

TesterServiceImpl

public TesterServiceImpl()
Method Detail

addTest

public void addTest(TestStep test)
Description copied from interface: TesterService
Add a given test

Specified by:
addTest in interface TesterService

startRecording

public void startRecording()
Description copied from interface: TesterService
Start recording tests. Navigation will cause posts and gets to be recorded along with the resulting html. The requests make up a test and these tests can be repeated with the result compared to the known good.

Specified by:
startRecording in interface TesterService

getTest

public TestStep getTest(java.lang.Object key)
                 throws org.benow.repository.NoSuchObjectException
Description copied from interface: TesterService
Get the test with the given key

Specified by:
getTest in interface TesterService
Returns:
Throws:
org.benow.repository.NoSuchObjectException

getTests

public java.util.List<TestStep> getTests()
Specified by:
getTests in interface TesterService
Returns:
all recorded tests

getTestHistory

public java.util.List<TestResult> getTestHistory(java.lang.Object key)
                                          throws org.benow.repository.NoSuchObjectException
Specified by:
getTestHistory in interface TesterService
Throws:
org.benow.repository.NoSuchObjectException

runTest

public TestResult runTest(java.lang.Object key)
                   throws org.benow.repository.NoSuchObjectException,
                          java.lang.Exception
Description copied from interface: TesterService
Run the given test.

Specified by:
runTest in interface TesterService
Throws:
org.benow.repository.NoSuchObjectException
java.lang.Exception

runTests

public void runTests()
Description copied from interface: TesterService
Run all tests

Specified by:
runTests in interface TesterService

stopRecording

public void stopRecording()
Description copied from interface: TesterService
Stop recording tests.

Specified by:
stopRecording in interface TesterService

getLastRun

public TestResult getLastRun(java.lang.Object key)
Description copied from interface: TesterService
Get the last run test of the given key

Specified by:
getLastRun in interface TesterService
Returns:

getTestRun

public TestResult getTestRun(java.lang.Object key)
                      throws org.benow.repository.NoSuchObjectException
Description copied from interface: TesterService
Get run with given key

Specified by:
getTestRun in interface TesterService
Returns:
Throws:
org.benow.repository.NoSuchObjectException

getResultStream

public ResultWriter getResultStream(java.lang.Object key)
                             throws org.benow.repository.NoSuchObjectException
Description copied from interface: TesterService
Get the html stream for given key

Specified by:
getResultStream in interface TesterService
Returns:
Throws:
org.benow.repository.NoSuchObjectException

stampAsExpected

public void stampAsExpected(java.lang.Object key)
                     throws org.benow.repository.NoSuchObjectException
Description copied from interface: TesterService
Use the given result as the expected for the step

Specified by:
stampAsExpected in interface TesterService
Throws:
org.benow.repository.NoSuchObjectException

removeTestRuns

public void removeTestRuns(java.util.List<TestResult> runs)
                    throws org.benow.repository.ObjectRepositoryError,
                           org.benow.repository.NoSuchObjectException
Description copied from interface: TesterService
Remove the given runs

Specified by:
removeTestRuns in interface TesterService
Throws:
org.benow.repository.ObjectRepositoryError
org.benow.repository.NoSuchObjectException

removeTests

public void removeTests(java.util.List<TestStep> tests)
                 throws org.benow.repository.ObjectRepositoryError,
                        org.benow.repository.NoSuchObjectException
Description copied from interface: TesterService
Remove the given tests

Specified by:
removeTests in interface TesterService
Throws:
org.benow.repository.ObjectRepositoryError
org.benow.repository.NoSuchObjectException

stampAll

public void stampAll()
Description copied from interface: TesterService
Accept all current result values. Used when a change to a major file (ie site.xsl) has caused all valid tests to be no longer valid.

Specified by:
stampAll in interface TesterService

getResultDiff

public ResultStreamer getResultDiff(java.lang.Object fromKey,
                                    java.lang.Object toKey)
                             throws org.benow.repository.NoSuchObjectException,
                                    java.io.IOException
Description copied from interface: TesterService
Gets a graphical diff between two runs

Specified by:
getResultDiff in interface TesterService
Throws:
org.benow.repository.NoSuchObjectException
java.io.IOException