View Javadoc
1   package org.apache.maven.surefire;
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 junit.framework.JUnit4TestAdapter;
23  import junit.framework.Test;
24  import junit.framework.TestCase;
25  import junit.framework.TestSuite;
26  import org.apache.maven.plugin.surefire.AbstractSurefireMojoJava7PlusTest;
27  import org.apache.maven.plugin.surefire.AbstractSurefireMojoTest;
28  import org.apache.maven.plugin.surefire.AbstractSurefireMojoToolchainsTest;
29  import org.apache.maven.plugin.surefire.CommonReflectorTest;
30  import org.apache.maven.plugin.surefire.MojoMocklessTest;
31  import org.apache.maven.plugin.surefire.SurefireHelperTest;
32  import org.apache.maven.plugin.surefire.SurefirePropertiesTest;
33  import org.apache.maven.plugin.surefire.booterclient.BooterDeserializerProviderConfigurationTest;
34  import org.apache.maven.plugin.surefire.booterclient.BooterDeserializerStartupConfigurationTest;
35  import org.apache.maven.plugin.surefire.booterclient.DefaultForkConfigurationTest;
36  import org.apache.maven.plugin.surefire.booterclient.ForkConfigurationTest;
37  import org.apache.maven.plugin.surefire.booterclient.ForkStarterTest;
38  import org.apache.maven.plugin.surefire.booterclient.ForkingRunListenerTest;
39  import org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfigurationTest;
40  import org.apache.maven.plugin.surefire.booterclient.ModularClasspathForkConfigurationTest;
41  import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStreamBuilderTest;
42  import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestProvidingInputStreamTest;
43  import org.apache.maven.plugin.surefire.booterclient.output.ForkClientTest;
44  import org.apache.maven.plugin.surefire.extensions.ConsoleOutputReporterTest;
45  import org.apache.maven.plugin.surefire.extensions.E2ETest;
46  import org.apache.maven.plugin.surefire.extensions.ForkedProcessEventNotifierTest;
47  import org.apache.maven.plugin.surefire.extensions.StatelessReporterTest;
48  import org.apache.maven.plugin.surefire.extensions.StreamFeederTest;
49  import org.apache.maven.plugin.surefire.report.DefaultReporterFactoryTest;
50  import org.apache.maven.plugin.surefire.report.StatelessXmlReporterTest;
51  import org.apache.maven.plugin.surefire.report.TestSetStatsTest;
52  import org.apache.maven.plugin.surefire.report.WrappedReportEntryTest;
53  import org.apache.maven.plugin.surefire.runorder.RunEntryStatisticsMapTest;
54  import org.apache.maven.plugin.surefire.util.DependenciesScannerTest;
55  import org.apache.maven.plugin.surefire.util.DirectoryScannerTest;
56  import org.apache.maven.plugin.surefire.util.ScannerUtilTest;
57  import org.apache.maven.plugin.surefire.util.SpecificFileFilterTest;
58  import org.apache.maven.surefire.extensions.ForkChannelTest;
59  import org.apache.maven.surefire.extensions.StatelessTestsetInfoReporterTest;
60  import org.apache.maven.surefire.report.FileReporterTest;
61  import org.apache.maven.surefire.report.RunStatisticsTest;
62  import org.apache.maven.surefire.spi.SPITest;
63  import org.apache.maven.surefire.util.RelocatorTest;
64  
65  /**
66   * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite.
67   *
68   * @author Tibor Digana (tibor17)
69   * @since 2.19
70   */
71  public class JUnit4SuiteTest extends TestCase
72  {
73      public static Test suite()
74      {
75          TestSuite suite = new TestSuite();
76          suite.addTestSuite( RelocatorTest.class );
77          suite.addTestSuite( RunStatisticsTest.class );
78          suite.addTestSuite( FileReporterTest.class );
79          suite.addTestSuite( org.apache.maven.surefire.report.ConsoleOutputFileReporterTest.class );
80          suite.addTestSuite( SurefirePropertiesTest.class );
81          suite.addTestSuite( SpecificFileFilterTest.class );
82          suite.addTest( new JUnit4TestAdapter( DirectoryScannerTest.class ) );
83          suite.addTest( new JUnit4TestAdapter( DependenciesScannerTest.class ) );
84          suite.addTestSuite( RunEntryStatisticsMapTest.class );
85          suite.addTestSuite( WrappedReportEntryTest.class );
86          suite.addTestSuite( StatelessXmlReporterTest.class );
87          suite.addTestSuite( DefaultReporterFactoryTest.class );
88          suite.addTestSuite( ForkingRunListenerTest.class );
89          suite.addTest( new JUnit4TestAdapter( ForkConfigurationTest.class ) );
90          suite.addTestSuite( BooterDeserializerStartupConfigurationTest.class );
91          suite.addTestSuite( BooterDeserializerProviderConfigurationTest.class );
92          suite.addTest( new JUnit4TestAdapter( TestProvidingInputStreamTest.class ) );
93          suite.addTest( new JUnit4TestAdapter( TestLessInputStreamBuilderTest.class ) );
94          suite.addTest( new JUnit4TestAdapter( SPITest.class ) );
95          suite.addTest( new JUnit4TestAdapter( SurefireHelperTest.class ) );
96          suite.addTest( new JUnit4TestAdapter( AbstractSurefireMojoTest.class ) );
97          suite.addTest( new JUnit4TestAdapter( DefaultForkConfigurationTest.class ) );
98          suite.addTest( new JUnit4TestAdapter( JarManifestForkConfigurationTest.class ) );
99          suite.addTest( new JUnit4TestAdapter( ModularClasspathForkConfigurationTest.class ) );
100         suite.addTest( new JUnit4TestAdapter( AbstractSurefireMojoJava7PlusTest.class ) );
101         suite.addTest( new JUnit4TestAdapter( AbstractSurefireMojoToolchainsTest.class ) );
102         suite.addTest( new JUnit4TestAdapter( ScannerUtilTest.class ) );
103         suite.addTest( new JUnit4TestAdapter( MojoMocklessTest.class ) );
104         suite.addTest( new JUnit4TestAdapter( ForkClientTest.class ) );
105         suite.addTest( new JUnit4TestAdapter( ForkedProcessEventNotifierTest.class ) );
106         suite.addTest( new JUnit4TestAdapter( ConsoleOutputReporterTest.class ) );
107         suite.addTest( new JUnit4TestAdapter( StatelessReporterTest.class ) );
108         suite.addTest( new JUnit4TestAdapter( TestSetStatsTest.class ) );
109         suite.addTest( new JUnit4TestAdapter( StatelessTestsetInfoReporterTest.class ) );
110         suite.addTest( new JUnit4TestAdapter( CommonReflectorTest.class ) );
111         suite.addTest( new JUnit4TestAdapter( ForkStarterTest.class ) );
112         suite.addTest( new JUnit4TestAdapter( ForkChannelTest.class ) );
113         suite.addTest( new JUnit4TestAdapter( StreamFeederTest.class ) );
114         suite.addTest( new JUnit4TestAdapter( E2ETest.class ) );
115         return suite;
116     }
117 }