Categories
Programming Twitter

Parameterized Testing in JUnit 4, or Twitter is Awesome Because…

You can ask a specialized, fairly technical question to the world in general…

And get a response from someone who really knows what they’re talking about! (I have books by this guy!)

Made my day!

If you’re interested in JUnit 4 and testing, a brief explanation.

JUnit 4 allows you to create parameterized tests. I.e. you have a test case that you run multiple times on slightly different data. Instead of writing individual test cases, you write one and pass it different arguments. It’s pretty easy.

But, if you’re running tests like this every single test is run on each set of parameters. I thought there would be an annotation, like @NotParam where I  could basically tell the test runner, “Run this test once, it doesn’t take any parameters”. But there’s not – good to know!

2 replies on “Parameterized Testing in JUnit 4, or Twitter is Awesome Because…”

Comments are closed.