View Javadoc

1   package org.apache.maven.surefire.providerapi;
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.util.Properties;
23  import org.apache.maven.surefire.report.ConsoleLogger;
24  import org.apache.maven.surefire.report.ReporterConfiguration;
25  import org.apache.maven.surefire.report.ReporterFactory;
26  import org.apache.maven.surefire.testset.DirectoryScannerParameters;
27  import org.apache.maven.surefire.testset.TestArtifactInfo;
28  import org.apache.maven.surefire.testset.TestRequest;
29  import org.apache.maven.surefire.util.DirectoryScanner;
30  import org.apache.maven.surefire.util.RunOrderCalculator;
31  import org.apache.maven.surefire.util.ScanResult;
32  
33  /**
34   * Injected into the providers upon provider construction. Allows the provider to request services and data it needs.
35   * <p/>
36   * NOTE: This class is part of the proposed public api for surefire providers from 2.7 and up. It may
37   * still be subject to changes, even for minor revisions.
38   * <p/>
39   * The api covers this interface and all the types reachable from it. And nothing else.
40   *
41   * @author Kristian Rosenvold
42   */
43  public interface ProviderParameters
44  {
45      /**
46       * Provides a directory scanner that enforces the includes/excludes parameters that were passed to surefire.
47       * See #getDirectoryScannerParameters for details
48       *
49       * @return The directory scanner
50       * @deprecated Use scanresult instead, as of version 2.12.2. Will be removed in next major version.
51       */
52      DirectoryScanner getDirectoryScanner();
53  
54      /**
55       * Provides the result of the directory scan performed in the plugin
56       *
57       * @return The scan result
58       */
59      ScanResult getScanResult();
60  
61  
62      /**
63       * Provides a service to calculate run order of tests. Applied after directory scanning.
64       *
65       * @return A RunOrderCalculator
66       */
67      RunOrderCalculator getRunOrderCalculator();
68  
69      /**
70       * Provides features for creating reporting objects
71       *
72       * @return A ReporterFactory that allows the creation of one or more ReporterManagers
73       */
74      ReporterFactory getReporterFactory();
75  
76      /**
77       * Gets a logger intended for console output.
78       * <p/>
79       * This output is inteded for provider-oriented messages that are not attached to a single test-set
80       * and will normally be written to something console-like immediately.
81       *
82       * @return A console logger
83       */
84      ConsoleLogger getConsoleLogger();
85  
86      /**
87       * The raw parameters used in creating the directory scanner
88       *
89       * @return The parameters
90       * @deprecated Use scanresult instead, as of version 2.12.2. Will be removed in next major version.
91       */
92      DirectoryScannerParameters getDirectoryScannerParameters();
93  
94      /**
95       * The raw parameters used in creating the ReporterManagerFactory
96       *
97       * @return The reporter configuration
98       */
99      ReporterConfiguration getReporterConfiguration();
100 
101     /**
102      * Contains information about requested test suites or individual tests from the command line.
103      *
104      * @return The testRequest
105      */
106 
107     TestRequest getTestRequest();
108 
109     /**
110      * The class loader for the tests
111      *
112      * @return the classloader
113      */
114     ClassLoader getTestClassLoader();
115 
116     /**
117      * The per-provider specific properties that may come all the way from the plugin's properties setting.
118      *
119      * @return the provider specific properties
120      */
121     Properties getProviderProperties();
122 
123     /**
124      * Artifact info about the artifact used to autodetect provider
125      *
126      * @return The artifactinfo, or null if autodetect was not used.
127      */
128     TestArtifactInfo getTestArtifactInfo();
129 
130 }