# why this not loading in eclipse??
com.company.qa.testngListeners.ConfigurationListener
#com.company.qa.testngListeners.TestrunListener
com.company.qa.testngListeners.TestcaseListener
@Slf4j
class ConfigurationListener implements IConfigurationListener2, IExecutionListener {
//------------------------------------------------------------------------
// TODO OUCH! I have this in TestcaseListener and likely in utils. perhaps
// static ListenerUtils.methodToString
private String methodToString(ITestResult result) {
StringBuilder buf = new StringBuilder()
buf.append(result.getTestClass().getRealClass().getSimpleName())
buf.append('.')
buf.append(result.getName())
buf.append("(")
buf.append(result.getParameters()?.join(","))
buf.append(")")
return buf
}
static AtomicInteger total = new AtomicInteger(0)
static AtomicInteger success = new AtomicInteger(0)
static AtomicInteger failed = new AtomicInteger(0)
static AtomicInteger skipped = new AtomicInteger(0)
@Override
public void onConfigurationSuccess(ITestResult tr) {
success.incrementAndGet()
// TODO --> if (log.traceEnabled) trace ...
log.warn "onConfigurationSuccess: " + methodToString(tr)
}
@Override
public void onConfigurationFailure(ITestResult tr) {
failed.incrementAndGet()
// TODO maybe --> if (log.traceEnabled) trace ...
log.error "onConfigurationFailure: $tr"
}
@Override
public void onConfigurationSkip(ITestResult tr) {
skipped.incrementAndGet()
// TODO maybe --> if (log.traceEnabled) trace ...
log.warn "onConfigurationSkip: $tr"
}
@Override
public void beforeConfiguration(ITestResult tr) {
total.incrementAndGet()
// TODO --> if (log.traceEnabled) trace ...
log.debug "beforeConfiguration: " + methodToString(tr)
// TODO --> if (log.traceEnabled) trace ...
log.warn "beforeConfiguration: $tr"
}
@Override
public void onExecutionStart() {
// TODO --> if (log.traceEnabled) trace ...
log.warn "onExecutionStart()"
}
@Override
public void onExecutionFinish() {
def t = total.get()
def g = success.get()
def f = failed.get()
def s = skipped.get()
// TODO --> if (log.debugEnabled) debug ...
log.warn "onExecutionFinish: configurations run $t, succeeded: $g, failed: $f, skipped: $s"
}
I should also mention that my original version of this implemented only IConfigurationListener2. I added IExecutionListener during debugging just to see that the class was being loaded for something.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Do you have any configuration excludes the specific listener in eclipse?
I can confirm fixed using testng 6.10, eclipse plugin 6.10.0.201612030230, and eclipse neon.1a (aka 4.6.1).
thanks everyone!