View Javadoc
1   package org.apache.maven.surefire.its;
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 org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
23  import org.junit.Test;
24  
25  /**
26   * Test project using -Dtest=mtClass#myMethod
27   *
28   * @author Olivier Lamy
29   */
30  public class TestSingleMethodIT
31      extends SurefireJUnit4IntegrationTestCase
32  {
33      public void singleMethod( String projectName )
34          throws Exception
35      {
36          unpack( projectName ).executeTest().verifyErrorFreeLog().assertTestSuiteResults( 1, 0, 0, 0 );
37      }
38  
39      @Test
40      public void testJunit44()
41          throws Exception
42      {
43          singleMethod( "junit44-single-method" );
44      }
45  
46      @Test
47      public void testJunit48()
48          throws Exception
49      {
50          singleMethod( "junit48-single-method" );
51      }
52  
53      @Test
54      public void testJunit48parallel()
55          throws Exception
56      {
57          unpack( "junit48-single-method" )
58                  .executeTest()
59                  .verifyErrorFreeLog()
60                  .assertTestSuiteResults( 1, 0, 0, 0 );
61      }
62  
63      @Test
64      public void testTestNg()
65          throws Exception
66      {
67          singleMethod( "testng-single-method" );
68      }
69  
70      @Test
71      public void testTestNg5149()
72          throws Exception
73      {
74          singleMethod( "/testng-single-method-5-14-9" );
75      }
76  
77  }