commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/logging/src/test/org/apache/commons/logging/simple CustomConfigTestCase.java DecoratedSimpleLog.java
Date Sun, 30 May 2004 10:32:25 GMT
rdonkin     2004/05/30 03:32:25

  Modified:    logging  build.xml
               logging/src/test/org/apache/commons/logging/simple
                        CustomConfigTestCase.java DecoratedSimpleLog.java
  Log:
  New test case for simple log date time setting
  
  Revision  Changes    Path
  1.46      +15 -1     jakarta-commons/logging/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/build.xml,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- build.xml	19 May 2004 21:02:10 -0000	1.45
  +++ build.xml	30 May 2004 10:32:25 -0000	1.46
  @@ -739,6 +739,20 @@
         <classpath refid="test.classpath"/>
       </java>
       
  +    <echo message="Custom Configuration With DateTime (SimpleLog Selected)"/>
  +    <java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
  +      <sysproperty key="org.apache.commons.logging.Log"
  +                 value="org.apache.commons.logging.simple.DecoratedSimpleLog"/>
  +      <sysproperty key="org.apache.commons.logging.simplelog.defaultlog"
  +                 value="debug"/>
  +      <sysproperty key="org.apache.commons.logging.simplelog.dateTimeFormat"
  +                 value="dd.mm.yyyy"/>
  +      <sysproperty key="org.apache.commons.logging.simplelog.showdatetime"
  +                 value="true"/>                 
  +      <arg value="org.apache.commons.logging.simple.DateTimeCustomConfigTestCase"/>
  +      <classpath refid="test.classpath"/>
  +    </java>
  +    
       <echo message="Basic Operations"/>
       <java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
         <sysproperty key="org.apache.commons.logging.Log"
  
  
  
  1.6       +15 -5     jakarta-commons/logging/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java
  
  Index: CustomConfigTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CustomConfigTestCase.java	29 May 2004 10:43:35 -0000	1.5
  +++ CustomConfigTestCase.java	30 May 2004 10:32:25 -0000	1.6
  @@ -34,7 +34,6 @@
    * @author Craig R. McClanahan
    * @version $Revision$ $Date$
    */
  -
   public class CustomConfigTestCase extends DefaultConfigTestCase {
   
   
  @@ -163,14 +162,25 @@
           assertEquals(SimpleLog.LOG_LEVEL_DEBUG, ((SimpleLog) log).getLevel());
   
           // Can we validate the extra exposed properties?
  -        assertEquals("yyyy/MM/dd HH:mm:ss:SSS zzz",
  -                     ((DecoratedSimpleLog) log).getDateTimeFormat());
  +        checkDecoratedDateTime();
           assertEquals("DecoratedLogger",
                        ((DecoratedSimpleLog) log).getLogName());
  -        assertTrue(!((DecoratedSimpleLog) log).getShowDateTime());
  +        checkShowDateTime();
           assertTrue(((DecoratedSimpleLog) log).getShowShortName());
   
       }
  +    
  +    /** Hook for subclassses */
  +    protected void checkShowDateTime() {
  +        assertTrue(!((DecoratedSimpleLog) log).getShowDateTime());
  +    }
  +    
  +    /** Hook for subclasses */
  +    protected void checkDecoratedDateTime() {
  +            assertEquals("yyyy/MM/dd HH:mm:ss:SSS zzz",
  +                     ((DecoratedSimpleLog) log).getDateTimeFormat());
  +    }
  +    
   
   
       // Check the actual log records against the expected ones
  
  
  
  1.6       +5 -0      jakarta-commons/logging/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java
  
  Index: DecoratedSimpleLog.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DecoratedSimpleLog.java	29 May 2004 10:43:35 -0000	1.5
  +++ DecoratedSimpleLog.java	30 May 2004 10:32:25 -0000	1.6
  @@ -19,6 +19,7 @@
   
   import java.util.ArrayList;
   import java.util.List;
  +import java.text.DateFormat;
   import org.apache.commons.logging.impl.SimpleLog;
   
   
  @@ -39,6 +40,10 @@
   
   
       // ------------------------------------------------------------- Properties
  +
  +    public DateFormat getDateTimeFormatter() {
  +        return (dateFormatter);
  +    }
   
   
       public String getDateTimeFormat() {
  
  
  

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


Mime
View raw message