java.lang.Object | ||
↳ | org.junit.rules.TestWatchman | |
↳ | org.junit.rules.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()); } }
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked when a test method is about to start
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.junit.rules.TestWatchman
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.junit.rules.MethodRule
|