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