[prev in list] [next in list] [prev in thread] [next in thread]
List: avalon-dev
Subject: cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/testcase ExcaliburTestCase
From: neeme () apache ! org
Date: 2001-10-31 17:56:44
[Download RAW message or body]
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>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic