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