JUnit 4 和 TestNG 比较分析
JUnit 4 and TestNG are both very popular unit test framework in Java. Both frameworks look very similar in functionality. Which one is better? Which u[......] Read more
View ArticleJUnit 4 教程1 – 基本使用
本教程介绍Junit 4使用注解方式(annotation). import org.junit.*; import static org.junit.Assert.*; import java.util.*; /** * @author mkyong * */ public[......] Read more
View ArticleJUnit 4 教程2 – Expected Exception Test
经常 需要测试方法抛出的异常. import org.junit.*; /** * JUnit Expected Exception Test * @author mkyong * */ public class JunitTest2 { @Test(expected =[......] Read more
View ArticleJUnit 4 教程3 – Ignore Test
“Ignored” means the method is not ready to test, the JUnit engine will just bypass this method. import org.junit.*; /** * JUnit Ignore Test *[......] Read more
View ArticleJUnit 4 教程4 – Time Test
“Time Test” means if an unit test takes longer than the specified number of milliseconds to run, the test will terminated and mark as failed. imp[......] Read more
View ArticleJUnit 4 教程5 – Suite Test
The “Suite Test” means bundle a few unit test cases and run it together. In Junit, both @RunWith and @Suite annotation are used to run the suite test.[......] Read more
View ArticleJUnit 4 教程6 – Parameterized Test
The “Parameterized Test” means vary parameter value for unit test. In JUnit, both @RunWith and @Parameter annotation are use to provide parameter valu[......] Read more
View Article
More Pages to Explore .....