allinittest.java

来自「《基于Eclipse的开源框架技术与实战》[第2章]随书源码」· Java 代码 · 共 41 行

JAVA
41
字号
package com.free.test.init;


import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;

/**
 * <p>Title: Eclipse Plugin Development</p>
 * <p>Description: Free download</p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: Free</p>
 * @author gan.shu.man
 * @version 1.0
 */

public class AllInitTest {

	public static Test suite() {
		//创建TestSuite
		TestSuite suite = new TestSuite("Test for com.free.test.simple");
		//添加SimpleInitTest到TestSuite中
		suite.addTestSuite(SimpleInitTest.class);
		//实现TestSetup
		TestSetup wrapper = new TestSetup(suite){
			protected void setUp() throws Exception {
				//TODO  对TestSuite进行初始化
				System.out.println("suite setup");
			}
			
			protected void tearDown() throws Exception {
				//TODO  对TestSuite进行清理
				System.out.println("suite tearDown");
			}
		};
		
		return wrapper;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?