org.testng.internal.reflect.AbstractMethodMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testng Show documentation
Show all versions of testng Show documentation
Testing framework for Java
package org.testng.internal.reflect;
import org.testng.internal.ThreeStateBoolean;
import static org.testng.internal.ThreeStateBoolean.FALSE;
import static org.testng.internal.ThreeStateBoolean.TRUE;
/**
* Created on 1/4/16.
*
* @author Nitin Verma
*/
public abstract class AbstractMethodMatcher implements MethodMatcher {
private final MethodMatcherContext context;
private ThreeStateBoolean conforms = ThreeStateBoolean.NONE;
public AbstractMethodMatcher(final MethodMatcherContext context) {
this.context = context;
}
protected MethodMatcherContext getContext() {
return context;
}
protected ThreeStateBoolean getConforms() {
return conforms;
}
/**
* {@inheritDoc}
*/
@Override
public boolean conforms() {
boolean hasConformance = false;
try {
hasConformance = hasConformance();
} finally {
conforms = hasConformance ? TRUE : FALSE;
}
return hasConformance;
}
/**
* Checks if the arguments conform to the method.
*
* @return conformance
* @throws MethodMatcherException if any internal failure.
*/
protected abstract boolean hasConformance();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy