JAVA项目加上Junit4依赖
//基本注解
package com.laiwenhua.junitTest;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class ArrayListTest {
public ArrayListTest(){
System.out.println("------构建对象--------");
}
@Test
public void testAdd() {
System.out.println("------测试中--------");
}
@BeforeClass
public static void beforeClass() {
System.out.println("------BeforeClass--------");
}
@AfterClass
public static void afterClass() {
System.out.println("------AfterClass--------");
}
@Before
public void before() {
System.out.println("------Before--------");
}
@After
public void after() {
System.out.println("------After--------");
}
}
原文地址:http://7883830.blog.51cto.com/7873830/1704617