Class RequestParser

java.lang.Object
org.apache.sling.junit.RequestParser
All Implemented Interfaces:
TestSelector

public class RequestParser extends Object implements TestSelector
Parse information from a request, to define which tests to run and which renderer to select. We do not use the Sling API to to that, in order to keep the junit core module reusable in other OSGi environments.
  • Constructor Details

    • RequestParser

      public RequestParser(String subpath)
      Parse subpath, which is in the form TEST_SELECTOR/TEST_METHOD.EXTENSION or TEST_SELECTOR.EXTENSION
      Parameters:
      subpath - the sub-path
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTestSelectorString

      public String getTestSelectorString()
      Description copied from interface: TestSelector
      Return the String used to select tests
      Specified by:
      getTestSelectorString in interface TestSelector
      Returns:
      the string used to select the tests
    • getExtension

      public String getExtension()
      Description copied from interface: TestSelector
      Return the extension used to render results
      Specified by:
      getExtension in interface TestSelector
      Returns:
      the extension used to render the results
    • getMethodName

      public String getMethodName()
    • acceptTestName

      public boolean acceptTestName(String testName)
      Description copied from interface: TestSelector
      If true, testName will be selected
      Specified by:
      acceptTestName in interface TestSelector
      Parameters:
      testName - the name of the test
      Returns:
      true if the test will be selected, false otherwise
    • getSelectedTestMethodName

      public String getSelectedTestMethodName()
      Description copied from interface: TestSelector
      Returns the name of the selected test.
      Specified by:
      getSelectedTestMethodName in interface TestSelector
      Returns:
      the name of the selected test