You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2019/12/09 06:09:44 UTC

[GitHub] [maven-surefire] YiannisDermitzakis commented on a change in pull request #248: SUREFIRE-1695 Support multiple inheritance of @Categories

YiannisDermitzakis 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_r355276424
 
 

 ##########
 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:
   Hi @Tibor17 , I applied the discussed changes, seems that it's all green now

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services