You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2002/04/09 18:45:59 UTC

cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka/junit JUnitTestAdapter.java

dion        02/04/09 09:45:59

  Modified:    latka/src/java/org/apache/commons/latka/junit
                        JUnitTestAdapter.java
  Log:
  - Fix various logging issues
   - Fix docs where null is returned
  
  Revision  Changes    Path
  1.10      +14 -13    jakarta-commons/latka/src/java/org/apache/commons/latka/junit/JUnitTestAdapter.java
  
  Index: JUnitTestAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/junit/JUnitTestAdapter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JUnitTestAdapter.java	29 Mar 2002 08:51:29 -0000	1.9
  +++ JUnitTestAdapter.java	9 Apr 2002 16:45:59 -0000	1.10
  @@ -91,7 +91,7 @@
    *
    * @author Chuck Burdick
    * @author dIon Gillard
  - * @version $Id: JUnitTestAdapter.java,v 1.9 2002/03/29 08:51:29 dion Exp $
  + * @version $Id: JUnitTestAdapter.java,v 1.10 2002/04/09 16:45:59 dion Exp $
    */
   public class JUnitTestAdapter implements Test {
       /** log4j category that output is logged to */
  @@ -117,7 +117,7 @@
       /**
        * Create a Test from a Latka file
        * @param fileName The name of a readable file in Latka's XML format
  -     * @return a JUnit Test, ready to run
  +     * @return a JUnit Test, ready to run, or null if the file can't be resolved
        */   
       public static Test createTestFromFile(String fileName) {
           Test result = null;
  @@ -125,7 +125,7 @@
           if (file.exists()) {
               result = createTestFromFile(file);
           } else {
  -            _log.error("Input file " + file.getAbsolutePath() +
  +            _log.debug("Input file " + file.getAbsolutePath() +
                          " does not exist");
           }
           return result;
  @@ -134,14 +134,14 @@
       /**
        * Create a Test from a {@link java.io.File Java file}
        * @param file A readable java file containing Latka's XML format 
  -     * @return a JUnit Test, ready to run
  +     * @return a JUnit Test, ready to run, or null if the file can't be resolved
        */   
       public static Test createTestFromFile(File file) {
           Test result = null;
           try {
               result = createTestFromURL(file.toURL());
           } catch (MalformedURLException e) {
  -            _log.error("Could not access input file", e);
  +            _log.debug("Could not access input file", e);
           }
           return result;
       }
  @@ -150,7 +150,8 @@
        * Create a Test from a resource accessible via
        * the {@link java.lang.ClassLoader#getResource(String) class loader}
        * @param resourceName A resource accessible by the class loader in Latka's XML format
  -     * @return a JUnit Test, ready to run
  +     * @return a JUnit Test, ready to run, or null if the resource can't be
  +     *         resolved
        */   
       public static Test createTestFromResource(String resourceName) {
           Test result = null;
  @@ -166,14 +167,14 @@
        * Create a Test from a String containing a URL whose
        * contents are in Latka's XML format
        * @param url the {@link java.net.URL URL} to fetch
  -     * @return a JUnit Test, ready to run
  +     * @return a JUnit Test, ready to run, or null if the url can't be resolved
        */   
       public static Test createTestFromURL(String url) {
           Test result = null;
           try {
               result = createTestFromURL(new URL(url));
           } catch (MalformedURLException e) {
  -            _log.error("Unable to create URL " + url, e);
  +            _log.debug("Unable to create URL " + url, e);
           }
           return result;
       }
  @@ -181,7 +182,7 @@
       /**
        * Create a Test from a URL whose contents are in Latka's XML format
        * @param url the {@link java.net.URL URL} to fetch
  -     * @return a JUnit Test, ready to run
  +     * @return a JUnit Test, ready to run, or null if the url can't be resolved
        */   
       public static Test createTestFromURL(URL url) {
           Test result = null;
  @@ -190,11 +191,11 @@
               Suite suite = new Suite(url);
               result = new JUnitTestAdapter(suite, parse(source));
           } catch (IOException ioe) {
  -            _log.error("IOException obtaining xml from URL " + url, ioe);
  +            _log.debug("IOException obtaining xml from URL " + url, ioe);
           } catch (SAXException se) {
  -            _log.error("Problem parsing URL " + url, se);
  +            _log.debug("Problem parsing URL " + url, se);
           } catch (ParserConfigurationException pce) {
  -            _log.error("Problem determining parser", pce);
  +            _log.debug("Problem determining parser", pce);
           }
           return result;
       }
  @@ -228,7 +229,7 @@
        *
        * @author Chuck Burdick
        * @author dIon Gillard
  -     * @version $Id: JUnitTestAdapter.java,v 1.9 2002/03/29 08:51:29 dion Exp $
  +     * @version $Id: JUnitTestAdapter.java,v 1.10 2002/04/09 16:45:59 dion Exp $
        */
       private static class TestCounter extends DefaultHandler {
           /** number of requests (ie junit tests) */
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>