8. @Test
(non parce que c’est une librairie de tests quand même)
expectedExceptions Méthode ou classe
timeOut
dependsOnMethods /
dependsOnGroup
expectedExceptionsMessageRegExp
groups
dataProvider
invocationCount, singleThreaded
threadPoolSize
priority
8
18. @Test @Listeners(MonListener.class)
public class maClasseDeTests { ... }
public class MonListener implements ITestListener {
public void onTestFailure(ITestResult res) { ... }
public void onFinish(ITestContext cxt) { ... }
18
24. public class TestNGFactory {
private String foo;
public TestNGFactory(String foo) { this.foo = foo; }
@Factory public Object[] factory() {
return new Object[] {
new TestNGFactory("hello"),
new TestNGFactory("Devoxx") };
}
@Test public void test() {
System.out.println("==> " + foo);
}
}
24
25. Et plein d'autres choses…
Logger inclus Rapports de résultats
(xml, html)
Support Guice Support du YAML
Rerun failing tests first Peut lancer du JUnit 3.x
25