Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-33261

Please enhance the Java SAL object constructor to allow specifying an optional partition prefix

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: ts_middleware
    • Labels:
      None
    • Sprint:
      TSSW Sprint - Jan 31 - Feb 14
    • Team:
      Telescope and Site
    • Urgent?:
      No

      Description

      I would like each SAL unit test to run with its own LSST_DDS_PARTITION_PREFIX. In Python one can simply modify the environment before each test and it appears that C++ also supports this (Petr Kubanek?). But Java apparently cannot modify environment variables.

      So: please add an optional argument to the SAL object constructor that allows specifying the partition prefix. If omitted the environment variable should be used, and that is how we'd run in production.

        Attachments

          Issue Links

            Activity

            Show
            pkubanek Petr Kubanek added a comment - https://stackoverflow.com/questions/8168884/how-to-test-code-dependent-on-environment-variables-using-junit System Rules library shall allow env modifications: https://github.com/stefanbirkner/system-rules
            Hide
            rowen Russell Owen added a comment - - edited

            That same posting suggests Powermockito, which Wouter van Reeven is already using. In any case, if there is a reasonable way to set env vars per test, then it would be better to update the tests than modify the SAL API. That way the test runs the same SAL code branches as production code.

            Show
            rowen Russell Owen added a comment - - edited That same posting suggests Powermockito, which Wouter van Reeven is already using. In any case, if there is a reasonable way to set env vars per test, then it would be better to update the tests than modify the SAL API. That way the test runs the same SAL code branches as production code.
            Hide
            wvreeven Wouter van Reeven added a comment -

            I am willing to give the System Rules library a try. I created DM-33273 for that and linked it to this issue.

            Show
            wvreeven Wouter van Reeven added a comment - I am willing to give the System Rules library a try. I created DM-33273 for that and linked it to this issue.
            Hide
            dmills Dave Mills added a comment -

            This is no longer required as a better solution has been implemented

            Show
            dmills Dave Mills added a comment - This is no longer required as a better solution has been implemented

              People

              Assignee:
              dmills Dave Mills
              Reporter:
              rowen Russell Owen
              Watchers:
              Dave Mills, Petr Kubanek, Russell Owen, Wouter van Reeven
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.