You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by gl...@apache.org on 2003/12/10 04:12:36 UTC

cvs commit: jakarta-commons-sandbox/tbm build.properties.sample build.xml

glenn       2003/12/09 19:12:36

  Modified:    tbm      build.properties.sample build.xml
  Added:       tbm/src/bench/org/apache/commons/tbm/bench/datetime
                        CommonsLangFastDateFormat.java
  Log:
  Add a benchmark test for commons-lang FastDateFormat
  
  Revision  Changes    Path
  1.1                  jakarta-commons-sandbox/tbm/src/bench/org/apache/commons/tbm/bench/datetime/CommonsLangFastDateFormat.java
  
  Index: CommonsLangFastDateFormat.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/tbm/src/bench/org/apache/commons/tbm/bench/datetime/CommonsLangFastDateFormat.java,v 1.1 2003/12/10 03:12:36 glenn Exp $
   * $Revision: 1.1 $
   * $Date: 2003/12/10 03:12:36 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.tbm.bench.datetime;
  
  import java.util.Date;
  import java.util.Locale;
  import java.util.TimeZone;
  
  import org.apache.commons.lang.time.DateFormatUtils;
  import org.apache.commons.tbm.bench.BenchThread;
  
  /**
   * A benchmark test which uses the Commons-Lang FastDateFormat.
   *
   * @author Glenn L. Nielsen
   * @version $Revision: 1.1 $
   */
  
  public class CommonsLangFastDateFormat extends BenchThread {
  
      private static String TEST_NAME = "Jakarta Commons-Lang FastDateFormat";
      private static String pattern = "yyyyy.MMMMM.dd GGG hh:mm aaa";
      private static TimeZone tz = null;
      private static Locale locale = null;
  
      static {
          name = TEST_NAME;
          tz = TimeZone.getDefault();
          locale = Locale.getDefault();
      }
  
      private String formattedDate = null;
  
      /**
       * Perform cleanup for the benchmark.
       */
      public void clean() {
          formattedDate = null;
      }
  
      /**
       * Perform the Jakarta Commons-Lang FastDateFormat benchmark.
       */
      public void test() {
          formattedDate = DateFormatUtils.format(
              new Date(System.currentTimeMillis()),pattern,tz,locale);
      }
  }
  
  
  
  1.2       +6 -1      jakarta-commons-sandbox/tbm/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/tbm/build.properties.sample,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.properties.sample	9 Dec 2003 15:54:11 -0000	1.1
  +++ build.properties.sample	10 Dec 2003 03:12:36 -0000	1.2
  @@ -80,3 +80,8 @@
   # commons-pool.jar -- the Pool package
   commons-pool.home=${basedir}/../pool/dist
   commons-pool.jar=${commons-pool.home}/commons-pool.jar
  +
  +# commons-lang 2.0 jar
  +commons-lang.home=${basedir}/../lang/dist
  +commons-lang.jar=${commons-lang.home}/commons-lang.jar
  +
  
  
  
  1.2       +4 -2      jakarta-commons-sandbox/tbm/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/tbm/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.xml	9 Dec 2003 15:54:11 -0000	1.1
  +++ build.xml	10 Dec 2003 03:12:36 -0000	1.2
  @@ -55,7 +55,7 @@
       <property name="cp" value=""/>
   
       <!-- now combine the classpaths -->
  -    <property name="classpath" value="${cp}:${junit.jar}"/>
  +    <property name="classpath" value="${cp}:${junit.jar}:${commons-lang.jar}"/>
   
       <property name="name" value="commons-tbm"/>
       <property name="Name" value="Commons-TBM"/>
  @@ -420,12 +420,14 @@
       <taskdef name="bench" classname="org.apache.commons.tbm.bench.BenchTask">
         <classpath location="${dest.jardir-bench.jar}"/>
         <classpath location="${dest.jardir.jar}"/>
  +      <classpath location="${commons-lang.jar}"/>
       </taskdef>
       <mkdir dir="${dest.bench}"/>
       <bench file="${dest.bench}/${bench.file}.xml" system="${bench.system}">
         <test classname="org.apache.commons.tbm.bench.BenchNOP"/>
         <test classname="org.apache.commons.tbm.bench.datetime.DefaultTimeZone"/>
         <test classname="org.apache.commons.tbm.bench.datetime.SimpleDateFormat"/>
  +      <test classname="org.apache.commons.tbm.bench.datetime.CommonsLangFastDateFormat"/>
         <test classname="org.apache.commons.tbm.bench.datetime.ThreadLocalSimpleDateFormat"/>
         <test classname="org.apache.commons.tbm.bench.datetime.TimestampToString"/>
       </bench>
  
  
  

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