avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neeme Praks" <neeme.pr...@one.ee>
Subject RE: cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/testcase ExcaliburTestCase.java
Date Thu, 01 Nov 2001 04:44:38 GMT

why? I just had a case where I didn't need the whole environment to be set
up, I just needed a default Logger.
Of course I could use getDefaultHierarchy() and friends, but it's easier to
write getLogger() :-)
Also I don't need to change my Logger getting code, if I decide that I need
to have more advanced environment setup.

But if this behaviour is not really desirable, then I can fail() as well...
So, to fail() or not to fail()?

> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: Wednesday, October 31, 2001 10:15 AM
> To: Avalon Developers List
> Cc: jakarta-avalon-excalibur-cvs@apache.org
> Subject: Re: cvs commit:
> jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/test
> case ExcaliburTestCase.java
>
>
> neeme@apache.org wrote:
> >
> > neeme       01/10/31 09:56:44
> >
> >   Modified:    src/java/org/apache/avalon/excalibur/testcase
> >                         ExcaliburTestCase.java
> >   Log:
> >   removed possibility for NPE, in case the .xtest configuration
> file was not found
> >            final String resourceName =
> this.getClass().getName().replace( '.', '/' ) + ".xtest";
> >   -        getLogger().debug("ResourceName = " + resourceName);
> >   -        prepare(
> this.getClass().getClassLoader().getResource( resourceName
> ).openStream() );
> >   +        URL resource =
> this.getClass().getClassLoader().getResource( resourceName );
> >   +        if ( resource != null ) {
> >   +            getLogger().debug("Loading resource " + resourceName);
> >   +            prepare( resource.openStream() );
> >   +        }
> >   +        else
> >   +            getLogger().debug("Resource not found " + resourceName);
> >        }
>
> Be sure to fail() if the resource cannot be found!  It is an
> error condition.
>
> --
>
> "Those who would trade liberty for
>  temporary security deserve neither"
>                 - Benjamin Franklin
>
> --
> To unsubscribe, e-mail:
> <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:avalon-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message