I'm new in JMeter and struggle with some problems. I want to write a controller which executes Samples only at service times (e.g. 7 am to 7 pm). I want to have a continous test, so there will be no termination of the test at all.
I did following:
I wrote a JMeterTimeController class inherited from GenericController and a JMeterTimeControllerGui inherited from AbstractControllerGui.
My understanding is, that the Sample, I want to test, is nested inside this Controller.
I implemented the "public Sample next()" method, which returns the Sample at service time and returns null, if not (e.g. at 12 am).
Code is following:
public Sampler next() {
Date date = new Date(System.currentTimeMillis());
Sampler currentElement = super.next();
if (date.getHours()>6 || date.getHours()<20 ) {
return currentElement;
} else {
return null;
}
}setDone(true) isn't called, because I don't want the Test stopped.
I saw similar code in IfController.java and I wonder, why I get allways a "StackOverflow" Exception.
The tree in the Gui is following:
TestPlan
+-Thread
+-Time Controller (the one I wrote)
+-Sample
+-Config
+-Constant Throughput TimerWhat did I miss ?
Thank you for your help and suggestions,
Greetings,
Frank
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

