में @Test विधि को निष्पादित करने का नाम प्राप्त करें, मैं वर्तमान में @Before विधि में टेस्टकेस विधि निष्पादित करने का नाम प्राप्त करना चाहता हूं। उदाहरणवर्तमान में @Test विधि को @ जून में
public class SampleTest()
{
@Before
public void setUp()
{
//get name of method here
}
@Test
public void exampleTest()
{
//Some code here.
}
}
http://stackoverflow.com/questions/473401/get-name-of-curren tly-execing-test-in-junit-4? – ivarni
अपनी टेस्ट क्लास में फ़ील्ड 'पिछला नाम' जोड़ें और उसके बाद प्रत्येक टेस्ट विधि के अंत में अपना मान सेट करें – TecHunter