1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.shared.artifact.filter;
20  
21  import java.util.List;
22  
23  import junit.framework.TestCase;
24  
25  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
26  
27  public class PatternIncludesArtifactFilterTest
28      extends TestCase
29  {
30      private PatternArtifactFilterTCK tck = new PatternArtifactFilterTCK()
31      {
32  
33          protected ArtifactFilter createFilter( List patterns )
34          {
35              return new PatternIncludesArtifactFilter( patterns );
36          }
37  
38          protected ArtifactFilter createFilter( List patterns, boolean actTransitively )
39          {
40              return new PatternIncludesArtifactFilter( patterns, actTransitively );
41          }
42  
43      };
44  
45      public void testShouldTriggerBothPatternsWithWildcards()
46      {
47          tck.testShouldTriggerBothPatternsWithWildcards( false );
48      }
49  
50      public void testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId()
51      {
52          tck.testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId( false );
53      }
54  
55      public void testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId()
56      {
57          tck.testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId( false );
58      }
59  
60      public void testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled()
61      {
62          tck.testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled( false );
63      }
64  
65      public void testShouldNotIncludeWhenArtifactIdDiffers()
66      {
67          tck.testShouldNotIncludeWhenArtifactIdDiffers( false );
68      }
69  
70      public void testShouldNotIncludeWhenBothIdElementsDiffer()
71      {
72          tck.testShouldNotIncludeWhenBothIdElementsDiffer( false );
73      }
74  
75      public void testShouldNotIncludeWhenGroupIdDiffers()
76      {
77          tck.testShouldNotIncludeWhenGroupIdDiffers( false );
78      }
79  
80      public void testShouldNotIncludeWhenNegativeMatch()
81      {
82          tck.testShouldNotIncludeWhenNegativeMatch( false );
83      }
84  
85      public void testShouldIncludeWhenWildcardMatchesInsideSequence()
86      {
87          tck.testShouldIncludeWhenWildcardMatchesInsideSequence( false );
88      }
89  
90      public void testShouldIncludeWhenWildcardMatchesOutsideSequence()
91      {
92          tck.testShouldIncludeWhenWildcardMatchesOutsideSequence( false );
93      }
94  
95      public void testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent()
96      {
97          tck.testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent( false );
98      }
99  
100     // See comment in TCK.
101 //    public void testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild()
102 //    {
103 //        tck.testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild( false );
104 //    }
105 }