1 18 19 package org.apache.jmeter.control; 20 21 import java.io.Serializable ; 22 import java.util.Random ; 23 24 28 public class RandomController extends InterleaveControl implements Serializable  29 { 30 static Random rand = new Random (); 31 32 public RandomController() 33 { 34 } 35 36 39 protected void resetCurrent() 40 { 41 if (getSubControllers().size() > 0) 42 { 43 current = rand.nextInt(this.getSubControllers().size()); 44 } 45 else 46 { 47 current = 0; 48 } 49 } 50 51 54 protected void incrementCurrent() 55 { 56 super.incrementCurrent(); 57 current = rand.nextInt(this.getSubControllers().size()); 58 } 59 60 } 61 | Popular Tags |