Re: Adding @NonParameterized
David Saff <[email protected]> Mon, 20 Jun 2011 15:57:55 -0400
| Newsgroups | gmane.comp.java.junit.devel |
|---|---|
| Message-ID | <BANLkTikcuMZf=E-6v6_ZMVG-7NziokdYA_EZk_5i99kDPBdAsw@mail.gmail.com> |
On Fri, Jun 17, 2011 at 4:19 PM, Marius Kruger <[email protected]> wrote: > On 16 June 2011 16:45, David Saff <[email protected]> wrote: >> Marius, >> >> Thanks, now I understand where this is going. =A0Genuinely sorry for the >> git busywork. =A0I still don't know why the attachments aren't getting >> passed along. > > They were probably just a little too big and needed moderation. That's > why I mailed it to you directly too. > >> As to the feature itself, I'm confused--what's the cost of moving the >> non-parameterized tests to their own class? =A0You can also use >> @RunWith(Enclosed.class) to have several inner classes, with different >> parameterizations, inside one file. > > In short that is not how I'd like to use it, is there any reason why > you don't want this feature? Parameterized.class currently allows one parameterization per test class. This patch enables two parameterizations, one of which must be the special case of "no parameters". A runner like JUnitParams (http://code.google.com/p/junitparams/) enables an arbitrary number of parameterizations, including "no parameters". I'd like to consider how to handle the arbitrary case, like JUnitParams, and would rather not create a special case for "no parameters" that users would need to migrate to the new framework when it's ready. Does that make sense? David Saff > I like to group tests that test the same functionality and require the > same setup in the same class. > So if it makes sense for some tests to run several times and some only on= ce > and they all use the same setup, I'd like them in one class. > If there are one or two tests that does not need to execute multiple > times then I'll rather let them > execute multiple times than split them out into their own class > because they belong with the others. > But if it is easy to mark them to not execute multiple times then I > want to do that. > Multiple nested classes will be much uglier than a simple annotation, IMH= O. > The first 3 classes that I wanted to use Parameterized on I also > wanted partially @NonParameterized. > I'd really rather have this in the core of junit in stead of > maintaining my own junit utils elsewhere. > > -- > thanks for listening :-) > <>< Marius ><> > ---------------------------------------------------------------------------= --- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev