You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Michael Fortin <mi...@m410.us> on 2016/07/13 18:43:54 UTC
[configuration] YAML configuration
Hi, I was trying to setup commons configuration to use YAML as it’s configuration file format.
I found this example using commons 1.*:
https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java <https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java>
And I was also looking at source of the XMLConfiguration as a guide:
https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html <https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html>
This is what I have so far:
https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java <https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java>
The test runs but doesn’t pass. Could someone give me some guidance as to what I’m doing wrong?
thanks much,
Michael
Re: [configuration] YAML configuration
Posted by Michael Fortin <mi...@m410.us>.
Hi Dennis, that’s just the nudge in the right direction I needed. thank you
> On Jul 15, 2016, at 3:20 AM, Dennis Kieselhorst <de...@apache.org> wrote:
>
> Hi Michael,
>
> your toNodeMap method has a bug. In line 54 you're adding the child node
> but you're not using the node that is returned.
>
> Regards
> Dennis
>
> Am 13.07.2016 um 20:43 schrieb Michael Fortin:
>> Hi, I was trying to setup commons configuration to use YAML as it’s configuration file format.
>>
>> I found this example using commons 1.*:
>> https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java <https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java>
>>
>> And I was also looking at source of the XMLConfiguration as a guide:
>> https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html <https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html>
>>
>> This is what I have so far:
>> https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java <https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java>
>>
>> The test runs but doesn’t pass. Could someone give me some guidance as to what I’m doing wrong?
>>
>> thanks much,
>> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [configuration] YAML configuration
Posted by Michael Fortin <mi...@m410.us>.
Hi, I nearly have the library working with a few small caveats. I’m not sure if this is a bug, I setup something wrong, or the expected behavior.
This is the unit test, line 60 fails:
https://github.com/m410/commons-configuration-yaml/blob/master/src/test/java/org/m410/config/YamlConfigurationTest.java <https://github.com/m410/commons-configuration-yaml/blob/master/src/test/java/org/m410/config/YamlConfigurationTest.java>
but the collection is there, the preceding 4 lines pass without issue. Any advice would be much appreciated.
thx.
> On Jul 15, 2016, at 3:20 AM, Dennis Kieselhorst <de...@apache.org> wrote:
>
> Hi Michael,
>
> your toNodeMap method has a bug. In line 54 you're adding the child node
> but you're not using the node that is returned.
>
> Regards
> Dennis
>
> Am 13.07.2016 um 20:43 schrieb Michael Fortin:
>> Hi, I was trying to setup commons configuration to use YAML as it’s configuration file format.
>>
>> I found this example using commons 1.*:
>> https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java <https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java>
>>
>> And I was also looking at source of the XMLConfiguration as a guide:
>> https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html <https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html>
>>
>> This is what I have so far:
>> https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java <https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java>
>>
>> The test runs but doesn’t pass. Could someone give me some guidance as to what I’m doing wrong?
>>
>> thanks much,
>> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
Re: [configuration] YAML configuration
Posted by Dennis Kieselhorst <de...@apache.org>.
Hi Michael,
your toNodeMap method has a bug. In line 54 you're adding the child node
but you're not using the node that is returned.
Regards
Dennis
Am 13.07.2016 um 20:43 schrieb Michael Fortin:
> Hi, I was trying to setup commons configuration to use YAML as it\u2019s configuration file format.
>
> I found this example using commons 1.*:
> https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java <https://github.com/PEXPlugins/PermissionsEx/blob/5da1c1410f134e2c8e39fbc93dc1c7d5e3456335/src/main/java/ru/tehkode/utils/config/YamlFileConfiguration.java>
>
> And I was also looking at source of the XMLConfiguration as a guide:
> https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html <https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/XMLConfiguration.html>
>
> This is what I have so far:
> https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java <https://github.com/m410/commons-configuration-yaml/blob/master/src/main/java/org/m410/config/YamlConfiguration.java>
>
> The test runs but doesn\u2019t pass. Could someone give me some guidance as to what I\u2019m doing wrong?
>
> thanks much,
> Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org