View Javadoc
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.surefire.api.testset;
20  
21  import java.io.File;
22  import java.util.List;
23  
24  import org.apache.maven.surefire.api.util.RunOrder;
25  
26  /**
27   * @author Kristian Rosenvold
28   */
29  public class DirectoryScannerParameters {
30      private final File testClassesDirectory;
31  
32      @Deprecated
33      private final List<String> includes;
34  
35      @Deprecated
36      private final List<String> excludes;
37  
38      @Deprecated
39      private final List<String> specificTests;
40  
41      private final RunOrder[] runOrder;
42  
43      private DirectoryScannerParameters(
44              File testClassesDirectory,
45              List<String> includes,
46              List<String> excludes,
47              List<String> specificTests,
48              RunOrder[] runOrder) {
49          this.testClassesDirectory = testClassesDirectory;
50          this.includes = includes;
51          this.excludes = excludes;
52          this.specificTests = specificTests;
53          this.runOrder = runOrder;
54      }
55  
56      public DirectoryScannerParameters(
57              File testClassesDirectory,
58              @Deprecated List<String> includes,
59              @Deprecated List<String> excludes,
60              @Deprecated List<String> specificTests,
61              String runOrder) {
62          this(
63                  testClassesDirectory,
64                  includes,
65                  excludes,
66                  specificTests,
67                  runOrder == null ? RunOrder.DEFAULT : RunOrder.valueOfMulti(runOrder));
68      }
69  
70      @Deprecated
71      public List<String> getSpecificTests() {
72          return specificTests;
73      }
74  
75      /**
76       * Returns the directory of the compiled classes, normally ${project.build.testOutputDirectory}
77       *
78       * @return A directory that can be scanned for .class files
79       */
80      public File getTestClassesDirectory() {
81          return testClassesDirectory;
82      }
83  
84      /**
85       * The includes pattern list, as specified on the plugin includes parameter.
86       *
87       * @return A list of patterns. May contain both source file designators and .class extensions.
88       */
89      @Deprecated
90      public List<String> getIncludes() {
91          return includes;
92      }
93  
94      /**
95       * The excludes pattern list, as specified on the plugin includes parameter.
96       *
97       * @return A list of patterns. May contain both source file designators and .class extensions.
98       */
99      @Deprecated
100     public List<String> getExcludes() {
101         return excludes;
102     }
103 
104     public RunOrder[] getRunOrder() {
105         return runOrder;
106     }
107 }