| jacareto.test.Test jacareto.test.JComponentTest
All known Subclasses: jacareto.test.JTabbedPaneTest, jacareto.test.AbstractButtonTest, jacareto.test.JLabelTest, jacareto.test.JSliderTest, jacareto.test.JComboBoxTest, jacareto.test.JMenuBarTest, jacareto.test.JSpinnerTest, jacareto.test.JTextComponentTest, jacareto.test.JPopupMenuTest, jacareto.test.JListTest, jacareto.test.JTableTest,
JComponentTest | public class JComponentTest extends Test (Code) | | This class implements test functionality for
javax.swing.JComponent instances and is
extended by all test classes for swing components. The following criteria are tested by this
class:
-
is enabled - testes whether the JComponent is enabled
-
is focused - testes whether the JComponent has the focus
If you extend this class you should override the two protected methods
JComponentTest.doTest(Component) and
JComponentTest.correct(Component) , call super() and add specific
functionality afterwards.
author: Juri Frommer version: 1.2 |
Constructor Summary | |
public | JComponentTest(Environment env, String componentName, boolean isIgnoring, boolean isCorrecting, boolean hasFocus, boolean isEnabled) Creates a new test with the specified values. | public | JComponentTest(Environment env, Components components, Component component) Creates a new test with the values of the given component and default values.
Parameters: env - the environment. Parameters: components - the components instance Parameters: component - the component to test. | public | JComponentTest() Creates a new test with default values and no environment. |
JComponentTest | public JComponentTest(Environment env, String componentName, boolean isIgnoring, boolean isCorrecting, boolean hasFocus, boolean isEnabled)(Code) | | Creates a new test with the specified values.
Parameters: env - env the environment Parameters: componentName - the name of the component Parameters: isIgnoring - if the test result should be ignored Parameters: isCorrecting - if the values of the component should be corrected when the test hasfailed Parameters: hasFocus - if the component has the focus Parameters: isEnabled - if the component is set enabled |
JComponentTest | public JComponentTest(Environment env, Components components, Component component)(Code) | | Creates a new test with the values of the given component and default values.
Parameters: env - the environment. Parameters: components - the components instance Parameters: component - the component to test. Must be of type javax.swing.JComponent . |
appendToEvaluationMessage | protected void appendToEvaluationMessage(String appendix)(Code) | | Appends the argument to the evaluation message
Parameters: appendix - the string to append tpo the evaluation message |
correct | protected void correct(Component component)(Code) | | Sets the expected values on the tested component. Should be overridden by subclasses and
then called via super . Called by the method
JComponentTest.evaluate(Components) .
Parameters: component - the component to correct |
doTest | protected boolean doTest(Component component)(Code) | | Performs the test. Should be overridden by subclasses and then called via
super . Called by the method
JComponentTest.evaluate(Components) .
Parameters: component - the comonent to perform the test on. true if the test on component succeeds, otherwisefalse |
evaluateChild | protected boolean evaluateChild(Test child, Components components)(Code) | | Evaluates a subtest
Parameters: child - the subtest to evaluate Parameters: components - the components containing the component which will be tested bychild true if the test succeeds, false otherwise |
hasFocus | public boolean hasFocus()(Code) | | DOCUMENT ME!
true if the tested component must have the focus, if notfalse . |
hasProcTime | public boolean hasProcTime()(Code) | | |
isEnabled | public boolean isEnabled()(Code) | | DOCUMENT ME!
true if the tested component is expected to be enabled, if notfalse . |
setEnabled | public void setEnabled(boolean isEnabled)(Code) | | DOCUMENT ME!
Parameters: isEnabled - if the tested component is expected to be be enabled. |
setFocus | public void setFocus(boolean b)(Code) | | DOCUMENT ME!
Parameters: b - if the tested component should have the focus. |
|
|