TestRule
public class TestName extends TestWatcher
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 | Description |
---|---|
TestName() |
Modifier and Type | Method | Description |
---|---|---|
String |
getMethodName() |
|
protected void |
starting(Description d) |
Invoked when a test is about to start
|
public TestName()
protected void starting(Description d)
TestWatcher
starting
in class TestWatcher
public String getMethodName()
Copyright © 2002–2018 JUnit. All rights reserved.