hudson.plugins.testlink.result.junit
Class JUnitTestCasesTestResultSeeker<T extends TestCase>

java.lang.Object
  extended by hudson.plugins.testlink.result.TestResultSeeker<T>
      extended by hudson.plugins.testlink.result.junit.AbstractJUnitTestResultSeeker<TestCase>
          extended by hudson.plugins.testlink.result.junit.JUnitTestCasesTestResultSeeker<T>
All Implemented Interfaces:
java.io.Serializable

public class JUnitTestCasesTestResultSeeker<T extends TestCase>
extends AbstractJUnitTestResultSeeker<TestCase>

Seeks for test results of JUnit test cases.

Since:
2.5
Author:
Bruno P. Kinoshita - http://www.kinoshita.eti.br
See Also:
Serialized Form

Field Summary
protected  java.util.Set<java.lang.String> failedTestCases
          Stores a list of JUnit test cases that one or more methods failed.
protected  JUnitParser parser
           
protected  java.util.Map<java.lang.Integer,TestCaseWrapper<TestCase>> results
          Map of Wrappers for TestLink Test Cases.
 
Fields inherited from class hudson.plugins.testlink.result.TestResultSeeker
automatedTestCases, includePattern, keyCustomFieldName, listener
 
Constructor Summary
JUnitTestCasesTestResultSeeker(java.lang.String includePattern, br.eti.kinoshita.testlinkjavaapi.model.TestCase[] automatedTestCases, java.lang.String keyCustomFieldName, hudson.model.BuildListener listener)
           
 
Method Summary
protected  void addOrUpdate(TestCaseWrapper<TestCase> testResult)
          Adds or updates test result.
protected  void findTestResults(TestCase junitTestCase, java.lang.String testClassOrTestName, br.eti.kinoshita.testlinkjavaapi.model.TestCase testLinkTestCase, java.io.File junitFile)
          Looks for test results in a JUnit test case.
protected  br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getJUnitExecutionStatus(TestCase testCase, java.lang.String testClassOrTestName)
          Retrieves the Execution Status of the JUnit test.
protected  java.lang.String getJUnitNotes(TestCase testCase)
          Retrieves the Notes about the JUnit test.
protected  java.lang.String getTestClassOrTestName(TestCase junitTestCase)
          Retrieves the key value for a JUnit test.
protected  void processJUnitReports(java.io.File directory, java.lang.String[] junitReports)
          Processes all JUnit test result files.
protected  void processJUnitSuite(TestSuite junitSuite, java.io.File junitFile)
          Finds a test result for a given JUnit suite.
protected  void processJUnitTestCase(TestCase junitTestCase, java.io.File junitFile)
          Processes JUnit test case.
 java.util.Map<java.lang.Integer,TestCaseWrapper<TestCase>> seek(java.io.File directory)
          Seeks for Test Results in a directory.
 
Methods inherited from class hudson.plugins.testlink.result.junit.AbstractJUnitTestResultSeeker
getJUnitAttachment
 
Methods inherited from class hudson.plugins.testlink.result.TestResultSeeker
getBase64FileContent, getKeyCustomField, scan, split
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected final JUnitParser parser

results

protected final java.util.Map<java.lang.Integer,TestCaseWrapper<TestCase>> results
Map of Wrappers for TestLink Test Cases.


failedTestCases

protected final java.util.Set<java.lang.String> failedTestCases
Stores a list of JUnit test cases that one or more methods failed.

Constructor Detail

JUnitTestCasesTestResultSeeker

public JUnitTestCasesTestResultSeeker(java.lang.String includePattern,
                                      br.eti.kinoshita.testlinkjavaapi.model.TestCase[] automatedTestCases,
                                      java.lang.String keyCustomFieldName,
                                      hudson.model.BuildListener listener)
Method Detail

seek

public java.util.Map<java.lang.Integer,TestCaseWrapper<TestCase>> seek(java.io.File directory)
                                                                throws TestResultSeekerException
Description copied from class: TestResultSeeker
Seeks for Test Results in a directory. It tries to match the includePattern with files in this directory.

Specified by:
seek in class TestResultSeeker<TestCase>
Parameters:
directory - Directory to look for test results
Throws:
TestResultSeekerException

processJUnitReports

protected void processJUnitReports(java.io.File directory,
                                   java.lang.String[] junitReports)
Processes all JUnit test result files.


processJUnitSuite

protected void processJUnitSuite(TestSuite junitSuite,
                                 java.io.File junitFile)
Finds a test result for a given JUnit suite.


processJUnitTestCase

protected void processJUnitTestCase(TestCase junitTestCase,
                                    java.io.File junitFile)
Processes JUnit test case.


findTestResults

protected void findTestResults(TestCase junitTestCase,
                               java.lang.String testClassOrTestName,
                               br.eti.kinoshita.testlinkjavaapi.model.TestCase testLinkTestCase,
                               java.io.File junitFile)
Looks for test results in a JUnit test case.


addOrUpdate

protected void addOrUpdate(TestCaseWrapper<TestCase> testResult)
Adds or updates test result.


getTestClassOrTestName

protected java.lang.String getTestClassOrTestName(TestCase junitTestCase)
Retrieves the key value for a JUnit test. First it tries to use the test class name. If it is null, then it returns the test name.

Parameters:
junitTestCase - JUnit test.
Returns:
Test Class or Test Name value.

getJUnitExecutionStatus

protected br.eti.kinoshita.testlinkjavaapi.model.ExecutionStatus getJUnitExecutionStatus(TestCase testCase,
                                                                                         java.lang.String testClassOrTestName)
Retrieves the Execution Status of the JUnit test.

Parameters:
testCase - JUnit test.
testClassOrTestName -
Returns:
the Execution Status of the JUnit test.

getJUnitNotes

protected java.lang.String getJUnitNotes(TestCase testCase)
Retrieves the Notes about the JUnit test.

Parameters:
testCase - JUnit test.
Returns:
Notes about the JUnit test.


Copyright © 2010-2011 the Jenkins TestLink plug-in team-2011 Jenkins. All Rights Reserved.