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.booter;
20  
21  import java.util.Map;
22  
23  import org.apache.maven.surefire.api.booter.BaseProviderFactory;
24  import org.apache.maven.surefire.api.report.ReporterConfiguration;
25  import org.apache.maven.surefire.api.report.ReporterFactory;
26  import org.apache.maven.surefire.api.testset.DirectoryScannerParameters;
27  import org.apache.maven.surefire.api.testset.RunOrderParameters;
28  import org.apache.maven.surefire.api.testset.TestArtifactInfo;
29  import org.apache.maven.surefire.api.testset.TestRequest;
30  
31  /**
32   * @author Kristian Rosenvold
33   */
34  public class Foo extends BaseProviderFactory {
35      private Map<String, String> providerProperties;
36  
37      private ReporterConfiguration reporterConfiguration;
38  
39      private ClassLoader testClassLoader;
40  
41      private TestArtifactInfo testArtifactInfo;
42  
43      private RunOrderParameters runOrderParameters;
44  
45      private boolean called;
46  
47      Foo() {
48          super(false);
49      }
50  
51      @Override
52      public void setDirectoryScannerParameters(DirectoryScannerParameters directoryScanner) {
53          super.setDirectoryScannerParameters(directoryScanner);
54          this.called = true;
55      }
56  
57      /**
58       * @return true if it has been called
59       */
60      public Boolean isCalled() {
61          return called;
62      }
63  
64      @Override
65      public void setProviderProperties(Map<String, String> providerProperties) {
66          super.setProviderProperties(providerProperties);
67          called = true;
68      }
69  
70      @Override
71      public void setReporterConfiguration(ReporterConfiguration reporterConfiguration) {
72          this.reporterConfiguration = reporterConfiguration;
73          this.called = true;
74      }
75  
76      @Override
77      public void setClassLoaders(ClassLoader testClassLoader) {
78          this.testClassLoader = testClassLoader;
79          this.called = true;
80      }
81  
82      @Override
83      public void setTestRequest(TestRequest testRequest) {
84          super.setTestRequest(testRequest);
85          this.called = true;
86      }
87  
88      @Override
89      public void setTestArtifactInfo(TestArtifactInfo testArtifactInfo) {
90          this.testArtifactInfo = testArtifactInfo;
91          this.called = true;
92      }
93  
94      @Override
95      public void setRunOrderParameters(RunOrderParameters runOrderParameters) {
96          super.setRunOrderParameters(runOrderParameters);
97          this.called = true;
98      }
99  
100     @Override
101     public void setReporterFactory(ReporterFactory reporterFactory) {
102         super.setReporterFactory(reporterFactory);
103         called = true;
104     }
105 }