Mark Derricutt's Disturbing Thoughts

My Top Tags

                                       

My Jaiku

Chrome Division – Doomsday Rider

Thursday, 21 August 2008 5:43 A GMT+12

1 Session per VM: Another Scaling Alternative

Wednesday, 20 August 2008 9:47 P GMT+12

The BGGA myth - Functional Java | Google Groups

Wednesday, 20 August 2008 7:33 A GMT+12

Spock's Beard – On A Perfect Day (live)

Wednesday, 20 August 2008 5:57 A GMT+12

Ola Bini: JtestR 0.3.1 Released

Tuesday, 19 August 2008 10:00 P GMT+12

Enslaved – Violet Dawning

Tuesday, 19 August 2008 6:14 A GMT+12

Distributed Messaging with Jetlang and Terracotta

Monday, 18 August 2008 10:17 P GMT+12

The Music of 2008 - week 33

Monday, 18 August 2008 8:57 A GMT+12

There Can Be Only One

Monday, 18 August 2008 8:10 A GMT+12

Search Box

 

Default parameters for TestNG IDEA Plugin

posted Saturday, 11 November 2006

One of the better features of TestNG was the introduction of injectable parameters, via either @DataProvider or @Parameter annotations. However, once I started changing my tests to use parameters I found I lost the ability to simply select a test method and right-click on "Run Test" due to the lack of parameters being defined. It wasn't so much of a hassle to edit the generated IDEA run-profile and setup some parameter entries, or select a properties file, but that extra step soon became annoying.

By adding a new project level component I can now define a series of 'global' parameters and project settings:

Once this is configured I can simply write a test that uses parameters and hit run...

@Test
@Parameters({"username"})
public void testParam(String username) {
    assert "talios".equals(username);
}

...and get the following result:

A few more tweaks and I should have this out to the plugin repository...

tags:        

links: digg this    del.icio.us    technorati    reddit