Class AbstractHtmlUnitScriptTestCase


  • public abstract class AbstractHtmlUnitScriptTestCase
    extends AbstractTestCase
    Base class of all scripted tests that use the Action-based API.
    • Constructor Detail

      • AbstractHtmlUnitScriptTestCase

        public AbstractHtmlUnitScriptTestCase​(java.lang.String baseUrl)
        Constructor.
        Parameters:
        baseUrl - the base URL to use for resolution of relative URLs
      • AbstractHtmlUnitScriptTestCase

        public AbstractHtmlUnitScriptTestCase()
        Default constructor.
    • Method Detail

      • __setUpAbstractHtmlUnitScriptTestCase

        public final void __setUpAbstractHtmlUnitScriptTestCase()
        Performs additional setup tasks for HtmlUnit/action-based exported script test cases. Don't call this method directly, it will be called implicitly by the JUnit framework.
      • __cleanUpAbstractHtmlUnitScriptTestCase

        public final void __cleanUpAbstractHtmlUnitScriptTestCase()
        Performs additional cleanup tasks for HtmlUnit/action-based exported script test cases. Don't call this method directly, it will be called implicitly by the JUnit framework.
      • resolve

        protected java.lang.String resolve​(java.lang.String resolvable)
        Resolves the given string.
        Parameters:
        resolvable - the string to be resolved
        Returns:
        the resolved string
      • resolveKey

        protected java.lang.String resolveKey​(java.lang.String key)
        Resolves the given test data key.
        Parameters:
        key - the key string containing only the name of a test data field
        Returns:
        resolved string or null if not found
      • evaluatesToTrue

        protected boolean evaluatesToTrue​(java.lang.String jsExpression)
        Returns whether or not the given expression evaluates to true.
        Parameters:
        jsExpression - the JavaScript expression to evaluate
        Returns:
        true if and only if the given JavaScript expression is not blank and evaluates to true