public class TestableCell extends CellExtension
Constructor and Description |
---|
TestableCell(Cell cell)
Creates a testable cell extension for the given cell.
|
Modifier and Type | Method and Description |
---|---|
void |
addTestableCellListener(TestableCellListener listener)
Registers the given listener on the cell.
|
TestCaseParam |
addTestCaseParam(Value value)
Add a test case parameter to the cell's set of test case parameters.
|
TestCaseParam |
addTestCaseParam(Value value,
TestCaseParam.Type type)
Add a test case parameter to the cell's set of test case parameters.
|
protected boolean |
allPrecedentsHaveParams()
Tests if all of the cells precedents have test case parameters.
|
void |
cellCleared(Cell cell)
Removes the test case parameters from the cell.
|
void |
cellCopied(Cell cell,
Cell source)
Copies the user-specified test case parameters from the source cell to
this one.
|
void |
contentChanged(Cell cell)
Invoked to indicate that the content of the cell in the spreadsheet was
modified and that test cases and test case paremeters that depend on that
data must be updated, and new ones generated.
|
protected void |
extendTestCases(TestableCell firstPrec,
TestCaseParam param) |
protected void |
fireTestCaseParametersChanged()
Notifies all registered listeners that the cell's test case parameters changed.
|
protected void |
fireTestCasesChanged()
Notifies all registered listeners that the cell's test cases changed.
|
Set<TestCaseParam> |
getTestCaseParams()
Returns the cell's test case parameters.
|
Set<TestCase> |
getTestCases()
Returns the test cases for the cell, which consist of a predetermined
value for each of the cell's precedents.
|
double |
getTestedness()
Returns the testedness of the cell, i.e. the ratio of valid
test cases to available test cases in the cell.
|
boolean |
hasTestCaseParams()
Returns whether the cell has any test case parameters.
|
boolean |
hasTestCases()
Returns whether the cell has any test cases.
|
boolean |
hasTestError()
Returns whether any of the cell's test cases have been rejected.
|
void |
precedentAddedParam(TestableCell cell,
TestCaseParam param)
Invoked when a test case parameter is added to one of the cell's
precedents.
|
void |
precedentRemovedParam(TestableCell cell,
TestCaseParam param)
Invoked when a test case parameter is removed from one of the cell's
precedents.
|
protected void |
removeAllTcpsOfType(TestCaseParam.Type type) |
void |
removeTestableCellListener(TestableCellListener listener)
Removes the given listener from the cell.
|
void |
removeTestCaseParam(TestCaseParam param)
Removes a test case parameter from the cell's set of test case parameters.
|
void |
removeTestCaseParam(TestCaseParam param,
TestCaseParam.Type type)
Removes a test case parameter from the cell's set of test case parameters.
|
void |
resetTestCases()
Generates new test cases for the cell, provided that all its precedents
have test case parameters.
|
addCellListener, clear, compareTo, copyFrom, dependentsChanged, getAddress, getCellListeners, getContent, getDelegate, getDependents, getExtension, getFormula, getName, getPrecedents, getSpreadsheet, getValue, moveFrom, removeCellListener, setContent, toString, valueChanged
TestableCell(Cell cell)
cell
- the cell to extendpublic void contentChanged(Cell cell)
contentChanged
in interface CellListener
contentChanged
in class CellExtension
cell
- the cell that was modifiedpublic Set<TestCase> getTestCases()
public boolean hasTestCases()
public boolean hasTestError()
public double getTestedness()
public void resetTestCases()
protected void extendTestCases(TestableCell firstPrec, TestCaseParam param)
public Set<TestCaseParam> getTestCaseParams()
public boolean hasTestCaseParams()
protected boolean allPrecedentsHaveParams()
public TestCaseParam addTestCaseParam(Value value) throws DuplicateUserTCPException
value
- the value of the test case parameter to be addedDuplicateUserTCPException
public TestCaseParam addTestCaseParam(Value value, TestCaseParam.Type type)
value
- the value of the test case parameter to be addedtype
- the type of test case parameterpublic void removeTestCaseParam(TestCaseParam param)
param
- the test case parameter to be removedpublic void removeTestCaseParam(TestCaseParam param, TestCaseParam.Type type)
param
- the test case parameter to be removedtype
- the type of the parameter to removeprotected void removeAllTcpsOfType(TestCaseParam.Type type)
public void precedentAddedParam(TestableCell cell, TestCaseParam param)
cell
- the precedent to which the test case parameter was addedparam
- the test case parameter that was addedpublic void precedentRemovedParam(TestableCell cell, TestCaseParam param)
cell
- the precedent from which the test case parameter was removedparam
- the test case parameter that was removedpublic void cellCleared(Cell cell)
cellCleared
in interface CellListener
cellCleared
in class CellExtension
cell
- the cell that was modifiedpublic void cellCopied(Cell cell, Cell source)
cellCopied
in interface CellListener
cellCopied
in class CellExtension
cell
- the cell that was modifiedsource
- the cell from which data was copiedpublic void addTestableCellListener(TestableCellListener listener)
listener
- the listener to be addedpublic void removeTestableCellListener(TestableCellListener listener)
listener
- the listener to be removedprotected void fireTestCasesChanged()
protected void fireTestCaseParametersChanged()