Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-158

[configuration][PATCH]Load from URLs and union configuration

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      The attached patch adds support for ConfigurationFactory to load configuration
      data from URLs and introduces a new <additional> section in the XML definition
      file; all configurations loaded from this section are added to a union
      configuration.

      Further details can be found in postings to the developer mailing list.

      Because these new features make use of HierarchicalConfiguration this stuff is
      contained, too.

        Activity

        Hide
        Oliver Heger added a comment -

        Created an attachment (id=8964)
        The patch file

        Show
        Oliver Heger added a comment - Created an attachment (id=8964) The patch file
        Hide
        David Eric Pugh added a comment -

        Oliver,
        I am guessing you are coding on linux? The TestConfigurationUtils fails on
        windows:

        junit.framework.ComparisonFailure: expected:<......> but was:<...c:/...>
        at junit.framework.Assert.assertEquals(Assert.java:81)
        at junit.framework.Assert.assertEquals(Assert.java:87)
        at org.apache.commons.configuration.TestConfigurationUtils.testGetURL
        (TestConfigurationUtils.java:116)

        Show
        David Eric Pugh added a comment - Oliver, I am guessing you are coding on linux? The TestConfigurationUtils fails on windows: junit.framework.ComparisonFailure: expected:<......> but was:<...c:/...> at junit.framework.Assert.assertEquals(Assert.java:81) at junit.framework.Assert.assertEquals(Assert.java:87) at org.apache.commons.configuration.TestConfigurationUtils.testGetURL (TestConfigurationUtils.java:116)
        Hide
        Oliver Heger added a comment -

        Eric,
        you are right I am working on Linux.
        Well, this time the bug seems to be in the unit test. The test in
        TestConfigurationUtils line 116 is implemented in a platform dependent manner.
        This should be fixed if you remove it and add instead the following lines at the
        end of the method:

        assertEquals(absFile.toURL(),
        ConfigurationUtils.getURL(absFile.getParent(), "config.xml"));

        This should be the portable version of the test: getURL() is called with an
        absolute base path.
        I'm sorry! Shame on me!

        Show
        Oliver Heger added a comment - Eric, you are right I am working on Linux. Well, this time the bug seems to be in the unit test. The test in TestConfigurationUtils line 116 is implemented in a platform dependent manner. This should be fixed if you remove it and add instead the following lines at the end of the method: assertEquals(absFile.toURL(), ConfigurationUtils.getURL(absFile.getParent(), "config.xml")); This should be the portable version of the test: getURL() is called with an absolute base path. I'm sorry! Shame on me!
        Hide
        David Eric Pugh added a comment -

        Patch file applied. I actually tweaked the url thing before I saw your
        message. Soemthing to think on is doing some more docs.. Things have gotton
        vastly more powerful but also more confusing!

        Show
        David Eric Pugh added a comment - Patch file applied. I actually tweaked the url thing before I saw your message. Soemthing to think on is doing some more docs.. Things have gotton vastly more powerful but also more confusing!
        Hide
        Oliver Heger added a comment -
            • COM-913 has been marked as a duplicate of this bug. ***
        Show
        Oliver Heger added a comment - COM-913 has been marked as a duplicate of this bug. ***

          People

          • Assignee:
            Unassigned
            Reporter:
            Oliver Heger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development