mstover1    2004/06/19 18:23:41

  Modified:    src/components/org/apache/jmeter/timers
                        ConstantThroughputTimer.java
               src/components/org/apache/jmeter/visualizers
                        AssertionVisualizer.java GraphAccum.java
                        ViewResultsFullVisualizer.java
               src/core/org/apache/jmeter/engine StandardJMeterEngine.java
               src/core/org/apache/jmeter/reporters ResultCollector.java
                        ResultSaver.java Summariser.java
               src/core/org/apache/jmeter/samplers SampleResult.java
               src/core/org/apache/jmeter/save SaveService.java
               src/core/org/apache/jmeter/testelement
                        AbstractTestElement.java
               src/core/org/apache/jmeter/visualizers RunningSample.java
               src/examples/org/apache/jmeter/examples/testbeans/example1
                        Example1.java
               src/examples/org/apache/jmeter/examples/testbeans/example2
                        Example2.java
               src/functions/org/apache/jmeter/functions LogFunction.java
                        LogFunction2.java Random.java StringFromFile.java
               src/monitor/model/org/apache/jmeter/monitor/model
                        ObjectFactory.java
               src/protocol/http/org/apache/jmeter/protocol/http/parser
                        HtmlParsingUtils.java
               src/protocol/http/org/apache/jmeter/protocol/http/sampler
                        HTTPSamplerBase.java PostWriter.java
               src/protocol/http/org/apache/jmeter/protocol/http/util
                        DOMPool.java
               src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui
                        TCPConfigGui.java
               xdocs/usermanual functions.xml
  Log:
  Merging from 2-0 branch
  
  Revision  Changes    Path
  1.17      +1 -3      
jakarta-jmeter/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
  
  Index: ConstantThroughputTimer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ConstantThroughputTimer.java      21 May 2004 21:09:33 -0000      1.16
  +++ ConstantThroughputTimer.java      20 Jun 2004 01:23:40 -0000      1.17
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2002-2004 The Apache Software Foundation.
    *
  @@ -31,7 +30,6 @@
    * Timer paces the samplers under it's influence so that the total number of
    * samples per unit of time approaches a given constant as much as possible.
    *
  - * @version $Id$
    */
   public class ConstantThroughputTimer
           extends AbstractTestElement
  @@ -117,7 +115,7 @@
        * 
        * @see org.apache.jmeter.testelement.TestListener#testStarted()
        */
  -    public void testStarted()
  +    public synchronized void testStarted()//synch to protect targetTime
       {
        log.debug("Test started - reset throughput calculation.");
        targetTime= 0;
  
  
  
  1.17      +8 -11     
jakarta-jmeter/src/components/org/apache/jmeter/visualizers/AssertionVisualizer.java
  
  Index: AssertionVisualizer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/visualizers/AssertionVisualizer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AssertionVisualizer.java  5 Mar 2004 01:33:33 -0000       1.16
  +++ AssertionVisualizer.java  20 Jun 2004 01:23:40 -0000      1.17
  @@ -84,17 +84,14 @@
           {
               StringBuffer display = new StringBuffer();
               AssertionResult assertionResults[] = res.getAssertionResults();
  -            if (assertionResults != null)
  +            for (int i = 0; i < assertionResults.length; i++)
               {
  -                for (int i = 0; i < assertionResults.length; i++)
  -                {
  -                    AssertionResult item = assertionResults[i];
  +                AssertionResult item = assertionResults[i];
   
  -                    if (item.isFailure() || item.isError())
  -                    {
  -                        display.append("\n\t\t");
  -                        display.append(item.getFailureMessage());
  -                    }
  +                if (item.isFailure() || item.isError())
  +                {
  +                    display.append("\n\t\t");
  +                    display.append(item.getFailureMessage());
                   }
               }
               return display.toString();
  
  
  
  1.12      +2 -7      
jakarta-jmeter/src/components/org/apache/jmeter/visualizers/GraphAccum.java
  
  Index: GraphAccum.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/visualizers/GraphAccum.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- GraphAccum.java   6 Jun 2004 22:07:15 -0000       1.11
  +++ GraphAccum.java   20 Jun 2004 01:23:40 -0000      1.12
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -45,7 +44,6 @@
    * Draws the graph.
    *
    * Created      2001/08/11
  - * @version    $Revision$ Last updated: $Date$
    */
   public class GraphAccum extends JComponent implements Scrollable,
           GraphAccumListener
  @@ -69,7 +67,7 @@
        */
       private boolean previousPtsAlloc = false;
   
  -    private static final int width = 2000;
  +    protected final static int width = 2000;
   
       private final static int PLOT_X_WIDTH = 10;
       transient private static final Logger log = LoggingManager.getLoggerForClass();
  @@ -288,10 +286,7 @@
           // Allocate previousPts only the first time
           if (!previousPtsAlloc)
           {
  -            if (resultList != null)
  -            {
  -                resultListCount += resultList.length;
  -            }
  +            resultListCount += resultList.length;
               previousPts = new Point[resultListCount + 2];
           }
   
  
  
  
  1.44      +11 -16    
jakarta-jmeter/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
  
  Index: ViewResultsFullVisualizer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- ViewResultsFullVisualizer.java    16 Apr 2004 13:21:44 -0000      1.43
  +++ ViewResultsFullVisualizer.java    20 Jun 2004 01:23:40 -0000      1.44
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -64,7 +63,6 @@
    * "Continue" button.
    *
    * Created     2001/07/25
  - * @version   $Revision$ $Date$
    */
   public class ViewResultsFullVisualizer
       extends AbstractVisualizer
  @@ -138,24 +136,21 @@
       {
           SampleResult[] subResults = res.getSubResults();
   
  -        if (subResults != null)
  +        int leafIndex = 0;
  +
  +        for (int i = 0; i < subResults.length; i++)
           {
  -            int leafIndex = 0;
  +            SampleResult child = subResults[i];
   
  -            for (int i = 0; i < subResults.length; i++)
  +            if (log.isDebugEnabled())
               {
  -                SampleResult child = subResults[i];
  -
  -                if (log.isDebugEnabled())
  -                {
  -                    log.debug("updateGui1 : child sample result - " + child);
  -                }
  -                DefaultMutableTreeNode leafNode =
  -                    new DefaultMutableTreeNode(child);
  -
  -                treeModel.insertNodeInto(leafNode, currNode, leafIndex++);
  -                addSubResults(leafNode, child);
  +                log.debug("updateGui1 : child sample result - " + child);
               }
  +            DefaultMutableTreeNode leafNode =
  +                new DefaultMutableTreeNode(child);
  +
  +            treeModel.insertNodeInto(leafNode, currNode, leafIndex++);
  +            addSubResults(leafNode, child);
           }
       }
   
  
  
  
  1.50      +8 -11     
jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
  
  Index: StandardJMeterEngine.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- StandardJMeterEngine.java 28 May 2004 21:09:12 -0000      1.49
  +++ StandardJMeterEngine.java 20 Jun 2004 01:23:40 -0000      1.50
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2000-2004 The Apache Software Foundation.
    * 
  @@ -48,8 +47,6 @@
   import org.apache.log.Logger;
   
   /**
  - * @author ?
  - * @version $Revision$ Updated on: $Date$
    */
   public class StandardJMeterEngine implements JMeterEngine, JMeterThreadMonitor,
         Runnable, Serializable
  @@ -57,14 +54,14 @@
      transient private static Logger log = LoggingManager.getLoggerForClass();
      private transient Thread runningThread;
      private static long WAIT_TO_DIE = 5 * 1000; //5 seconds
  -   transient Map allThreads;
  -   boolean running = false;
  -   boolean serialized = false;
  -   boolean schcdule_run = false;
  -   HashTree test;
  -   transient SearchByClass testListeners;
  -   String host = null;
  -   transient ListenerNotifier notifier;
  +   private transient Map allThreads;
  +   private boolean running = false;
  +   private boolean serialized = false;
  +   private volatile boolean schcdule_run = false;
  +   private HashTree test;
  +   private transient SearchByClass testListeners;
  +   private String host = null;
  +   private transient ListenerNotifier notifier;
   
      public StandardJMeterEngine()
      {
  
  
  
  1.38      +1 -3      
jakarta-jmeter/src/core/org/apache/jmeter/reporters/ResultCollector.java
  
  Index: ResultCollector.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/reporters/ResultCollector.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- ResultCollector.java      20 Jun 2004 00:32:52 -0000      1.37
  +++ ResultCollector.java      20 Jun 2004 01:23:40 -0000      1.38
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -56,7 +55,6 @@
   
   
   /**
  - * @version $Revision$ on $Date$
    */
   public class ResultCollector
       extends AbstractListenerElement
  @@ -81,7 +79,7 @@
       //private int current;
       transient private DefaultConfigurationSerializer serializer;
       //private boolean inLoading = false;
  -    transient private PrintWriter out;
  +    transient private volatile PrintWriter out;
       private boolean inTest = false;
       private static Map files = new HashMap();
       private Set hosts = new HashSet();
  
  
  
  1.6       +8 -8      
jakarta-jmeter/src/core/org/apache/jmeter/reporters/ResultSaver.java
  
  Index: ResultSaver.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/reporters/ResultSaver.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ResultSaver.java  20 May 2004 19:18:40 -0000      1.5
  +++ ResultSaver.java  20 Jun 2004 01:23:40 -0000      1.6
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2003-2004 The Apache Software Foundation.
    *
  @@ -38,7 +37,6 @@
    * 
    * This is mainly intended for validation tests
    * 
  - * @version $Revision$ Last updated: $Date$
    */
   public class ResultSaver
       extends AbstractTestElement
  @@ -100,11 +98,8 @@
                SampleResult s = e.getResult();
                saveSample(s);
                SampleResult []sr = s.getSubResults();
  -             if (sr != null){
  -                     for (int i = 0; i < sr.length; i++){
  -                             saveSample(sr[i]);
  -                     }
  -
  +             for (int i = 0; i < sr.length; i++){
  +                     saveSample(sr[i]);
                }
       }
   
  @@ -121,11 +116,16 @@
                try {
                        pw = new FileOutputStream(out);
                        pw.write(s.getResponseData());
  -                     pw.close();
                } catch (FileNotFoundException e1) {
                        log.error("Error creating sample file for 
"+s.getSampleLabel(),e1);
                } catch (IOException e1) {
                        log.error("Error saving sample "+s.getSampleLabel(),e1);
  +             }
  +             finally
  +             {
  +                     try {
  +                             if (pw != null) pw.close();
  +                     } catch (IOException e) {}
                }
        }
        /**
  
  
  
  1.7       +12 -6     
jakarta-jmeter/src/core/org/apache/jmeter/reporters/Summariser.java
  
  Index: Summariser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/reporters/Summariser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Summariser.java   28 May 2004 21:09:12 -0000      1.6
  +++ Summariser.java   20 Jun 2004 01:23:40 -0000      1.7
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2003-2004 The Apache Software Foundation.
    *
  @@ -44,7 +43,6 @@
    * 
    * This is mainly intended for batch (non-GUI) runs
    * 
  - * @version $Revision$ Last updated: $Date$
    */
   public class Summariser
       extends AbstractTestElement
  @@ -252,9 +250,17 @@
                sb.append(" ");
           sb.append(longToSb(tmp,s.getCount(),5));
           sb.append(" in ");
  -             sb.append(longToSb(tmp,s.getElapsed()/1000,5));
  +        long elapsed = s.getElapsed();
  +             sb.append(doubleToSb(tmp,(double)elapsed/1000.0,5,1));
                sb.append("s = ");
  -             sb.append(doubleToSb(tmp,s.getRate(),6,1));
  +             if (elapsed > 0)
  +             {
  +                     sb.append(doubleToSb(tmp,s.getRate(),6,1));                    
 
  +             }
  +             else
  +             {
  +                     sb.append("******");// Rate is effectively infinite
  +             }
                sb.append("/s Avg: ");
                sb.append(longToSb(tmp,(long)s.getMean(),5));
                sb.append(" Min: ");
  @@ -264,8 +270,8 @@
                sb.append(" Err: ");
                sb.append(longToSb(tmp,s.getErrorCount(),5));
                sb.append(" (");
  -             sb.append(doubleToSb(tmp,s.getErrorPercentage(),3,1));
  -             sb.append("%)");
  +             sb.append(s.getErrorPercentageString());
  +             sb.append(")");
           return sb.toString();
       }
   
  
  
  
  1.32      +7 -5      
jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java
  
  Index: SampleResult.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- SampleResult.java 12 Jun 2004 17:11:44 -0000      1.31
  +++ SampleResult.java 20 Jun 2004 01:23:40 -0000      1.32
  @@ -59,8 +59,10 @@
        */
       public final static String BINARY = "bin";
   
  -     /* empty array which can be returned instead of null */
  +     /* empty arrays which can be returned instead of null */
        private static final byte [] EMPTY_BA = new byte [0];
  +     private static final SampleResult [] EMPTY_SR = new SampleResult[0];
  +     private static final AssertionResult [] EMPTY_AR = new AssertionResult[0];
   
       private byte[] responseData;
       private String responseCode;
  @@ -283,13 +285,13 @@
        * Gets the assertion results associated with this sample.
        *
        * @return an array containing the assertion results for this sample.
  -     *         Returns null if there are no assertion results.
  +     *         Returns empty array if there are no assertion results.
        */
       public AssertionResult[] getAssertionResults()
       {
           if (assertionResults == null)
           {
  -            return null;
  +            return EMPTY_AR;
           }
           return (AssertionResult[]) assertionResults.toArray(
               new AssertionResult[0]);
  @@ -309,13 +311,13 @@
        * Gets the subresults associated with this sample.
        *
        * @return an array containing the subresults for this sample. Returns
  -     *         null if there are no subresults.
  +     *         an empty array if there are no subresults.
        */
       public SampleResult[] getSubResults()
       {
           if (subResults == null)
           {
  -            return null;
  +            return EMPTY_SR;
           }
           return (SampleResult[]) subResults.toArray(new SampleResult[0]);
       }
  
  
  
  1.40      +2 -2      jakarta-jmeter/src/core/org/apache/jmeter/save/SaveService.java
  
  Index: SaveService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/save/SaveService.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- SaveService.java  20 Jun 2004 00:32:52 -0000      1.39
  +++ SaveService.java  20 Jun 2004 01:23:40 -0000      1.40
  @@ -36,8 +36,8 @@
   /**
    * @author mstover
    *
  - * To change the template for this generated type comment go to
  - * Window - Preferences - Java - Code Generation - Code and Comments
  + * @author     Mike Stover
  + * @author     <a href="mailto:kcassell&#X0040;apache.org";>Keith Cassell</a>
    */
   public class SaveService
   {
  
  
  
  1.40      +1 -3      
jakarta-jmeter/src/core/org/apache/jmeter/testelement/AbstractTestElement.java
  
  Index: AbstractTestElement.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testelement/AbstractTestElement.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- AbstractTestElement.java  20 Jun 2004 00:32:53 -0000      1.39
  +++ AbstractTestElement.java  20 Jun 2004 01:23:40 -0000      1.40
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -43,7 +42,6 @@
   import org.apache.log.Logger;
   
   /**
  - * @version   $Revision$ on $Date$
    */
   public abstract class AbstractTestElement implements TestElement, Serializable
   {
  @@ -457,7 +455,7 @@
        public void setThreadName(String inthreadName) {
                if (threadName != null)
                {
  -                     if (inthreadName != threadName)
  +                     if (!threadName.equals(inthreadName))
                        throw new RuntimeException("Attempting to reset the thread 
name");
                }
                this.threadName = inthreadName;
  
  
  
  1.4       +5 -7      
jakarta-jmeter/src/core/org/apache/jmeter/visualizers/RunningSample.java
  
  Index: RunningSample.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/visualizers/RunningSample.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RunningSample.java        12 Jun 2004 17:11:44 -0000      1.3
  +++ RunningSample.java        20 Jun 2004 01:23:40 -0000      1.4
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -29,7 +28,6 @@
    * the stats out with whatever methods you prefer.
    *
    * @author James Boutcher
  - * @version $Revision$
    */
   public class RunningSample
   {
  @@ -38,11 +36,11 @@
       private static DecimalFormat errorFormatter = new DecimalFormat("#0.00%");
   
       private long counter;
  -    private long runningSum;
  -    private long max, min;
  -    private long errorCount;
  -    private long firstTime;
  -    private long lastTime;
  +    private volatile long runningSum;
  +    private volatile long max, min;
  +    private volatile long errorCount;
  +    private volatile long firstTime;
  +    private volatile long lastTime;
       private String label;
       private int index;
   
  
  
  
  1.2       +2 -2      
jakarta-jmeter/src/examples/org/apache/jmeter/examples/testbeans/example1/Example1.java
  
  Index: Example1.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/examples/org/apache/jmeter/examples/testbeans/example1/Example1.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Example1.java     25 Feb 2004 22:34:20 -0000      1.1
  +++ Example1.java     20 Jun 2004 01:23:40 -0000      1.2
  @@ -6,9 +6,9 @@
    */
   package org.apache.jmeter.examples.testbeans.example1;
   
  +import org.apache.jmeter.samplers.AbstractSampler;
   import org.apache.jmeter.samplers.Entry;
   import org.apache.jmeter.samplers.SampleResult;
  -import org.apache.jmeter.samplers.Sampler;
   import org.apache.jmeter.testbeans.TestBean;
   
   /**
  @@ -16,7 +16,7 @@
    * usage of the TestBean features to podential TestBean developers. Note that only 
the class's
    * introspector view matters: the methods do nothing -- nothing useful, in any case.
    */
  -public class Example1 extends TestBean implements Sampler {
  +public class Example1 extends AbstractSampler implements TestBean {
        public SampleResult sample(Entry e) {
                return new SampleResult();
        }
  
  
  
  1.2       +2 -2      
jakarta-jmeter/src/examples/org/apache/jmeter/examples/testbeans/example2/Example2.java
  
  Index: Example2.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/examples/org/apache/jmeter/examples/testbeans/example2/Example2.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Example2.java     25 Feb 2004 22:34:20 -0000      1.1
  +++ Example2.java     20 Jun 2004 01:23:40 -0000      1.2
  @@ -6,9 +6,9 @@
    */
   package org.apache.jmeter.examples.testbeans.example2;
   
  +import org.apache.jmeter.samplers.AbstractSampler;
   import org.apache.jmeter.samplers.Entry;
   import org.apache.jmeter.samplers.SampleResult;
  -import org.apache.jmeter.samplers.Sampler;
   import org.apache.jmeter.testbeans.TestBean;
   
   /**
  @@ -16,7 +16,7 @@
    * usage of the TestBean features to podential TestBean developers. Note that only 
the class's
    * introspector view matters: the methods do nothing -- nothing useful, in any case.
    */
  -public class Example2 extends TestBean implements Sampler {
  +public class Example2 extends AbstractSampler implements TestBean {
        public SampleResult sample(Entry e) {
                return new SampleResult();
        }
  
  
  
  1.4       +40 -7     
jakarta-jmeter/src/functions/org/apache/jmeter/functions/LogFunction.java
  
  Index: LogFunction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/functions/org/apache/jmeter/functions/LogFunction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LogFunction.java  30 Mar 2004 18:07:07 -0000      1.3
  +++ LogFunction.java  20 Jun 2004 01:23:40 -0000      1.4
  @@ -91,13 +91,46 @@
                        t = new Throwable(((CompoundVariable) values[2]).execute());
                }
                
  -             // N.B. if the string is not recognised, DEBUG is assumed
  -        Priority p = Priority.getPriorityForName(priorityString);
  -
  -        log.log(p,stringToLog,t);
  -        
  +             logDetails(log,stringToLog,priorityString,t);
  +             
           return stringToLog;
   
  +    }
  +
  +    // Common output function
  +    private static void printDetails(java.io.PrintStream ps,String s, Throwable t)
  +    {
  +             String tn = Thread.currentThread().getName();
  +             if (t != null)
  +             {
  +                     ps.print("Log: "+ tn + " : " + s + " ");
  +                     t.printStackTrace(ps);
  +             }
  +             else
  +             {
  +                     ps.println("Log: "+ tn + " : " + s);
  +             }
  +    }
  +    
  +    // Routine to perform the output (also used by __logn() function)
  +    static void logDetails(Logger l,String s,String prio,Throwable t)
  +    {
  +             if (prio.equalsIgnoreCase("OUT")) //$NON-NLS-1
  +             {
  +                     printDetails(System.out,s,t);
  +             }
  +             else 
  +             if (prio.equalsIgnoreCase("ERR")) //$NON-NLS-1
  +             {
  +                     printDetails(System.err,s,t);
  +             }
  +             else
  +             {
  +                     // N.B. if the string is not recognised, DEBUG is assumed
  +                     Priority p = Priority.getPriorityForName(prio);
  +            log.log(p,s,t);
  +             }
  +     
       }
   
       public void setParameters(Collection parameters)
  
  
  
  1.4       +3 -7      
jakarta-jmeter/src/functions/org/apache/jmeter/functions/LogFunction2.java
  
  Index: LogFunction2.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/functions/org/apache/jmeter/functions/LogFunction2.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LogFunction2.java 30 Mar 2004 18:07:07 -0000      1.3
  +++ LogFunction2.java 20 Jun 2004 01:23:40 -0000      1.4
  @@ -28,7 +28,6 @@
   import org.apache.jmeter.samplers.Sampler;
   import org.apache.jorphan.logging.LoggingManager;
   import org.apache.log.Logger;
  -import org.apache.log.Priority;
   
   /**
    * Function to log a message
  @@ -90,11 +89,8 @@
                if (values.length > 2){ // Throwable wanted
                        t = new Throwable(((CompoundVariable) values[2]).execute());
                }
  -             
  -             // N.B. if the string is not recognised, DEBUG is assumed
  -        Priority p = Priority.getPriorityForName(priorityString);
   
  -        log.log(p,stringToLog,t);
  +             LogFunction.logDetails(log,stringToLog,priorityString,t);
           
           return "";
   
  
  
  
  1.6       +1 -3      
jakarta-jmeter/src/functions/org/apache/jmeter/functions/Random.java
  
  Index: Random.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/functions/org/apache/jmeter/functions/Random.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Random.java       20 May 2004 19:18:40 -0000      1.5
  +++ Random.java       20 Jun 2004 01:23:40 -0000      1.6
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2003-2004 The Apache Software Foundation.
    *
  @@ -34,7 +33,6 @@
    * a min (first argument) and a max (seceond argument).
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jonathan Kwadzo</a>
  - * @version $Id$
    */
   public class Random extends AbstractFunction implements Serializable
   {
  @@ -98,7 +96,7 @@
        *
        * @see Function#setParameters(Collection)
        */
  -    public void setParameters(Collection parameters)
  +    public synchronized void setParameters(Collection parameters)
           throws InvalidVariableException
       {
           Object[] values = parameters.toArray();
  
  
  
  1.15      +3 -3      
jakarta-jmeter/src/functions/org/apache/jmeter/functions/StringFromFile.java
  
  Index: StringFromFile.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/functions/org/apache/jmeter/functions/StringFromFile.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- StringFromFile.java       30 Mar 2004 18:07:07 -0000      1.14
  +++ StringFromFile.java       20 Jun 2004 01:23:40 -0000      1.15
  @@ -261,7 +261,7 @@
        * 
        * @see org.apache.jmeter.functions.Function#setParameters(Collection)
        */
  -    public void setParameters(Collection parameters)
  +    public synchronized void setParameters(Collection parameters)
           throws InvalidVariableException
       {
   
  
  
  
  1.7       +0 -1      
jakarta-jmeter/src/monitor/model/org/apache/jmeter/monitor/model/ObjectFactory.java
  
  Index: ObjectFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/monitor/model/org/apache/jmeter/monitor/model/ObjectFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ObjectFactory.java        29 May 2004 12:31:09 -0000      1.6
  +++ ObjectFactory.java        20 Jun 2004 01:23:40 -0000      1.7
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2004 The Apache Software Foundation.
    *
  
  
  
  1.12      +0 -3      
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/HtmlParsingUtils.java
  
  Index: HtmlParsingUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/parser/HtmlParsingUtils.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- HtmlParsingUtils.java     6 Jun 2004 22:22:55 -0000       1.11
  +++ HtmlParsingUtils.java     20 Jun 2004 01:23:40 -0000      1.12
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2003-2004 The Apache Software Foundation.
    *
  @@ -46,13 +45,11 @@
   /**
    * @author    Michael Stover
    * Created   June 14, 2001
  - * @version   $Revision$ Last updated: $Date$
    */
   public final class HtmlParsingUtils
   {
       transient private static Logger log = LoggingManager.getLoggerForClass();
   
  -    //NOTUSED protected static String utfEncodingName;
       /* NOTUSED 
       private int compilerOptions =
           Perl5Compiler.CASE_INSENSITIVE_MASK
  
  
  
  1.5       +4 -3      
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
  
  Index: HTTPSamplerBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HTTPSamplerBase.java      12 Jun 2004 17:11:45 -0000      1.4
  +++ HTTPSamplerBase.java      20 Jun 2004 01:23:40 -0000      1.5
  @@ -98,7 +98,9 @@
                "Non HTTP response code";
        protected final static String NON_HTTP_RESPONSE_MESSAGE=
                "Non HTTP response message";
  -
  +     
  +     private static Pattern pattern;
  +     
       static {
           try
           {
  @@ -593,8 +595,7 @@
       }
   
        protected abstract HTTPSampleResult sample(URL u, String s, boolean b, int i);
  -
  -     private static final Pattern pattern;
  +     
        private static ThreadLocal localMatcher = new ThreadLocal()
            {
                protected synchronized Object initialValue()
  
  
  
  1.15      +0 -2      
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
  
  Index: PostWriter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- PostWriter.java   6 Jun 2004 22:24:57 -0000       1.14
  +++ PostWriter.java   20 Jun 2004 01:23:40 -0000      1.15
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -32,7 +31,6 @@
   import org.apache.jmeter.testelement.property.PropertyIterator;
   
   /**
  - * @version $Revision$
    */
   
   public class PostWriter
  
  
  
  1.7       +1 -2      
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util/DOMPool.java
  
  Index: DOMPool.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util/DOMPool.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMPool.java      6 Jun 2004 22:25:55 -0000       1.6
  +++ DOMPool.java      20 Jun 2004 01:23:40 -0000      1.7
  @@ -1,4 +1,3 @@
  -// $Header$
   /*
    * Copyright 2003-2004 The Apache Software Foundation.
    *
  @@ -36,7 +35,7 @@
    * <p>
    * Created on:  Jun 17, 2003<br>
    * 
  - * @version $Revision$
  + * @author Peter Lin
    */
   public final class DOMPool
   {
  
  
  
  1.7       +15 -15    
jakarta-jmeter/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
  
  Index: TCPConfigGui.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TCPConfigGui.java 12 Jun 2004 17:11:45 -0000      1.6
  +++ TCPConfigGui.java 20 Jun 2004 01:23:41 -0000      1.7
  @@ -45,7 +45,7 @@
   
       private JTextField server;
       private JTextField port;
  -     private JTextField filename;
  +     //NOTUSED yet private JTextField filename;
        private JTextField timeout;
       private JCheckBox setNoDelay;
   
  @@ -172,20 +172,20 @@
                return reqDataPanel;
   
        }
  -    private JPanel createFilenamePanel()//Not used yet
  -     {
  -             
  -             JLabel label = new 
JLabel(JMeterUtils.getResString("file_to_retrieve"));
  -
  -             filename = new JTextField(10);
  -             filename.setName(FILENAME);
  -             label.setLabelFor(filename);
  -
  -             JPanel filenamePanel = new JPanel(new BorderLayout(5, 0));
  -             filenamePanel.add(label, BorderLayout.WEST);
  -             filenamePanel.add(filename, BorderLayout.CENTER);
  -             return filenamePanel;
  -     }
  +//    private JPanel createFilenamePanel()//Not used yet
  +//   {
  +//           
  +//           JLabel label = new 
JLabel(JMeterUtils.getResString("file_to_retrieve"));
  +//
  +//           filename = new JTextField(10);
  +//           filename.setName(FILENAME);
  +//           label.setLabelFor(filename);
  +//
  +//           JPanel filenamePanel = new JPanel(new BorderLayout(5, 0));
  +//           filenamePanel.add(label, BorderLayout.WEST);
  +//           filenamePanel.add(filename, BorderLayout.CENTER);
  +//           return filenamePanel;
  +//   }
   
       private void init()
       {
  
  
  
  1.16      +21 -10    jakarta-jmeter/xdocs/usermanual/functions.xml
  
  Index: functions.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/xdocs/usermanual/functions.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- functions.xml     12 Jun 2004 17:11:45 -0000      1.15
  +++ functions.xml     20 Jun 2004 01:23:41 -0000      1.16
  @@ -1,6 +1,5 @@
   <?xml version="1.0"?>
   <!--
  -   $Header$
      Copyright 2001-2004 The Apache Software Foundation
    
      Licensed under the Apache License, Version 2.0 (the "License");
  @@ -15,7 +14,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
   -->
  -<document prev="component_reference.html" next="glossary.html" date="$Date$">
  +<document prev="component_reference.html" next="glossary.html" date="2004/06/12">
   
   <properties>
     <title>User's Manual: Introduction</title>
  @@ -105,7 +104,7 @@
   </p></description>
   
   <properties>
  -        <property name="First arguement" required="Yes">The first argument is the 
regular expression
  +        <property name="First argument" required="Yes">The first argument is the 
regular expression
           to be applied to the response data.  It will grab all matches.  Any parts 
of this expression
           that you wish to use in your template string, be sure to surround in 
parentheses.  Example:
           &amp;lt;a href="(.*)"&amp;gt;.  This will grab the value of the link and 
store it as the first group (there is
  @@ -217,17 +216,23 @@
   <p/>
   Examples:<br/>
    pin#.dat -> pin1.dat, ... pin9.dat, pin10.dat, ... pin9999.dat<br/>
  - pin000.dat -> pin001.dat ... pin099.dat ... pin999.dat ... pin9999.dat
  + pin000.dat -> pin001.dat ... pin099.dat ... pin999.dat ... pin9999.dat<br/>
  + pin'.'dat# -> pin.dat1, ... pin.dat9 ... pin.dat999<br/>
  + N.B: pin.dat# -> pin1.0dat, ... pin9.0dat ... pin999.0dat<br/>
   </code><p/>
        If more digits are required than there are formatting characters, the number 
will be
  -     expanded as necessary. To prevent a formatting character from being 
interpreted,
  -     enclose it in single quotes. See the documentation for DecimalFormat for full 
details.
  -     <br></br>
  +     expanded as necessary.<br/>
  +     To prevent a formatting character from being interpreted,
  +     enclose it in single quotes. Note that the decimal point is a formatting 
character,
  +     and must be enclosed in single quotes (though it works as expected for #. and 
000.)
  +     N.B. the decimal point varies between locales, but in the UK and US, at least, 
it is
  +     the same character as is used to separate parts of file names.<br/>
  +     See the documentation for DecimalFormat for full details.<br/>
        If the path name does not contain any special formatting characters,
        it will be unaffected by the current sequence number. 
        In this case, specifying only a start sequence number will have no effect,
        but specifying a start and end sequence number will result in the file
  -     being used at mose end-start+1 times.
  +     being used at most end-start+1 times.
        
        </p>
   </component>
  @@ -375,9 +380,12 @@
   
   <properties>
           <property name="String to be logged" required="Yes">A string</property>
  -        <property name="Log Level" required="No">DEBUG, INFO (default), WARN or 
ERROR</property>
  +        <property name="Log Level" required="No">OUT, ERR, DEBUG, INFO (default), 
WARN or ERROR</property>
           <property name="Throwable text" required="No">If non-empty, creates a 
Throwable to pass to the logger</property>
   </properties>
  +<p>The OUT and ERR log level names are used to direct the output to System.out and 
System.err respectively.
  +     In this case, the output is always printed - it does not depend on the current 
log setting.
  +</p>
   </component>
   
   <component index="16.5.12" name="__logn">
  @@ -389,9 +397,12 @@
   
   <properties>
           <property name="String to be logged" required="Yes">A string</property>
  -        <property name="Log Level" required="No">DEBUG, INFO (default), WARN or 
ERROR</property>
  +        <property name="Log Level" required="No">OUT, ERR, DEBUG, INFO (default), 
WARN or ERROR</property>
           <property name="Throwable text" required="No">If non-empty, creates a 
Throwable to pass to the logger</property>
   </properties>
  +<p>The OUT and ERR log level names are used to direct the output to System.out and 
System.err respectively.
  +     In this case, the output is always printed - it does not depend on the current 
log setting.
  +</p>
   </component>
   
   <component index="16.5.13" name="__BeanShell">
  
  
  

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

Reply via email to