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

net.sf.ahtutils.test.IgnoreOtherRule Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package net.sf.ahtutils.test;

import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

public class IgnoreOtherRule implements TestRule
{
    private String applyMethod;
    
    public IgnoreOtherRule(String applyMethod)
    {
        this.applyMethod = applyMethod;
    }
    
    @Override
    public Statement apply(final Statement statement, final Description description)
    {
        return new Statement()
        {
            @Override
            public void evaluate() throws Throwable{
                if (applyMethod.equals(description.getMethodName())) {
                    statement.evaluate();
                }
            }
        };
    }
    
    //@Rule public IgnoreOtherRule test = new IgnoreOtherRule("withoutCode");
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy