Eclipse template?

4 views
Skip to first unread message

selliott

unread,
Nov 16, 2009, 11:51:50 AM11/16/09
to testng-users
I'm probably missing something obvious but when I want to create a new
TestNG test in Eclipse I right click on the package to create New> but
I only see the JUnit template selection (even from Other).

Any hints on how to load a TestNG template into the Eclipse editor?

thx.

Karthik Krishnan

unread,
Nov 16, 2009, 2:25:06 PM11/16/09
to testng...@googlegroups.com
You can configure TestNG test as follows:

Run - > Run -> Select TestNG launch settings.

Kartik

selliott

unread,
Nov 16, 2009, 3:56:27 PM11/16/09
to testng-users
Thanks Kartik for the reply. Maybe I wasn't very good at explaining
what I meant by a template. The templates I am referring to appear
when you right click to create a New Java class or Enum or Interface
or... The result of the action is that a preconfigured template will
appear in the editor with the package and name you have given it.

I have read up on Eclipse templates and from what I can tell TestNG
does not have any installed but they do not appear to be difficult to
create.

Run or Run As... work just fine for me.

On Nov 16, 12:25 pm, Karthik Krishnan <krishnan.1...@gmail.com> wrote:
> You can configure TestNG test as follows:
>
> Run - > Run -> Select TestNG launch settings.
>
> Kartik

Cédric Beust ♔

unread,
Nov 16, 2009, 4:06:42 PM11/16/09
to testng...@googlegroups.com

I never really implemented this because I didn't think that a template would be that useful, but I'm open to the idea.  I'm thinking such a template would contain a few imports and a class with one empty @BeforeMethod and one @Test method.

Is that what you had in mind?

--
Cédric


selliott

unread,
Nov 16, 2009, 4:34:55 PM11/16/09
to testng-users


On Nov 16, 2:06 pm, Cédric Beust ♔ <cbe...@google.com> wrote:
> ***Cédric
> *

It was. I was actually looking for a basic template (with imports and
a Before/After Test skeleton) which I could then extend because I have
boilerplate in a lot of my tests for Before/After methods.

Right now I create the template as JUnit then use the TestNG plugin to
convert it....;(

Cédric Beust ♔

unread,
Nov 16, 2009, 4:37:11 PM11/16/09
to testng...@googlegroups.com
On Mon, Nov 16, 2009 at 1:34 PM, selliott <steven.s...@gmail.com> wrote:

It was.  I was actually looking for a basic template (with imports and
a Before/After Test skeleton) which I could then extend because I have
boilerplate in a lot of my tests for Before/After methods.

Right now I create the template as JUnit then use the TestNG plugin to
convert it....;(

Yes, definitely not optimal...

A template would also help beginners with the common mistake of using @BeforeTest instead of @BeforeMethod...

--
Cédric


Reply all
Reply to author
Forward
0 new messages