1 18 19 package org.apache.jmeter.timers; 20 21 import java.io.Serializable ; 22 import java.util.Random ; 23 24 import org.apache.jmeter.testelement.property.DoubleProperty; 25 import org.apache.jmeter.testelement.property.StringProperty; 26 27 36 public abstract class RandomTimer 37 extends ConstantTimer 38 implements Timer, Serializable 39 { 40 public final static String RANGE = "RandomTimer.range"; 41 42 protected Random random; 43 44 47 public RandomTimer() 48 { 49 this.random = new Random (); 50 } 51 52 55 public void setRange(double range) 56 { 57 setProperty(new DoubleProperty(RANGE, range)); 58 } 59 60 public void setRange(String range) 61 { 62 setProperty(new StringProperty(RANGE, range)); 63 } 64 65 70 public double getRange() 71 { 72 return this.getPropertyAsDouble(RANGE); 73 } 74 75 } 76 | Popular Tags |