-
Mar 25th, 2010, 06:52 AM
#1
Logging the currently excecuting method name in Junit Tests
Hi All,
This is a general question related to Spring and Junit. I running my unit tests using "AbstractJUnit4SpringContextTests" and Junit. When i am runnig my unit tests, i need to log the method name which it is currently executing. Please help. I tried with Spring AOP but it doesnt worked.
Thanks.
-
Apr 1st, 2010, 05:56 PM
#2
If you are using Junit 4.7 or above, use a @Rule, as in this example:
@Rule
public TestName testMethodName = new TestName();
@Test
public void testFooForValidBar() throws Throwable {
logger.debug("starting..." + testMethodName.getMethodName());
-
Apr 6th, 2010, 01:54 AM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules