testdecorator.java

来自「JAVA 数学程序库 提供常规的数值计算程序包」· Java 代码 · 共 38 行

JAVA
38
字号
package jmathlib.tools.junit.extensions;

import jmathlib.tools.junit.framework.*;

/**
 * A Decorator for Tests. Use TestDecorator as the base class
 * for defining new test decorators. Test decorator subclasses
 * can be introduced to add behaviour before or after a test
 * is run.
 *
 */
public class TestDecorator extends Assert implements Test {
	protected Test fTest;

	public TestDecorator(Test test) {
		fTest= test;
	}
	/**
	 * The basic run behaviour.
	 */
	public void basicRun(TestResult result) {
		fTest.run(result);
	}
	public int countTestCases() {
		return fTest.countTestCases();
	}
	public void run(TestResult result) {
		basicRun(result);
	}
	
	public String toString() {
		return fTest.toString();
	}
	
	public Test getTest() {
		return fTest;
	}
}

⌨️ 快捷键说明

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