1. 程式人生 > >junit單元測試@Test報錯的解決辦法

junit單元測試@Test報錯的解決辦法

今天寫了個單元測試,然後buildpath裡add library選擇了junit,然後出現了奇怪的現象,@Before、@After可以用,@Test就會報錯(“Test is not an annotation type"),搜尋了下,解決方案如下,不需要引入 import  org.junit.Test ,直接@org.junit.Test就可以了。