Java Doc for JUnitTestRunner.java in  » Build » ANT » org » apache » tools » ant » taskdefs » optional » junit » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant.taskdefs.optional.junit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner

JUnitTestRunner
public class JUnitTestRunner implements TestListener,JUnitTaskMirror.JUnitTestRunnerMirror(Code)
Simple Testrunner for JUnit that runs all tests of a testsuite.

This TestRunner expects a name of a TestCase class as its argument. If this class provides a static suite() method it will be called and the resulting Test will be run. So, the signature should be


 public static junit.framework.Test suite()
 

If no such method exists, all public methods starting with "test" and taking no argument will be run.

Summary output is generated at the end.
since:
   Ant 1.2




Constructor Summary
public  JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure)
     Constructor for fork=true or when the user hasn't specified a classpath.
public  JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput)
     Constructor for fork=true or when the user hasn't specified a classpath.
public  JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput, boolean logTestListenerEvents)
     Constructor for fork=true or when the user hasn't specified a classpath.
public  JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, ClassLoader loader)
     Constructor to use when the user has specified a classpath.
public  JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput, ClassLoader loader)
     Constructor to use when the user has specified a classpath.
public  JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput, boolean logTestListenerEvents, ClassLoader loader)
     Constructor to use when the user has specified a classpath.

Method Summary
public  voidaddError(Test test, Throwable t)
     Interface TestListener.
public  voidaddFailure(Test test, Throwable t)
     Interface TestListener for JUnit <= 3.4.
public  voidaddFailure(Test test, AssertionFailedError t)
     Interface TestListener for JUnit > 3.4.
public  voidaddFormatter(JUnitResultFormatter f)
     Add a formatter.
public  voidaddFormatter(JUnitTaskMirror.JUnitResultFormatterMirror f)
     .
public  voidendTest(Test test)
     Interface TestListener.
public static  StringfilterStack(String stack)
     Filters stack frames from internal JUnit and Ant classes
Parameters:
  stack - the stack trace to filter.
public static  StringgetFilteredTrace(Throwable t)
     Returns a filtered stack trace. This is ripped out of junit.runner.BaseTestRunner.
Parameters:
  t - the exception to filter.
public  intgetRetCode()
     Returns what System.exit() would return in the standalone version.
public  voidhandleErrorFlush(String output)
     .
public  voidhandleErrorOutput(String output)
     .
public  voidhandleFlush(String output)
     .
public  inthandleInput(byte[] buffer, int offset, int length)
     Handle input.
Parameters:
  buffer - not used.
Parameters:
  offset - not used.
Parameters:
  length - not used.
public  voidhandleOutput(String output)
     Handle a string destined for standard output.
public static  voidmain(String[] args)
     Entry point for standalone (forked) mode. Parameters: testcaseclassname plus parameters in the format key=value, none of which is required.
keydescriptiondefault value
haltOnErrorhalt test on errors?false
haltOnFailurehalt test on failures?false
formatterA JUnitResultFormatter given as classname,filename.
public  voidrun()
     Run the test.
public  voidsetPermissions(Permissions permissions)
     Permissions for the test run.
public  voidstartTest(Test t)
     Interface TestListener.


Constructor Detail
JUnitTestRunner
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure)(Code)
Constructor for fork=true or when the user hasn't specified a classpath.
Parameters:
  test - the test to run.
Parameters:
  haltOnError - whether to stop the run if an error is found.
Parameters:
  filtertrace - whether to filter junit.*.* stack frames out of exceptions
Parameters:
  haltOnFailure - whether to stop the run if failure is found.



JUnitTestRunner
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput)(Code)
Constructor for fork=true or when the user hasn't specified a classpath.
Parameters:
  test - the test to run.
Parameters:
  haltOnError - whether to stop the run if an error is found.
Parameters:
  filtertrace - whether to filter junit.*.* stack frames out of exceptions
Parameters:
  haltOnFailure - whether to stop the run if failure is found.
Parameters:
  showOutput - whether to send output to System.out/.err as well as formatters.



JUnitTestRunner
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput, boolean logTestListenerEvents)(Code)
Constructor for fork=true or when the user hasn't specified a classpath.
Parameters:
  test - the test to run.
Parameters:
  haltOnError - whether to stop the run if an error is found.
Parameters:
  filtertrace - whether to filter junit.*.* stack frames out of exceptions
Parameters:
  haltOnFailure - whether to stop the run if failure is found.
Parameters:
  showOutput - whether to send output to System.out/.err as well as formatters.
Parameters:
  logTestListenerEvents - whether to print TestListener events.
since:
   Ant 1.7



JUnitTestRunner
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, ClassLoader loader)(Code)
Constructor to use when the user has specified a classpath.
Parameters:
  test - the test to run.
Parameters:
  haltOnError - whether to stop the run if an error is found.
Parameters:
  filtertrace - whether to filter junit.*.* stack frames out of exceptions
Parameters:
  haltOnFailure - whether to stop the run if failure is found.
Parameters:
  loader - the classloader to use running the test.



JUnitTestRunner
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput, ClassLoader loader)(Code)
Constructor to use when the user has specified a classpath.
Parameters:
  test - the test to run.
Parameters:
  haltOnError - whether to stop the run if an error is found.
Parameters:
  filtertrace - whether to filter junit.*.* stack frames out of exceptions
Parameters:
  haltOnFailure - whether to stop the run if failure is found.
Parameters:
  showOutput - whether to send output to System.out/.err as well as formatters.
Parameters:
  loader - the classloader to use running the test.



JUnitTestRunner
public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filtertrace, boolean haltOnFailure, boolean showOutput, boolean logTestListenerEvents, ClassLoader loader)(Code)
Constructor to use when the user has specified a classpath.
Parameters:
  test - the test to run.
Parameters:
  haltOnError - whether to stop the run if an error is found.
Parameters:
  filtertrace - whether to filter junit.*.* stack frames out of exceptions
Parameters:
  haltOnFailure - whether to stop the run if failure is found.
Parameters:
  showOutput - whether to send output to System.out/.err as well as formatters.
Parameters:
  logTestListenerEvents - whether to print TestListener events.
Parameters:
  loader - the classloader to use running the test.
since:
   Ant 1.7




Method Detail
addError
public void addError(Test test, Throwable t)(Code)
Interface TestListener.

An error occurred while running the test.
Parameters:
  test - the test.
Parameters:
  t - the error thrown by the test.




addFailure
public void addFailure(Test test, Throwable t)(Code)
Interface TestListener for JUnit <= 3.4.

A Test failed.
Parameters:
  test - the test.
Parameters:
  t - the exception thrown by the test.




addFailure
public void addFailure(Test test, AssertionFailedError t)(Code)
Interface TestListener for JUnit > 3.4.

A Test failed.
Parameters:
  test - the test.
Parameters:
  t - the assertion thrown by the test.




addFormatter
public void addFormatter(JUnitResultFormatter f)(Code)
Add a formatter.
Parameters:
  f - the formatter to add.



addFormatter
public void addFormatter(JUnitTaskMirror.JUnitResultFormatterMirror f)(Code)
.



endTest
public void endTest(Test test)(Code)
Interface TestListener.

A Test is finished.
Parameters:
  test - the test.




filterStack
public static String filterStack(String stack)(Code)
Filters stack frames from internal JUnit and Ant classes
Parameters:
  stack - the stack trace to filter. the filtered stack.



getFilteredTrace
public static String getFilteredTrace(Throwable t)(Code)
Returns a filtered stack trace. This is ripped out of junit.runner.BaseTestRunner.
Parameters:
  t - the exception to filter. the filtered stack trace.



getRetCode
public int getRetCode()(Code)
Returns what System.exit() would return in the standalone version. 2 if errors occurred, 1 if tests failed else 0.



handleErrorFlush
public void handleErrorFlush(String output)(Code)
.



handleErrorOutput
public void handleErrorOutput(String output)(Code)
.



handleFlush
public void handleFlush(String output)(Code)
.



handleInput
public int handleInput(byte[] buffer, int offset, int length) throws IOException(Code)
Handle input.
Parameters:
  buffer - not used.
Parameters:
  offset - not used.
Parameters:
  length - not used. -1 always.
throws:
  IOException - never.
See Also:   org.apache.tools.ant.Task.handleInput(byte[]intint)
since:
   Ant 1.6



handleOutput
public void handleOutput(String output)(Code)
Handle a string destined for standard output.
Parameters:
  output - the string to output



main
public static void main(String[] args) throws IOException(Code)
Entry point for standalone (forked) mode. Parameters: testcaseclassname plus parameters in the format key=value, none of which is required.
keydescriptiondefault value
haltOnErrorhalt test on errors?false
haltOnFailurehalt test on failures?false
formatterA JUnitResultFormatter given as classname,filename. If filename is ommitted, System.out is assumed.none
showoutputsend output to System.err/.out as well as to the formatters?false
logtestlistenereventslog TestListener events to System.out.false

Parameters:
  args - the command line arguments.
throws:
  IOException - on error.



run
public void run()(Code)
Run the test.



setPermissions
public void setPermissions(Permissions permissions)(Code)
Permissions for the test run.
since:
   Ant 1.6
Parameters:
  permissions - the permissions to use.



startTest
public void startTest(Test t)(Code)
Interface TestListener.

A new Test is started.
Parameters:
  t - the test.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

w___w_w__.j___a_v_a_2_s___.___co__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.