cvs commit: jakarta-log4j/tests build.xml

2003-09-17 Thread ceki
ceki2003/09/17 11:03:16

  Modified:tests/src/java/org/apache/log4j/rolling
TimeBasedRollingTest.java
   testsbuild.xml
  Added:   tests/input compress3.copy compress1.copy compress2.copy
  Removed: tests/input compress3.txt compress2.txt compress1.txt
  Log:
  
  All tests are now green.
  
  Revision  ChangesPath
  1.3   +0 -1  
jakarta-log4j/tests/src/java/org/apache/log4j/rolling/TimeBasedRollingTest.java
  
  Index: TimeBasedRollingTest.java
  ===
  RCS file: 
/home/cvs/jakarta-log4j/tests/src/java/org/apache/log4j/rolling/TimeBasedRollingTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TimeBasedRollingTest.java 17 Sep 2003 17:46:02 -  1.2
  +++ TimeBasedRollingTest.java 17 Sep 2003 18:03:16 -  1.3
  @@ -57,7 +57,6 @@
   import org.apache.log4j.LogManager;
   import org.apache.log4j.Logger;
   import org.apache.log4j.PatternLayout;
  -import org.apache.log4j.rolling.helpers.Compress;
   import org.apache.log4j.util.Compare;
   
   import java.text.SimpleDateFormat;
  
  
  
  1.1  jakarta-log4j/tests/input/compress3.copy
  
  Index: compress3.copy
  ===
  /*
   * 
   *   The Apache Software License, Version 1.1
   * 
   *
   *Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without modifica-
   * tion, 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  acknowledgment:  "This product includes  software
   *developed  by the  Apache Software Foundation  (http://www.apache.org/)."
   *Alternately, this  acknowledgment may  appear in the software itself,  if
   *and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "log4j" 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
   *[EMAIL PROTECTED]
   *
   * 5. Products  derived from this software may not  be called "Apache", nor may
   *"Apache" appear  in their name,  without prior written permission  of the
   *Apache Software Foundation.
   *
   * 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 (INCLU-
   * DING, 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 .
   *
   */
  ===
  Using log4j
  ===

  1) First untar or unzip the distribution file.
  
  2) Assuming you chose to extract the distribution in to the
 PATH_OF_YOUR_CHOICE, untarring the distribution file should create
 a jakarta-log4j-VERSION directory, where VERSION is the log4j
 version number, under PATH_OF_YOUR_CHOICE. We will refer to the
 directory PATH_OF_YOUR_CHOICE/jakarta-log4j-VERSION/ as $LOG4J_HOME/.
  
  3) Assuming you are using log4j version 1.2, add
 $LOG4J_HOME/dist/lib/log4j-1.2.jar to your CLASSPATH,
 
  4) You can now test your installation by first compiling the following
 simple program.
  
  import org.apache.log4j.Logger;
  import org.apache.log4j.BasicConfigurator;
  
  public class Hello {
  
static Logger logger = Logger.getLogger(Hello.class);
  

cvs commit: jakarta-log4j/tests build.xml

2003-09-12 Thread ceki
ceki2003/09/12 10:43:01

  Modified:testsbuild.xml
  Log:
  
  Telling the ant task to inherit parent refs allows the test build file to be 
  executed within Eclipse.
  
  Not a huge improvement but useful nonetheless.
  
  Revision  ChangesPath
  1.38  +1 -1  jakarta-log4j/tests/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- build.xml 9 Jul 2003 07:35:49 -   1.37
  +++ build.xml 12 Sep 2003 17:43:01 -  1.38
  @@ -63,7 +63,7 @@
 
   
 
  -
  +
 
   
 
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-log4j/tests build.xml

2003-06-25 Thread ceki
ceki2003/06/25 09:35:00

  Modified:testsbuild.xml
  Log:
  
  Undoing the last commit (revision 1.35) where the line
  

  
  in the DefaultInit test cases was removed by mistake.
  
  Revision  ChangesPath
  1.36  +1 -0  jakarta-log4j/tests/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- build.xml 23 Jun 2003 17:02:06 -  1.35
  +++ build.xml 25 Jun 2003 16:35:00 -  1.36
  @@ -206,6 +206,7 @@
   
   
   
  +   
 
 
 
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-log4j/tests build.xml

2003-06-03 Thread ceki
ceki2003/06/02 10:45:06

  Modified:tests/src/java/org/apache/log4j/helpers VerifierThread.java
ReaderWriterLockTestCase.java
   src/java/org/apache/log4j/helpers ReaderWriterLock.java
   testsbuild.xml
  Log:
  
  Fixed problems in the TestCase. 
  
  The ReaderWriterLock was modified to cater for the TestCase. Changes will
  be removed after further testing.
  
  Revision  ChangesPath
  1.2   +61 -15
jakarta-log4j/tests/src/java/org/apache/log4j/helpers/VerifierThread.java
  
  Index: VerifierThread.java
  ===
  RCS file: 
/home/cvs/jakarta-log4j/tests/src/java/org/apache/log4j/helpers/VerifierThread.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VerifierThread.java   27 May 2003 20:18:57 -  1.1
  +++ VerifierThread.java   2 Jun 2003 17:45:05 -   1.2
  @@ -49,6 +49,8 @@
   
   package org.apache.log4j.helpers;
   
  +import junit.framework.TestCase;
  +
   import org.apache.oro.text.perl.Perl5Util;
   
   import java.io.BufferedReader;
  @@ -66,52 +68,72 @@
 boolean[] readLockWaiters;
 boolean[] writerLockWaiters;
 BufferedReader bufferedReader;
  +  double v1 = 0;
  +  double v2 = 0;
  +  Perl5Util regex;
  +  Exception exception;
  +  boolean interrupt;
   
 VerifierThread(BufferedReader br, int numberOfReaders, int numberOfWriters) {
   bufferedReader = br;
   readLockHolders = new boolean[numberOfReaders];
   readLockWaiters = new boolean[numberOfReaders];
   writerLockWaiters = new boolean[numberOfWriters];
  +regex = new Perl5Util();
  +  }
  +
  +  boolean getInterrupt() {
  +return interrupt;
 }
   
  - 
 public void run() {
   System.out.println("In run of VerifThread");
  -
  -Perl5Util regex = new Perl5Util();
  -
  +   String line = null;
  +   
   while (true) {
 try {
  -String line = bufferedReader.readLine();
  - System.out.println(line);   
  - 
  -if (regex.match("/([RW])-(\\d{1,2}) (.*)/", line)) {
  +line = bufferedReader.readLine();
  +if(!interrupt) {
  +  System.out.println(line);
  +} 
  +if (regex.match("/([RW])-(\\d{1,3}) (.*)/", line)) {
 String type = regex.group(1);
 int num = Integer.parseInt(regex.group(2));
 String msg = regex.group(3);
   
  +   //System.out.println(type +"_"+num+ " "+msg);
 if (type.equals("R")) {
   readerMsg(num, msg);
 } else if (type.equals("W")) {
  +writerMsg(num, msg);
 }
   } else {
 System.out.println(
   "[" + line + "] does not match expected pattern.");
   }
  -
  -//System.out.println("."+type+"-"+num+" "+msg);  
  -  } catch (IOException e) {
  +  } catch (Exception e) {
  + if(exception == null) {
  +  exception = e;
  + }
  +interrupt = true;
  +System.out.println("Offending line ["+line+"].");
 }
   }
 }
   
  +  public Exception getException() {
  +return exception;
  +  }
  +
 void readerMsg(int num, String msg) {
   if (msg.equals("Asking for read lock.")) {
 askReadLock(num);
   } else if (msg.equals("Got read lock.")) {
 gotReadLock(num);
  -} else if (msg.startsWith("Value")) {
  -  //releaseReadLock(num);
  +} else if (msg.startsWith("Value1")) {
  +  value1Message(num, msg);
  +} else if (msg.startsWith("Value2")) {
  +  value2Message(num, msg);
   } else if (msg.equals("About to release read lock.")) {
 releaseReadLock(num);
   }
  @@ -122,8 +144,9 @@
 askWriterLock(num);
   } else if (msg.equals("Got write lock.")) {
 gotWriteLock(num);
  -} else if (msg.startsWith("Value")) {
  -  //releaseReadLock(num);
  +} else if (msg.equals("About to increment values.")) {
  +  v1 += 1;
  +  v2 += 10.0;
   } else if (msg.equals("About to release write lock.")) {
 releaseWriteLock(num);
   }
  @@ -139,6 +162,7 @@
   return true;
 }
   }
  +
   return false;
 }
   
  @@ -206,5 +230,27 @@
   }
   
   writeLockHolder = -1;
  +  }
  +
  +  void value1Message(int num, String msg) {
  +if (regex.match("/Value1 is (\\d*)/", msg)) {
  +  double r = Double.parseDouble(regex.group(1));
  +
  +  if (r != v1) {
  +throw new IllegalStateException(
  +  "Reported value is " + r + " was expecting " + v1);
  +  }
  +}
  +  }
  +
  +  void value2Message(int num, String msg) {
  +if (regex.match("/Value1 is (\\d*)/", msg)) {
  +  double r = Double.parseDouble(regex.group(1));
  +
  +  if (r != v2) {
  +throw new IllegalStateException

cvs commit: jakarta-log4j/tests build.xml

2003-02-03 Thread mwomack
mwomack 2003/02/03 22:55:39

  Modified:testsbuild.xml
  Log:
  Removed filters related tests from runAll.
  
  Revision  ChangesPath
  1.25  +1 -2  jakarta-log4j/tests/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- build.xml 11 Dec 2002 07:35:03 -  1.24
  +++ build.xml 4 Feb 2003 06:55:39 -   1.25
  @@ -114,8 +114,7 @@
OptionConverter, BoundedFIFO, 
CyclicBuffer, OR, VariaLevelMatchFilter, 
VariaLevelRangeFilter, PatternParser,
  - LevelMatchFilter, FiltersLevelMatchFilter, 
DRFA,
  - Plugins"/>
  + LevelMatchFilter, DRFA, Plugins"/>
   
 
 
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




cvs commit: jakarta-log4j/tests build.xml

2002-12-10 Thread mwomack
mwomack 2002/12/10 23:35:03

  Modified:testsbuild.xml
  Log:
  Added PluginTestCase.
  
  Revision  ChangesPath
  1.24  +10 -1 jakarta-log4j/tests/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- build.xml 16 Oct 2002 13:54:14 -  1.23
  +++ build.xml 11 Dec 2002 07:35:03 -  1.24
  @@ -114,7 +114,8 @@
OptionConverter, BoundedFIFO, 
CyclicBuffer, OR, VariaLevelMatchFilter, 
VariaLevelRangeFilter, PatternParser,
  - LevelMatchFilter, FiltersLevelMatchFilter, 
DRFA"/>
  + LevelMatchFilter, FiltersLevelMatchFilter, 
DRFA,
  + Plugins"/>
   
 
 
  @@ -352,6 +353,14 @@
 
 
 
  +
  +  
  +
  +  
  +
  +  
  +  
  +  
   
 
   
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-log4j/tests build.xml

2002-10-16 Thread ceki

ceki2002/10/16 06:54:14

  Modified:testsbuild.xml
  Log:
  The test build now forces a fresh build of the log4j classes.
  
  Revision  ChangesPath
  1.23  +8 -2  jakarta-log4j/tests/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- build.xml 16 Oct 2002 10:27:59 -  1.22
  +++ build.xml 16 Oct 2002 13:54:14 -  1.23
  @@ -62,11 +62,18 @@
   
 
   
  +  
  +  
  +  
  +
  +  
  +
  +  
   
 
 
 
  -  
  +  
   
   
 
  -
   
 
 
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-log4j/tests build.xml

2002-10-16 Thread ceki

ceki2002/10/16 03:27:59

  Modified:testsbuild.xml
  Log:
  All tests cases now clean the output/ directory before actually
  running the tests. This precautionary step avoids interference with
  previous runs.
  
  Revision  ChangesPath
  1.22  +29 -22jakarta-log4j/tests/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- build.xml 9 Oct 2002 22:50:07 -   1.21
  +++ build.xml 16 Oct 2002 10:27:59 -  1.22
  @@ -84,6 +84,13 @@
   
 
   
  +  
  +
  +  
  +
  +  
  +
  +
 
 
   
  @@ -111,7 +118,7 @@
 
   
 
  -  
  +  
   
 
 
  @@ -119,7 +126,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -127,7 +134,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -135,7 +142,7 @@
   
 
   
  -  
  +  
   
   
 
  @@ -144,7 +151,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -152,7 +159,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -160,7 +167,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -168,7 +175,7 @@
   
 
   
  -  
  +  
   
   
   
  @@ -218,7 +225,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -237,7 +244,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -245,7 +252,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -253,7 +260,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -261,7 +268,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -269,7 +276,7 @@
   
 
 
  -  
  +  
   
 
 
  @@ -277,7 +284,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -285,7 +292,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -293,7 +300,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -301,7 +308,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -309,7 +316,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -317,7 +324,7 @@
   
 
   
  -  
  +  
   
 
 
  @@ -326,7 +333,7 @@
 
   
   
  -  
  +  
   
 
 
  @@ -334,7 +341,7 @@
   
 
   
  -  
  +  
   
 
 
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: