avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/testcase ExcaliburTestCase.java
Date Wed, 31 Oct 2001 18:15:17 GMT
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>


Mime
View raw message