commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31540] New: - [Configuration] Property throwExceptionOnMissing is not respected for subsets
Date Tue, 05 Oct 2004 10:06:45 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31540>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31540

[Configuration] Property throwExceptionOnMissing is not respected for subsets

           Summary: [Configuration] Property throwExceptionOnMissing is not
                    respected for subsets
           Product: Commons
           Version: 1.0 Beta 2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: joerg.schaible@gmx.de


public void testNoSuchElementExceptionFoSubsets() {
    BaseConfiguration config = new BaseConfiguration();
    config.setThrowExceptionOnMissing(true);
    config.addProperty("subset.foo", "bar");
    try {
        config.getString("subset.foobar");
        fail("NoSuchElementException expected");
    } catch(NoSuchElementException e) {
        // expected
    }
    try {
        config.subset("subset").getString("foobar");
        fail("NoSuchElementException expected");
    } catch(NoSuchElementException e) {
        // expected
    }
}

This behaviour is currently a showstopper, since I rely on the thrown exception.
Note: subset() returns a plain Configuration interface, that does not have the
setThrowExceptionOnMissing setter.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message