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

holmos.webtest.junitextentions.excute.MethodRunner Maven / Gradle / Ivy

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

import holmos.webtest.junitextentions.parameters.HolmosFrameWorkMethod;
import holmos.webtest.junitextentions.parameters.RunCountFrameWorkMethod;
import holmos.webtest.junitextentions.threadpool.HolmosThreadPoolExecutor;

import java.util.ArrayList;

import org.junit.runner.notification.RunNotifier;
/**
 * @author 吴银龙([email protected])
 * */
public class MethodRunner {
	/**代执行的方法*/
	private HolmosFrameWorkMethod method;
	private Object target;
	private RunNotifier notifier;
	public MethodRunner(HolmosFrameWorkMethod method,Object target,ArrayListparameters,RunNotifier notifier){
		this.method=method;
		this.target=target;
		this.notifier=notifier;
	}
	
	public void runHolmosMethod(){
		if(method.getRuncount()==1){
			//不分配线程池,就在当前所在线程执行
			method.getRunCountFrameWorkMethods().get(0).runParameterMethod(target,notifier);
		}else{
			//分配线程池进行执行
			HolmosThreadPoolExecutor execute=(HolmosThreadPoolExecutor)new HolmosThreadPoolExecutor(method.getRuncountThreadpoolSize(),method.getRuncount());
			for(int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy