All Downloads are FREE. Search and download functionalities are using the official Maven repository.

holmos.webtest.junitextentions.rules.RepeatRunStatement Maven / Gradle / Ivy

There is a newer version: 1.0.2u10
Show newest version
package holmos.webtest.junitextentions.rules;

import holmos.webtest.junitextentions.annotations.RunCount;

import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
/**
 * @author 吴银龙([email protected])
 * */
public class RepeatRunStatement extends Statement{
	private Statement base;
	private FrameworkMethod method;
	public RepeatRunStatement(Statement base,FrameworkMethod method){
		this.base=base;
		this.method=method;
	}
	@Override
	public void evaluate() throws Throwable {
		int count=1;//默认为1次
		RunCount runCount=method.getAnnotation(RunCount.class);
		if(null!=runCount){
			count=runCount.runCount();
		}
		while(count!=0){
			base.evaluate();
			count--;
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy