Junit test that creates other tests

Posted by Benju on Stack Overflow See other posts from Stack Overflow or by Benju
Published on 2010-04-15T17:02:05Z Indexed on 2010/04/15 17:23 UTC
Read the original article Hit count: 148

Normally I would have one junit test that shows up in my integration server of choice as one test that passes or fails (in this case I use teamcity). What I need for this specific test is the ability to loop through a directory structure testing that our data files can all be parsed without throwing an exception.

Because we have 30,000+ files that that 1-5 seconds each to parse this test will be run in its own suite. The problem is that I need a way to have one piece of code run as one junit test per file so that if 12 files out of 30,000 files fail I can see which 12 failed not just that one failed, threw a runtimeexception and stopped the test.

I realize that this is not a true "unit" test way of doing things but this simulation is very important to make sure that our content providers are kept in check and do not check in invalid files.

Any suggestions?

© Stack Overflow or respective owner

Related posts about junit

Related posts about java