Derby
  1. Derby
  2. DERBY-6164 Improve Derby's Code Coverage - GSoC 2013 Project
  3. DERBY-2343

sysinfo API only returns correct information for the first jar file on the classpath

    Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
    • Fix Version/s: None
    • Component/s: Tools
    • Urgency:
      Low

      Description

      While updating the sysinfo_api test to our current JUnit usage, I rediscovered the problem which has kept this test from running on a regular basis: when running the test from jar files, only the first jar file on the classpath properly reports its information through the sysinfo API.

      It is not a security manager issue, as disabling the security manager did not solve the problem. There may be jar-sealing issues involved, but I haven't looked into the issue very deeply. Just noting the issue here for later investigation.

      I will commit a patch which updates the current sysinfo_api test to be called SysinfoAPITest, and also add a note to tools._Suite about the problem.

        Issue Links

          Activity

          Hide
          Myrna van Lunteren added a comment -

          I think this is referring to the fact that sometimes people (accidentally) load two derby.jar files on their CLASSPATH. And I think sysinfo can only reflect one.
          So if someone hangs a derby.jar from 10.10.1.1 and 10.8 in the CLASSPATH, it will likely only show the first one, or at least only reflect the version of the first one.

          Show
          Myrna van Lunteren added a comment - I think this is referring to the fact that sometimes people (accidentally) load two derby .jar files on their CLASSPATH. And I think sysinfo can only reflect one. So if someone hangs a derby.jar from 10.10.1.1 and 10.8 in the CLASSPATH, it will likely only show the first one, or at least only reflect the version of the first one.
          Hide
          ahsan shamsudeen added a comment -

          what does this exactly mean "sysinfo API only returns correct information for the first jar file on the classpath"

          Thanks,
          Ahsan

          Show
          ahsan shamsudeen added a comment - what does this exactly mean "sysinfo API only returns correct information for the first jar file on the classpath" Thanks, Ahsan
          Hide
          ahsan shamsudeen added a comment -

          Hi Bryan,

          I used to run the test using my IDE(Eclipse) and got the message as described. In SysinfoAPITest all the the methods has passed the test except testBuildNumber() . Do you have the same scenario or a different one ?

          Thanks,
          Ahsan

          Show
          ahsan shamsudeen added a comment - Hi Bryan, I used to run the test using my IDE(Eclipse) and got the message as described. In SysinfoAPITest all the the methods has passed the test except testBuildNumber() . Do you have the same scenario or a different one ? Thanks, Ahsan
          Hide
          Bryan Pendleton added a comment -

          Hi Ahsan,

          I'm not sure what is giving you that message; I definitely
          get a different message when I try to run SysinfoAPITest.

          Exactly what command did you invoke to run the SysinfoAPITest?

          Here are two different ways that I use to run the test:

          1) ant -Dderby.junit.testclass=org.apache.derbyTesting.functionTests.tests.tools.SysinfoAPITest junit-single

          2) java -cp \users\Bryan\derby\trunk\jars\sane\derbyrun.jar;\users\bryan\derby\trunk\jars\sane\derbyTesting.jar;\users\bryan\derby\trunk\tools\java\junit.jar;\users\bryan\derby\trunk\tools\java\jakarta-oro-2.0.8.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.tools.SysinfoAPITest

          Show
          Bryan Pendleton added a comment - Hi Ahsan, I'm not sure what is giving you that message; I definitely get a different message when I try to run SysinfoAPITest. Exactly what command did you invoke to run the SysinfoAPITest? Here are two different ways that I use to run the test: 1) ant -Dderby.junit.testclass=org.apache.derbyTesting.functionTests.tests.tools.SysinfoAPITest junit-single 2) java -cp \users\Bryan\derby\trunk\jars\sane\derbyrun.jar;\users\bryan\derby\trunk\jars\sane\derbyTesting.jar;\users\bryan\derby\trunk\tools\java\junit.jar;\users\bryan\derby\trunk\tools\java\jakarta-oro-2.0.8.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.tools.SysinfoAPITest
          Hide
          ahsan shamsudeen added a comment -

          According to code coverage analysis of EMMA and Jacoco, org.apache.derby.tools.sysinfo has a poor code coverage.

          But , Derby has test for this class in org.apache.derbyTesting.functionTests.tests.tools.SysinfoAPITest. So, the problem is this test are not taken into account by coverage suites.

          When I run the unit test for SysinfoAPITest, it throws following message
          svn: E155036: Working copy '\Workspace\derby' is too old (format 9, created by Subversion 1.5)

          But, Derby currently released Apache Subversion 1.8.1. Does this cause any issues ?

          Thanks,
          Ahsan

          Show
          ahsan shamsudeen added a comment - According to code coverage analysis of EMMA and Jacoco, org.apache.derby.tools.sysinfo has a poor code coverage. But , Derby has test for this class in org.apache.derbyTesting.functionTests.tests.tools.SysinfoAPITest. So, the problem is this test are not taken into account by coverage suites. When I run the unit test for SysinfoAPITest, it throws following message svn: E155036: Working copy '\Workspace\derby' is too old (format 9, created by Subversion 1.5) But, Derby currently released Apache Subversion 1.8.1. Does this cause any issues ? Thanks, Ahsan

            People

            • Assignee:
              ahsan shamsudeen
              Reporter:
              Andrew McIntyre
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development