|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.junit.rules.TestWatcher
org.junit.rules.TestName
public class TestName
The TestName Rule makes the current test name available inside test methods:
public class TestNameTest {
@Rule
public TestName name= new TestName();
@Test
public void testA() {
assertEquals("testA", name.getMethodName());
}
@Test
public void testB() {
assertEquals("testB", name.getMethodName());
}
}
| Constructor Summary | |
|---|---|
TestName()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getMethodName()
|
protected void |
starting(Description d)
Invoked when a test is about to start |
| Methods inherited from class org.junit.rules.TestWatcher |
|---|
apply, failed, finished, succeeded |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TestName()
| Method Detail |
|---|
protected void starting(Description d)
TestWatcher
starting in class TestWatcherpublic java.lang.String getMethodName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||