simpleinittest.java

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

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

import junit.framework.TestCase;

/**
 * <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 SimpleInitTest extends TestCase {

	static String initField = "";
	
	/**
	 * 执行初始化操作
	 * */
	protected void setUp() throws Exception {
		//打印出当前的执行方法
		System.out.println("  setUp:"+getName());
		initField = "setup";
	}

	/**
	 * 执行清理操作
	 * */
	protected void tearDown() throws Exception {
		System.out.println("  tearDown: "+initField);
		initField = "";
	}
	
	public void testSimpleInit1() {
		System.out.println("    testSimpleInit1: "+initField);
		initField = getName();
		assertTrue(true);
	}
	
	public void testSimpleInit2() {
		System.out.println("    testSimpleInit2: "+initField);
		initField = getName();
		assertTrue(true);
	}

}

⌨️ 快捷键说明

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