testng目录问题,bug?or other

今天跑maven工程的时候发现一个异常问题,testng一直是没有跑到test,mvn test问题依旧,直接右键run也是没跑到,如下显示:

[Parser] Running:

  E:\EclipseProjects\shop\temp-testng-customsuite.xml

===============================================

    org.xiziyin.shop.dao.ConnectionTest

    Tests run: 0, Failures: 0, Skips: 0

===============================================

===============================================

shop

Total tests run: 0, Failures: 0, Skips: 0

===============================================

 调试都无法进入方法内部,非常奇怪。

 我的包截图:

 

后来我把ConnectionTest类直接放到src/test/java下,run起来没问题,一切正常。

发现把包名只要是org.xiziyin.shop.dao就有问题,改成其他就没有问题,奇怪死了。。

最后贴上代码:

代码
 1 package org.xiziyin.shop.dao;
 2 import org.testng.Assert;
 3 import org.testng.annotations.Test;
 4 import org.xiziyin.shop.dal.dao.jdbcimpl.JdbcBaseDAO;
 5 
 6 public class ConnectionTest {
 7 
 8     @Test
 9     public void testConnection() {
10         System.out.println("******");
11         boolean result = JdbcBaseDAO.createConnection();
12         Assert.assertTrue(result);
13     }
14 
15 }
16 

后来发现,使用mvn clean先,在执行test,貌似是ok的

下次build的时候还是skiptest吧。。。 

原文地址:https://www.cnblogs.com/xiziyin/p/1612723.html