Exceptions are fine for fatal errors - i.e. ones that cannot be recovered from.
The normal way to report less serious errors is to use log.warn() and
log.error().
It is possible to display a dialogue box, but this is only suitable
for GUI test runs - this won't work for server or batch runs.
There are some utility routines for displaying a messages that might be useful:
GuiPackage.show[Info|Warning|Error]Message()
But remember that you need to allow for non-GUI use as well.
On 14/08/06, Mikko Ohtamaa <[EMAIL PROTECTED]> wrote:
Hi,
I'd like to give some user feedback from TestElement methods in situations
where there are faults in the test plan configuration. Currently, in
development version, I do it with exceptions. This is lame. What would be
the correct way to do this?
E.g.
public SampleResult sample(Entry e) {
JMeterContext context = getThreadContext();
ConnectionPool connectionPool = (ConnectionPool)
e.getConfigElement(ConnectionPool.class);
if(connectionPool == null) {
throw new IllegalSateException("No SIP connection
pool in the test plan");
}
}
--
Mikko Ohtamaa
[EMAIL PROTECTED]
+358 40 743 9707
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]