ahyea
ahyea

Reputation: 121

TestNG Eclipse plug-in : How to change the name prefix of methods for [New -> TestNG Class]?

Preferred

@Test
public void testMethodName() {} // [New -> JUnit Test Case]

than

@Test
public void methodName() {} // [New -> TestNG Class]

I could achieve what I want by following steps :

  1. [New -> JUnit Test Case].
  2. Quick Assist : Convert to TestNG (Annotations)

Any easier way ?

Upvotes: 1

Views: 189

Answers (1)

Cedric Beust
Cedric Beust

Reputation: 15608

This would be pretty easy to add but I'm not sure how useful it really is: ultimately, you will want to rename your method to describe what it actually does as a test. For example, a method called createAccount() should probably be tested with a test method called accountShouldBeCreated().

Also, a single method usually ends up being tested by more than one test method: accountShouldBeCreated(), alreadyExistingAccountShouldNotBeAllowed(), etc...

Upvotes: 1

Related Questions