Here's the commit where this was added:

https://github.com/jenkinsci/jenkins/commit/f9823e39d17debd2e914ce13cdeec3b43581f09e

I would call this a case of poor abstraction. Seems like the signature should 
return List<? extends MetaTabulatedResult>.

  -- Dean

From: Nalin Makar <nalin.ma...@gmail.com<mailto:nalin.ma...@gmail.com>>
Reply-To: 
"jenkinsci-...@googlegroups.com<mailto:jenkinsci-...@googlegroups.com>" 
<jenkinsci-...@googlegroups.com<mailto:jenkinsci-...@googlegroups.com>>
Date: Wednesday, January 23, 2013 10:38 AM
To: jenkinsci-dev 
<jenkinsci-...@googlegroups.com<mailto:jenkinsci-...@googlegroups.com>>, 
"jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>" 
<jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>>
Subject: Re: AbstractTestResultAction#getFailedTests()

Ping! Any information/suggestions would help.


On Mon, Jan 21, 2013 at 10:57 PM, Nalin Makar 
<nalin.ma...@gmail.com<mailto:nalin.ma...@gmail.com>> wrote:
Hi,

I have a question regarding 
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L191

AbstractTestResultAction is described as:

/**
 * Common base class for recording test result.
 *
 * <p>
 * {@link Project} and {@link Build} recognizes {@link Action}s that derive 
from this,
 * and displays it nicely (regardless of the underlying implementation.)
 *
 * @author Kohsuke Kawaguchi
 */


But the method getFailedTests() in this class returns 
List<hudson.tasks.junit.CaseResult> instead of something more generic like 
List<hudson.task.test.TestResult>

why is it done this way?

I have been updating TestNG plugin for Jenkins to fall in line with other test 
reporting plugins and have it's BuildAction implement AbstractTestResultAction, 
but I don't want to change the result classes to also have to implement a Junit 
specific class (hudson.tasks.junit.CaseResult). This means I still can't have 
email-ext plugin report on TestNG results in a generic way.

Thanks!
--
-nalin



--
-nalin

Reply via email to