You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dg...@apache.org on 2004/11/26 22:35:19 UTC

cvs commit: jakarta-commons/validator/src/test/org/apache/commons/validator TestCommon.java TestNumber.java ExtensionTest.java

dgraham     2004/11/26 13:35:19

  Modified:    validator/src/test/org/apache/commons/validator
                        TestCommon.java TestNumber.java ExtensionTest.java
  Log:
  Removed logging from tests.  They should either pass or fail without
  requiring us to look through log messages.
  
  Revision  Changes    Path
  1.7       +5 -21     jakarta-commons/validator/src/test/org/apache/commons/validator/TestCommon.java
  
  Index: TestCommon.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/TestCommon.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestCommon.java	21 Feb 2004 17:10:30 -0000	1.6
  +++ TestCommon.java	26 Nov 2004 21:35:19 -0000	1.7
  @@ -25,8 +25,6 @@
   
   import junit.framework.TestCase;
   
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
   import org.xml.sax.SAXException;
   
   /**
  @@ -38,11 +36,6 @@
        * Resources used for validation tests.
        */
       protected ValidatorResources resources = null;
  -    
  -    /**
  -     * Commons Logging instance.
  -     */
  -    protected Log log = LogFactory.getLog(this.getClass());
   
       public TestCommon(String string) {
           super(string);
  @@ -59,19 +52,10 @@
           try {
               in = this.getClass().getResourceAsStream(file);
               resources = new ValidatorResources(in);
  -            
  -        } catch (IOException e) {
  -            log.error(e.getMessage(), e);
  -            throw e;
  -            
           } finally {
               if (in != null) {
  -                try {
  -                    in.close();
  -                } catch (IOException e) {
  -                    log.error(e.getMessage(), e);
  -                }
  -            }
  +				in.close();
  +			}
           }
       }
   }
  
  
  
  1.5       +4 -10     jakarta-commons/validator/src/test/org/apache/commons/validator/TestNumber.java
  
  Index: TestNumber.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/TestNumber.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestNumber.java	21 Feb 2004 17:10:30 -0000	1.4
  +++ TestNumber.java	26 Nov 2004 21:35:19 -0000	1.5
  @@ -18,7 +18,7 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  - 
  +
   package org.apache.commons.validator;
   
   import java.io.IOException;
  @@ -65,9 +65,6 @@
           // Create bean to run test on.
           ValueBean info = new ValueBean();
           info.setValue("0");
  -        if (log.isDebugEnabled()) {
  -            log.debug("testNumberFailure Action=" + ACTION + ", FORM_KEY=" + FORM_KEY);
  -        }
           valueTest(info, true);
       }
   
  @@ -77,9 +74,6 @@
       public void testNumberFailure() throws ValidatorException {
           // Create bean to run test on.
           ValueBean info = new ValueBean();
  -        if (log.isDebugEnabled()) {
  -            log.debug("testNumberFailure Action=" + ACTION + ", FORM_KEY=" + FORM_KEY);
  -        }
           valueTest(info, false);
       }
   
  
  
  
  1.2       +15 -27    jakarta-commons/validator/src/test/org/apache/commons/validator/ExtensionTest.java
  
  Index: ExtensionTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/ExtensionTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExtensionTest.java	4 Apr 2004 13:53:25 -0000	1.1
  +++ ExtensionTest.java	26 Nov 2004 21:35:19 -0000	1.2
  @@ -27,9 +27,6 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  -
   /**
    * <p>Performs tests for extension in form definitions. Performs the same tests
    * RequiredNameTest does but with an equivalent validation definition with extension
  @@ -61,12 +58,6 @@
       */
       protected static String ACTION = "required";
   
  -
  -    /**
  -     * Commons Logging instance.
  -    */
  -    private Log log = LogFactory.getLog(this.getClass());
  -
       /**
        * Resources used for validation tests.
       */
  @@ -103,21 +94,18 @@
        * validator-extension.xml.
       */
       protected void setUp() throws Exception {
  -       // Load resources
  -       InputStream in = null;
  +		// Load resources
  +		InputStream in = null;
   
  -       try {
  -          in = this.getClass().getResourceAsStream("validator-extension.xml");
  -          resources = new ValidatorResources(in);
  -       } catch (Exception e) {
  -          log.error(e.getMessage(), e);
  -          throw e;
  -       } finally {
  -          if (in != null) {
  -             try { in.close(); } catch (Exception e) {}
  -          }
  -       }
  -    }
  +		try {
  +			in = this.getClass().getResourceAsStream("validator-extension.xml");
  +			resources = new ValidatorResources(in);
  +		} finally {
  +			if (in != null) {
  +				in.close();
  +			}
  +		}
  +	}
   
       protected void tearDown() {
       }
  @@ -369,7 +357,7 @@
        * Tests if the order is mantained when extending a form. Parent form fields should
        * preceed self form fields, except if we override the rules.
       */
  -    public void testOrder() throws ValidatorException {
  +    public void testOrder() {
   
          Form form = resources.getForm(ValidatorResources.defaultLocale, FORM_KEY);
          Form form2 = resources.getForm(ValidatorResources.defaultLocale, FORM_KEY2);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org