Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6304 Configslurper Issues
  3. GROOVY-3334

ConfigSlurper Fails when ordering of Nested Elements changes

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.5.6, 1.6-rc-2
    • None
    • groovy-jdk
    • None
    • Windows

    Description

      Config Slurper fails with nested elements depending on the order specified. For example:

      This Fails
              def config = new ConfigSlurper().parse('''
              foo {
                  fruit.citrus="orange"
                  bar {
                      fruit.citrus="lemon"
                  }
              }
              ''')
      
              assertEquals "lemon", config.foo.bar.fruit.citrus
              assertEquals "orange", config.foo.fruit.citrus
      
      This Passes
              def config = new ConfigSlurper().parse('''
              foo {
                  bar {
                      fruit.citrus="lemon"
                  }
                  fruit.citrus="orange"
              }
              ''')
      
              assertEquals "lemon", config.foo.bar.fruit.citrus
              assertEquals "orange", config.foo.fruit.citrus
      

      Attachments

        1. ConfigUnitTests.groovy
          0.7 kB
          Paul Fairless

        Activity

          People

            Unassigned Unassigned
            paul.fairless Paul Fairless
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: