|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.pfl.test.JUnitReportHelper
public class JUnitReportHelper
Helper class for generating reports for tests that do not adapt well to Testng/JUnit. For example, several tests re-run the same test method and class many times with different parameters. JUnit does not support this at all. Testng does, but it is too much work to adapt these tests. Instead, we can just bracket test case execution with start/(pass|fail) calls.
| Nested Class Summary | |
|---|---|
static class |
JUnitReportHelper.Counts
|
| Constructor Summary | |
|---|---|
JUnitReportHelper(java.lang.String cname)
Prepare to generate a JUnitReport in the file named ${junit.report.dir}/${name}.xml. |
|
| Method Summary | |
|---|---|
JUnitReportHelper.Counts |
done()
Testing is complete. |
void |
fail(java.lang.String msg)
Report that the current test failed with an error message. |
void |
fail(java.lang.String msg,
long duration)
Report that the current test failed with an error message. |
void |
fail(java.lang.Throwable thr)
Report that the current test failed with the given exception as cause. |
void |
fail(java.lang.Throwable thr,
long duration)
Report that the current test failed with the given exception as cause. |
void |
pass()
Report that the current test passed. |
void |
pass(long duration)
Report that the current test passed. |
void |
start(java.lang.String name)
Start executing a test case with the given name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JUnitReportHelper(java.lang.String cname)
cname - The class name of the class for this test| Method Detail |
|---|
public void start(java.lang.String name)
name - The name of the test casepublic void pass()
public void fail(java.lang.String msg)
public void fail(java.lang.Throwable thr)
public void pass(long duration)
public void fail(java.lang.String msg,
long duration)
public void fail(java.lang.Throwable thr,
long duration)
public JUnitReportHelper.Counts done()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||