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

org.evosuite.runtime.vnet.NonFunctionalRequirementRule Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package org.evosuite.runtime.vnet;

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


/**
 * Avoid failing tests due to changes in non-functional requirements, like
 * for example execution time. This is necessary due to EvoSuite adding
 * arbitrary timeouts to prevent tests hanging or taking too long
 */
public class NonFunctionalRequirementRule implements TestRule {

    @Override
    public Statement apply(Statement base, Description description) {
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                try {
                    base.evaluate();
                } catch (TooManyResourcesException e) {
                    //prevent TMRE to propagate to the JUnit runner
                } finally {
                }
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy