sebb        2003/12/19 09:53:40

  Modified:    src/core/org/apache/jmeter/samplers SampleResult.java
  Log:
  Add constructors to allow creation but not update of timestamp and elapsed
  
  Revision  Changes    Path
  1.21      +33 -2     
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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- SampleResult.java 19 Dec 2003 17:01:56 -0000      1.20
  +++ SampleResult.java 19 Dec 2003 17:53:40 -0000      1.21
  @@ -128,6 +128,37 @@
   
       transient private static Logger log = LoggingManager.getLoggerForClass();
   
  +    public SampleResult()
  +    {
  +     time = 0;
  +    }
  +    
  +    /**
  +     * Allow users to create a sample with a specific elapsed time
  +     * for cloning and test purposes, but don't allow the time to be
  +     * changed later
  +     * 
  +     * @param elapsed time
  +     */
  +     public SampleResult(long elapsed)
  +     {
  +             time = elapsed;
  +     }
  +    
  +    /**
  +     * Allow users to create a sample with specific start and elapsed times
  +     * for cloning and test purposes, but don't allow the times to be
  +     * changed later
  +     * 
  +     * @param stamp
  +     * @param elapsed
  +     */
  +     public SampleResult(long stamp, long elapsed)
  +     {
  +             timeStamp = stamp;
  +             time = elapsed;
  +     }
  +
       public void setMarked(String filename)
       {
           if (files == null)
  @@ -249,7 +280,7 @@
   
       public void configure(Configuration info)
       {
  -        setTime(info.getAttributeAsLong(TOTAL_TIME, 0L));
  +        time = info.getAttributeAsLong(TOTAL_TIME, 0L);
       }
   
       /**
  
  
  

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

Reply via email to