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