com.github.dakusui.jcunit8.factorspace.TestPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcunit Show documentation
Show all versions of jcunit Show documentation
Automated combinatorial testing framework on top of JUnit
The newest version!
package com.github.dakusui.jcunit8.factorspace;
import com.github.dakusui.jcunit.core.tuples.Tuple;
import com.github.dakusui.jcunit8.core.Utils;
import java.util.List;
import java.util.function.Predicate;
public interface TestPredicate extends Predicate {
String getName();
boolean test(Tuple tuple);
List involvedKeys();
static String toString(TestPredicate predicate) {
return String.format(
"%s:%s",
Utils.className(predicate.getClass()), predicate.involvedKeys()
);
}
static TestPredicate of(String name, List involvedKeys, Predicate predicate) {
return new TestPredicate() {
@Override
public String getName() {
return name;
}
@Override
public boolean test(Tuple tuple) {
return predicate.test(tuple);
}
@Override
public List involvedKeys() {
return involvedKeys;
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy