org.testng.junit
Class JUnitTestRunner

java.lang.Object  extended by org.testng.junit.JUnitTestRunner
All Implemented Interfaces:
junit.framework.TestListener, IJUnitTestRunner

public class JUnitTestRunner
extends Object
implements junit.framework.TestListener, IJUnitTestRunner

A JUnit TestRunner that records/triggers all information/events necessary to TestNG.

Author:
Alexandru Popescu


Field Summary
static StringSUITE_METHODNAME
           
 
Constructor Summary
JUnitTestRunner()
           
JUnitTestRunner(org.testng.internal.ITestResultNotifier tr)
           
 
Method Summary
 voidaddError(junit.framework.Test test, Throwable t)
           
 voidaddFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
           
protected  junit.framework.TestResultcreateTestResult()
          Creates the TestResult to be used for the test run.
protected  junit.framework.TestResultdoRun(junit.framework.Test suite)
           
 voidendTest(junit.framework.Test test)
           
protected  junit.framework.TestgetTest(Class testClass, String... methods)
          Returns the Test corresponding to the given suite.
 List<ITestNGMethod>getTestMethods()
          Needed from TestRunner in order to figure out what JUnit test methods were run.
 voidrun(Class testClass, String... methods)
          A start implementation that ignores the TestResult
protected  voidrunFailed(Class clazz, String message)
           
 voidsetInvokedMethodListeners(List<IInvokedMethodListener> listeners)
           
 voidsetTestResultNotifier(org.testng.internal.ITestResultNotifier notifier)
           
 junit.framework.TestResultstart(Class testCase, String... methods)
          Starts a test run.
 voidstartTest(junit.framework.Test test)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUITE_METHODNAME

public static final String SUITE_METHODNAME
See Also:
Constant Field Values
Constructor Detail

JUnitTestRunner

public JUnitTestRunner()

JUnitTestRunner

public JUnitTestRunner(org.testng.internal.ITestResultNotifier tr)
Method Detail

getTestMethods

public List<ITestNGMethod> getTestMethods()
Needed from TestRunner in order to figure out what JUnit test methods were run.

Specified by:
getTestMethods in interface IJUnitTestRunner
Returns:
the list of all JUnit test methods run

setTestResultNotifier

public void setTestResultNotifier(org.testng.internal.ITestResultNotifier notifier)
Specified by:
setTestResultNotifier in interface IJUnitTestRunner

startTest

public void startTest(junit.framework.Test test)
Specified by:
startTest in interface junit.framework.TestListener
See Also:
TestListener.startTest(junit.framework.Test)

addError

public void addError(junit.framework.Test test,                     Throwable t)
Specified by:
addError in interface junit.framework.TestListener
See Also:
TestListener.addError(junit.framework.Test, java.lang.Throwable)

addFailure

public void addFailure(junit.framework.Test test,                       junit.framework.AssertionFailedError t)
Specified by:
addFailure in interface junit.framework.TestListener
See Also:
TestListener.addFailure(junit.framework.Test, junit.framework.AssertionFailedError)

endTest

public void endTest(junit.framework.Test test)
Specified by:
endTest in interface junit.framework.TestListener
See Also:
TestListener.endTest(junit.framework.Test)

setInvokedMethodListeners

public void setInvokedMethodListeners(List<IInvokedMethodListener> listeners)
Specified by:
setInvokedMethodListeners in interface IJUnitTestRunner

getTest

protected junit.framework.Test getTest(Class testClass,                                       String... methods)
Returns the Test corresponding to the given suite. This is a template method, subclasses override runFailed(), clearStatus().


run

public void run(Class testClass,                String... methods)
A start implementation that ignores the TestResult

Specified by:
run in interface IJUnitTestRunner
Parameters:
testClass - the JUnit test class

start

public junit.framework.TestResult start(Class testCase,                                        String... methods)
Starts a test run. Analyzes the command line arguments and runs the given test suite.


runFailed

protected void runFailed(Class clazz,                         String message)

createTestResult

protected junit.framework.TestResult createTestResult()
Creates the TestResult to be used for the test run.


doRun

protected junit.framework.TestResult doRun(junit.framework.Test suite)


Copyright © 2012. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14