Run tests from inner classes via Maven

前端 未结 2 1957
感情败类
感情败类 2021-02-19 23:25

I have following tests structure:

public class WorkerServiceTest {

    public class RaiseErrorTest extends AbstractDbUnitTest{
        @Test
        public void         


        
2条回答
  •  离开以前
    2021-02-20 00:13

    I explain (a little more) the solution that I found...

    Maven (AFAIK) uses by default the plugin "maven-surefire-plugin" to run any tests defined at your maven project. According to the documentation of this plugin, by default, it excludes tests that are enclosed at inner static classes (or at least it was with version that i'm using - 2.18.1).

    So what i did was to put a empty exclude rule; resulting with a pom's build section like this:

    
      
      ...
      
        
          org.apache.maven.plugins
          maven-surefire-plugin
          2.18.1
          
            
              
            
          
        
        ...
      
    
    

提交回复
热议问题