Cargo
  1. Cargo
  2. CARGO-649

Create Samples TestCase for System Classpath

    Details

    • Type: Test Test
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 1.0
    • Component/s: Core
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      It is currently difficult to ensure all containers' are coded properly such that classpath entries indeed exist when they start. Troubleshooting is manual, as we have to dig through cargo.log looking to see if it work.

      Please create a Samples TestCase that can do this.

        Activity

        Hide
        Adrian Cole added a comment -

        One approach could be to make a new samples war called classpath-war. This war's index.jsp would return successfully if it can load the class identified by the system property class.to.search.for

        ex. Class.forName(System.getProperty("class.to.search.for"))

        in the samples pom, we could setup this property to be something known, but not normally a part of a java container (ex. derby's driver).

        In the unit test, it could configure a classpath entry and then pass the property class.to.search.for to the container before running the test.

        Show
        Adrian Cole added a comment - One approach could be to make a new samples war called classpath-war. This war's index.jsp would return successfully if it can load the class identified by the system property class.to.search.for ex. Class.forName(System.getProperty("class.to.search.for")) in the samples pom, we could setup this property to be something known, but not normally a part of a java container (ex. derby's driver). In the unit test, it could configure a classpath entry and then pass the property class.to.search.for to the container before running the test.
        Hide
        Adrian Cole added a comment -

        added a new samples test webapp: classpath-war

        This is invoked by ExtraClasspathOnStandaloneConfigurationTest

        This war sets extraclasspath to include the file at System.getProperty("cargo.testdata.derby-jar")

        It then tries to lookup the class:
        "org.apache.derby.jdbc.EmbeddedDriver"

        Show
        Adrian Cole added a comment - added a new samples test webapp: classpath-war This is invoked by ExtraClasspathOnStandaloneConfigurationTest This war sets extraclasspath to include the file at System.getProperty("cargo.testdata.derby-jar") It then tries to lookup the class: "org.apache.derby.jdbc.EmbeddedDriver"
        Hide
        Matt Wringe added a comment -

        The test has been updated to use a simple jar instead of the Derby jar.
        Trying to access classes from the Derby jar can cause issues on some of the containers.

        For future tests, please make sure they pass on at least all of the stable supported containers.

        Show
        Matt Wringe added a comment - The test has been updated to use a simple jar instead of the Derby jar. Trying to access classes from the Derby jar can cause issues on some of the containers. For future tests, please make sure they pass on at least all of the stable supported containers.

          People

          • Assignee:
            Adrian Cole
            Reporter:
            Adrian Cole
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: