View Javadoc
1   package org.apache.maven.surefire.api.testset;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.File;
23  import java.util.List;
24  import org.apache.maven.surefire.api.util.RunOrder;
25  
26  /**
27   * @author Kristian Rosenvold
28   */
29  public class DirectoryScannerParameters
30  {
31      private final File testClassesDirectory;
32  
33      @Deprecated
34      private final List<String> includes;
35  
36      @Deprecated
37      private final List<String> excludes;
38  
39      @Deprecated
40      private final List<String> specificTests;
41  
42      private final RunOrder[] runOrder;
43  
44      private DirectoryScannerParameters( File testClassesDirectory, List<String> includes, List<String> excludes,
45                                          List<String> specificTests, RunOrder[] runOrder )
46      {
47          this.testClassesDirectory = testClassesDirectory;
48          this.includes = includes;
49          this.excludes = excludes;
50          this.specificTests = specificTests;
51          this.runOrder = runOrder;
52      }
53  
54      public DirectoryScannerParameters( File testClassesDirectory, @Deprecated List<String> includes,
55                                         @Deprecated List<String> excludes, @Deprecated List<String> specificTests,
56                                         String runOrder )
57      {
58          this( testClassesDirectory, includes, excludes, specificTests,
59                runOrder == null ? RunOrder.DEFAULT : RunOrder.valueOfMulti( runOrder ) );
60      }
61  
62      @Deprecated
63      public List<String> getSpecificTests()
64      {
65          return specificTests;
66      }
67  
68      /**
69       * Returns the directory of the compiled classes, normally ${project.build.testOutputDirectory}
70       *
71       * @return A directory that can be scanned for .class files
72       */
73      public File getTestClassesDirectory()
74      {
75          return testClassesDirectory;
76      }
77  
78      /**
79       * The includes pattern list, as specified on the plugin includes parameter.
80       *
81       * @return A list of patterns. May contain both source file designators and .class extensions.
82       */
83      @Deprecated
84      public List<String> getIncludes()
85      {
86          return includes;
87      }
88  
89      /**
90       * The excludes pattern list, as specified on the plugin includes parameter.
91       *
92       * @return A list of patterns. May contain both source file designators and .class extensions.
93       */
94      @Deprecated
95      public List<String> getExcludes()
96      {
97          return excludes;
98      }
99  
100     public RunOrder[] getRunOrder()
101     {
102         return runOrder;
103     }
104 }