junit4

package test;

import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;

public class Junit4ClassRunner extends BlockJUnit4ClassRunner{

	public Junit4ClassRunner(Class<?> klass) throws InitializationError {
		super(klass);
	}
	
	@Override
	protected void runChild(FrameworkMethod method, RunNotifier notifier) {
		if( method.getAnnotation(PraparedData.class) != null ){
			//TODO preparedData
		}
		this.runChild(method, notifier);
		if( method.getAnnotation(RemoveData.class) != null ){
			//TODO removeData
		}
	}

}

你可能感兴趣的:(JUnit)