Skip to content

Support for Multiple Include/Exclude Categories #340

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

Closed
wants to merge 5 commits into from

Conversation

ajmath
Copy link

@ajmath ajmath commented Oct 11, 2011

This addresses issue 146

  • Changed the IncludeCategory and ExcludeCategory annotations to take an array of Class<?> for their value.
  • Added logic to hasCorrectCategoryAnnotation(Description description) that uses the arrays instead of the single values.
  • Updated existing unit tests and added new test that verifies correct exclusion of multiple categories
  • Set the describe method for category to perform as it currently does for single category filters and to list all filters comma delimited when there are multiples

… that allow for filtering the items in a test suite by more than one category
…e original annotations take arrays instead of single values
…here there is only one category. Added new unit test that verifies description of multi category filters
private final Class<?>[] fExcluded;

public CategoryFilter(Class<?>[] includedCategories,
Class<?>[] excludedCategories) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please join with previous line

@ajmath
Copy link
Author

ajmath commented Oct 18, 2011

Requested changes are in

}

private String join(String seperator, Class<?>... values) {
if(values == null || values.length == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after "if"

@dsaff
Copy link
Member

dsaff commented Oct 24, 2011

Sorry for the delay. Found a couple more minor things on passing through. Thanks.

@dekz
Copy link

dekz commented Oct 31, 2011

It seems that Category support is being touched by a number of issue currently. Any ETA of a release with Multiple Include/Exclude categories.

Also is there a reason why Suites don't inherit and add from Parent suites in regards to Include/Exclude?

X <- Y
X @IncludeCategory(a.class)
Y @IncludeCategory(b.class)

Using suite Y runs any b.class but not (a.class && b.class) categorised tests.

@Tibor17
Copy link
Contributor

Tibor17 commented Nov 1, 2011

@dekz
The categories is in experimental pkg.
your question looks like a point to #338.
I opened another issue which was substituted by #338, and it basically said that parent and children categories should result in smaller set of categories via AND operation. After a discussion with David, we had different view, so maybe the operation would be OR, etc. Thus the Java doc must be precisely specify all use cases -right way IMHO.

@dsaff
Copy link
Member

dsaff commented Feb 24, 2012

I'm sorry this has lingered so long. @matheeeny, it appears (to my busy, harried eyes) that #142 tries to address some of the same issues. Can you work with the author of that pull request to agree on a single, unified proposal that I can review? I'm not using Categories myself, so I'd like the community of people that are using it to drive the design. Thanks.

@Tibor17
Copy link
Contributor

Tibor17 commented Mar 15, 2012

Hi Andrew, would you also contribute in the discussion of #142.
It took long time to agree on this feature.

Tibor17 pushed a commit to Tibor17/junit that referenced this pull request Mar 20, 2012
@dsaff
Copy link
Member

dsaff commented Apr 12, 2012

For those following along, there is continued discussion in #142

@dsaff
Copy link
Member

dsaff commented May 9, 2012

@matheeeny, I'm going to close this pull request in favor of #142. Let me know if that's the wrong move.

@dsaff dsaff closed this May 9, 2012
@ajmath
Copy link
Author

ajmath commented May 9, 2012

That's perfectly fine with me

On Wed, May 9, 2012 at 7:08 PM, David Saff <
[email protected]

wrote:

@matheeeny, I'm going to close this pull request in favor of #142. Let me
know if that's the wrong move.


Reply to this email directly or view it on GitHub:
https://github.com/KentBeck/junit/pull/340#issuecomment-5608663

@Tibor17 Tibor17 mentioned this pull request Dec 6, 2012
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

Successfully merging this pull request may close these issues.

4 participants