Sling
  1. Sling
  2. SLING-1981

Create a sample that demonstrates our testing tools and techniques

    Details

      Description

      Although our Launchpad tests can be used as examples of how to test Sling applications, we should create a much simpler sample project that demonstrates the following testing tools and techniques:

      1) Start a Sling instance and wait for it to be ready
      2) Run simple HTTP integration tests against that instance
      3) Run server-side JUnit tests using @TestReference to access OSGi services (SLING-1963)
      4) Run server-side scriptable tests (SLING-1963)

      The tests should run in the integration-tests phase of the Maven build.

        Issue Links

          Activity

          Hide
          Bertrand Delacretaz added a comment -

          In revision 1074212, added a mechanism to run a single test method, example:

          curl -X POST http://localhost:8080/system/sling/junit/org.apache.sling.testing.samples.sampletests.JUnit4Test.json/testRequiresBefore

          This is using the usual Sling convention, adding the test method name as a suffix after the extension

          Show
          Bertrand Delacretaz added a comment - In revision 1074212, added a mechanism to run a single test method, example: curl -X POST http://localhost:8080/system/sling/junit/org.apache.sling.testing.samples.sampletests.JUnit4Test.json/testRequiresBefore This is using the usual Sling convention, adding the test method name as a suffix after the extension
          Hide
          Bertrand Delacretaz added a comment -

          At revision 1073407 the sample runs server-side tests as part of the Maven build.

          Some tests fail by design as some of the testbundle tests fail all the time or randomly, to verify that failures are correctly reported - will need to find a way to handle that better in the Maven build, or maybe have the tests pass by default with a way of failing them manually.

          Show
          Bertrand Delacretaz added a comment - At revision 1073407 the sample runs server-side tests as part of the Maven build. Some tests fail by design as some of the testbundle tests fail all the time or randomly, to verify that failures are correctly reported - will need to find a way to handle that better in the Maven build, or maybe have the tests pass by default with a way of failing them manually.
          Hide
          Bertrand Delacretaz added a comment -

          Revision 1071581 implements steps 1) and 2) and installs the additional bundles required for 3), but does not run the server-side tests yet.

          The Stanbol SNAPSHOT dependencies must be revision 1071577 or later.

          To test, run mvn clean install on the http://svn.apache.org/repos/asf/sling/trunk/testing/samples/test-tools module

          Show
          Bertrand Delacretaz added a comment - Revision 1071581 implements steps 1) and 2) and installs the additional bundles required for 3), but does not run the server-side tests yet. The Stanbol SNAPSHOT dependencies must be revision 1071577 or later. To test, run mvn clean install on the http://svn.apache.org/repos/asf/sling/trunk/testing/samples/test-tools module

            People

            • Assignee:
              Bertrand Delacretaz
              Reporter:
              Bertrand Delacretaz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development