Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrized runner for tests with one parameter #700

Closed
artkoshelev opened this issue Jun 27, 2013 · 5 comments
Closed

Parametrized runner for tests with one parameter #700

artkoshelev opened this issue Jun 27, 2013 · 5 comments

Comments

@artkoshelev
Copy link

Usually i write parametrized tests with only one input parameter. So, using the Collection <Object[]> return type for my data() method and conversion from one-dimensional collection to two-dimensional looks like overkill.

It would be nice to be able annotate with @parameters method, which returns Collection.

What do you think about this idea? If it's ok, i'll implement it.

@dsaff
Copy link
Member

dsaff commented Jun 27, 2013

We tried this a while back. I think the problem is that because Object[] is itself a subtype of Object, the corner cases got messy. What about a static helper method that does the one-to-two-dimension conversion for you?

stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 1, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
@stefanbirkner
Copy link
Contributor

@dsaff It looks like the proposed extension is feasible. But it's late at night and maybe I overlooked something.

Eclipse has applied a different format to the files.Therefore I first will fix the format and then create a pull request. But not today :-)

@stefanbirkner
Copy link
Contributor

@artkoshelev Do you have an example of a test with a single parameter. I could not create something reasonable.

@artkoshelev
Copy link
Author

thanks! the return types Iterator<? extends Object>, Object[] from your commit looks exactly like what i was asking for =)
here is an example https://gist.github.com/artkoshelev/5907938
usually i came to a single-parameter tests when writing high-level acceptance tests (e.g. with selenium-webdriver) - go across a set of web-pages and check for 200 response code

@stefanbirkner
Copy link
Contributor

Thank you for providing a use case for single-parameter tests.

stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 3, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 3, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 3, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 3, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 9, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 9, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 9, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 10, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
stefanbirkner added a commit to stefanbirkner/junit that referenced this issue Jul 13, 2013
…m#700.

Support the return types Iterator<? extends Object>, Object[] and Object[][]. You don't have to wrap arrays with Iterables and single parameters with Object arrays.
@dsaff dsaff closed this as completed in f6a3d74 Jul 16, 2013
dsaff pushed a commit that referenced this issue Jul 16, 2013
Support more return types for the @parameters method. Fixes #700.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants