1. Add Junit 4.7.1 dependency in project's pom files.
首先, 先加入Junit 4.7.1.
junit
junit
4.8.1
test
2. write a test case in Junit 4.7, like below:
寫一個Junit 4.7的測試用例. 例如:
package com.sml.form.restore;
import org.junit.Assert;
import org.junit.Test;
import com.sml.formrestore.SpringContextUtil;
import com.sml.formrestore.mvc.dao.product.mapper.ProductSpecMapper;
import com.sml.formrestore.mvc.dao.product.model.ProductSpec;
public class StartUpTest {
@Test
public void TestStartUpTestCase(){
// the test method must be annotated with @Test, and starts with Test, or ends with Test, TestCase
// 用例名稱必需以Test開首,或以Test, 或TestCase結尾,
// Write your test case here...
//在這裏寫測試用例...
}
}
Comments