You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Oliver Heger <ol...@oliver-heger.de> on 2007/04/06 21:30:46 UTC
Re: [configuration] Bug?
(Please prefix your mails with the name of the affected component.)
see below
Jason Nichols wrote:
> I think I have found a bug with XMLConfiguration. When I run the
> following test with the following xml the second assertEquals statement
> fails:
>
> XML:
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <test>
> <a name="X">ABC</a>
> <a name="Y">1,2,3</a>
> </test
>
> TEST:
> public void testXMLConfig() throws Exception {
> File file = new File("/xml/xmlConfigTest.xml");
>
> XMLConfiguration xmlConfig = new XMLConfiguration(file);
> xmlConfig.load();
>
> assertEquals("X",xmlConfig.getProperty("a(0)[@name]"));
> assertEquals("Y",xmlConfig.getProperty("a(1)[@name]"));
> }
>
> Anyone see this issue before? I couldn't find it in jira.
>
I think you have indeed found a bug. The problem here is that the 2nd
<a> element is treated as a list element with the three values 1, 2, and
3. Obviously for such constellations the attributes get lost.
If you change the value of this element to a text that does not contain
the delimiter character (','), the assert passes.
Could you please open a bug report in jira for this problem?
Thanks
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [configuration] Bug?
Posted by Oliver Heger <ol...@oliver-heger.de>.
Oliver Heger wrote:
> (Please prefix your mails with the name of the affected component.)
>
> see below
>
> Jason Nichols wrote:
>> I think I have found a bug with XMLConfiguration. When I run the
>> following test with the following xml the second assertEquals
>> statement fails:
>>
>> XML:
>> <?xml version="1.0" encoding="ISO-8859-1" ?>
>> <test>
>> <a name="X">ABC</a>
>> <a name="Y">1,2,3</a>
>> </test
>>
>> TEST:
>> public void testXMLConfig() throws Exception {
>> File file = new File("/xml/xmlConfigTest.xml");
>>
>> XMLConfiguration xmlConfig = new XMLConfiguration(file);
>> xmlConfig.load();
>>
>> assertEquals("X",xmlConfig.getProperty("a(0)[@name]"));
>> assertEquals("Y",xmlConfig.getProperty("a(1)[@name]"));
>> }
>>
>> Anyone see this issue before? I couldn't find it in jira.
>>
> I think you have indeed found a bug. The problem here is that the 2nd
> <a> element is treated as a list element with the three values 1, 2, and
> 3. Obviously for such constellations the attributes get lost.
>
> If you change the value of this element to a text that does not contain
> the delimiter character (','), the assert passes.
>
> Could you please open a bug report in jira for this problem?
>
> Thanks
> Oliver
>
I have created a bug report for this issue:
https://issues.apache.org/jira/browse/CONFIGURATION-263
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org