avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ne...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/testcase ExcaliburTestCase.java
Date Wed, 31 Oct 2001 17:56:44 GMT
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
  
  Revision  Changes    Path
  1.11      +9 -3      jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/testcase/ExcaliburTestCase.java
  
  Index: ExcaliburTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/testcase/ExcaliburTestCase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ExcaliburTestCase.java	2001/10/31 15:08:43	1.10
  +++ ExcaliburTestCase.java	2001/10/31 17:56:44	1.11
  @@ -40,6 +40,7 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.HashMap;
  +import java.net.URL;
   
   /**
    * JUnit TestCase for Avalon Components
  @@ -144,7 +145,7 @@
    * </pre>
    *
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version $Id: ExcaliburTestCase.java,v 1.10 2001/10/31 15:08:43 neeme Exp $
  + * @version $Id: ExcaliburTestCase.java,v 1.11 2001/10/31 17:56:44 neeme Exp $
    */
   public class ExcaliburTestCase
       extends TestCase
  @@ -210,8 +211,13 @@
           throws Exception
       {
           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);
       }
   
       /**
  
  
  

--
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