Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3840

The test code executes java processes by just executing java instead of using a full path. This may cause the wrong java to be picked up.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5.1.1
    • Fix Version/s: 10.5.1.1
    • Component/s: Test
    • Labels:
      None
    • Issue & fix info:
      Newcomer

      Description

      There are places in the code where we execute a java process. e.g. BaseTestCase.assertExecJavaCmdAsExpected where we execcute a java process and just call "java". In windows at least the new shell created for the exec'ed process does not share the parent process path but rather picks up the path from the Windows System variables. This can cause the wrong java to be picked up. Also the method does not work for j9 because it calls "java" instead of the actual executable name. Perhaps we should have a method:

      public static final String getJavaExecutableName()

      { String vmname = getSystemProperty("com.ibm.oti.vm.exe"); if (vmname == null) vmname = getSystemProperty("java.home") + File.pathSeparator + "java"; return vmname; }

      There are also issues with this in NetworkServerControlApiTest. NetworkServerTestSetup and the replication tests and maybe others as well.

        Attachments

        1. DERBY-3840_diff2.txt
          10 kB
          Katherine Marsden
        2. DERBY-3840_diff.txt
          10 kB
          Katherine Marsden

          Activity

            People

            • Assignee:
              kmarsden Katherine Marsden
              Reporter:
              kmarsden Katherine Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: