Tibor17 commented on a change in pull request #248: SUREFIRE-1695 Support multiple inheritance of @Categories URL: https://github.com/apache/maven-surefire/pull/248#discussion_r348753903
########## File path: surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/GroupMatcherCategoryFilterPreJUnit412Test.java ########## @@ -0,0 +1,65 @@ +package org.apache.maven.surefire.common.junit48; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.surefire.common.junit48.tests.group.*; +import org.apache.maven.surefire.group.match.GroupMatcher; +import org.apache.maven.surefire.group.match.SingleGroupMatcher; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.Description; + +/** + * Before JUnit 4.12, @Category annotation was not @Inherited. These tests make sure the implied contract is honored. + */ +public class GroupMatcherCategoryFilterPreJUnit412Test { + + private GroupMatcherCategoryFilter cut; + + @Test + public void shouldNotMatchIncludedCategoryInParent() { + GroupMatcher included = new SingleGroupMatcher("org.apache.maven.surefire.common.junit48.tests.group.marker.CategoryB"); + GroupMatcher excluded = null; + cut = new GroupMatcherCategoryFilter(included, excluded); + Assert.assertFalse(cut.shouldRun(Description.createSuiteDescription(BCTest.class))); Review comment: pls use static import and fix the checkstyle. The current build is checking the checkstyle in tests as well. Can you squash and rebase this work on the top of master HEAD? Then run the build and you may see the checkstyle issues if we missed something. Thx. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
