import org.junit.runners.ParentRunner;
import org.junit.runners.model.InitializationError;
import org.simantics.Simantics;
+import org.simantics.db.layer0.util.Layer0Utils;
import org.simantics.db.testing.common.AcornTests;
import org.simantics.tests.modelled.utils.ModelledSTSSuite;
import org.simantics.tests.modelled.utils.STSSuiteTestCollector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ModelledSTSRunner extends ParentRunner<ModelledSTSSuiteRunner> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ModelledSTSRunner.class);
+
public static final String INCLUSION_FILTER = "org.simantics.tests.modelled.singleTestIncludeFilter";
public static final String EXCLUSION_FILTER = "org.simantics.tests.modelled.excludeFilter";
public ModelledSTSRunner(Class<?> testClass) throws InitializationError {
super(testClass);
+
try {
initialize0();
Collection<ModelledSTSSuite> suites = STSSuiteTestCollector.collectTests();
@Override
protected void runChild(ModelledSTSSuiteRunner child, RunNotifier notifier) {
- child.run(notifier);
+ try {
+ child.run(notifier);
+ } finally {
+ // Clear query cache
+ Layer0Utils.queryDebugSupport("QueryControl.flush");
+ }
// TODO: Add coverage reporting to ModelledSTSRunner
// CombinedCoverage cover = child.getCoverage();
// CoverageBuilder b = new CoverageBuilder();
// Filter inclusions
String inclusionFilter = System.getProperty(ModelledSTSRunner.INCLUSION_FILTER);
for (ModelledSTSTest test : suite.getSortedChildren()) {
- boolean add = false;
+ boolean add = true;
if (exclusionFilter != null) {
String[] filters = exclusionFilter.split(",");
- if (!startsWithAny(test, filters)) {
- add = true;
+ if (startsWithAny(test, filters)) {
+ add = false;
}
}
if (inclusionFilter != null) {