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

          Bertrand Delacretaz created issue -
          Bertrand Delacretaz made changes -
          Field Original Value New Value
          Summary Creating a sample that demonstrates our testing tools and techniques Create a sample that demonstrates our testing tools and techniques
          Bertrand Delacretaz made changes -
          Link This issue is blocked by SLING-1963 [ SLING-1963 ]
          Bertrand Delacretaz committed 1071210 (2 files)
          Reviews: none

          SLING-1981 - reorganize testing samples

          Bertrand Delacretaz committed 1071274 (1 file)
          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
          Bertrand Delacretaz made changes -
          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:

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

          The tests should run in the integration-tests phase of the Maven build.
          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 waiting 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.
          Bertrand Delacretaz made changes -
          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 waiting 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.
          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.
          Bertrand Delacretaz made changes -
          Link This issue is related to SLING-1963 [ SLING-1963 ]
          Bertrand Delacretaz committed 1073409 (1 file)
          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.
          Bertrand Delacretaz made changes -
          Labels integration-tests junit testing
          Bertrand Delacretaz committed 1074158 (27 files)
          Reviews: none

          SLING-1981 - fork the stanbol helper classes here to avoid depending on SNAPSHOTS - the http stuff might move to httpclient anyway

          sling trunk
          Bertrand Delacretaz committed 1074212 (12 files)
          Reviews: none

          SLING-1981 - support running single tests methods using JUnit servlet paths like /system/sling/junit/TEST_CLASS_NAME.json/TEST_METHOD_NAME

          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
          Bertrand Delacretaz committed 1076201 (1 file)
          Reviews: none

          SLING-1981 - use random port number by default

          Bertrand Delacretaz committed 1076217 (12 files)
          Reviews: none

          SLING-1981 - move TimeoutsProvider and SlingTestBase to tools module, and improve SlingTestBase's server startup mechanism

          Bertrand Delacretaz committed 1080208 (2 files)
          Bertrand Delacretaz committed 1080210 (1 file)
          Reviews: none

          SLING-1981 - use latest httpclient, 4.1

          Bertrand Delacretaz committed 1091673 (1 file)
          Reviews: none

          SLING-1981 - prepare for release, use released launchpad

          Gavin made changes -
          Workflow no-reopen-closed,doc-test-required [ 12553010 ] Copy of no-reopen-closed,doc-test-required [ 12763249 ]
          Gavin made changes -
          Workflow Copy of no-reopen-closed,doc-test-required [ 12763249 ] no-reopen-closed,doc-test-required [ 12765293 ]
          Bertrand Delacretaz made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Gavin made changes -
          Workflow no-reopen-closed,doc-test-required [ 12765293 ] re-open possible,doc-test-required [ 12790144 ]
          Gavin made changes -
          Workflow re-open possible,doc-test-required [ 12790144 ] no-reopen-closed,doc-test-required [ 12792512 ]
          Show more

            People

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

              Dates

              • Created:
                Updated:

                Development