use of org.whole.lang.tests.model.PackageName in project whole by wholeplatform.
the class TestsPrettyPrinterVisitor method visit.
@Override
public void visit(TestSuite entity) {
entity.getDescription().accept(this);
out.printRaw("Test suite ");
PackageName packageName = entity.getPackageName();
if (!EntityUtils.isResolver(packageName)) {
packageName.accept(this);
out.print('.');
}
entity.getName().accept(this);
out.printlnRaw(" {");
out.setRelativeIndentation(+1);
out.printlnRaw("Deployer {");
out.setRelativeIndentation(+1);
entity.getDeployer().accept(this);
out.setRelativeIndentation(-1);
out.printlnRaw("}");
entity.getFilterFamilies().accept(this);
entity.getTestCases().accept(this);
out.setRelativeIndentation(-1);
out.printlnRaw("}");
}
use of org.whole.lang.tests.model.PackageName in project whole by wholeplatform.
the class TestsPrettyPrinterVisitor method visit.
@Override
public void visit(TestCase entity) {
out.printRaw("Test case ");
PackageName packageName = entity.getPackageName();
if (!EntityUtils.isResolver(packageName)) {
packageName.accept(this);
out.print('.');
}
entity.getName().accept(this);
out.printlnRaw(" {");
out.setRelativeIndentation(+1);
out.printlnRaw("Deployer {");
out.setRelativeIndentation(+1);
entity.getDeployer().accept(this);
out.setRelativeIndentation(-1);
out.printlnRaw("}");
entity.getAspects().accept(this);
entity.getTests().accept(this);
out.setRelativeIndentation(-1);
out.printlnRaw("}");
}
use of org.whole.lang.tests.model.PackageName in project whole by wholeplatform.
the class TestsPrettyPrinterVisitor method visit.
@Override
public void visit(FilterFamily entity) {
entity.getDescription().accept(this);
out.printRaw("Filter family ");
PackageName packageName = entity.getPackageName();
if (!EntityUtils.isResolver(packageName)) {
packageName.accept(this);
out.print('.');
}
entity.getName().accept(this);
out.printlnRaw(" {");
out.setRelativeIndentation(+1);
entity.getFilterRules().accept(this);
out.setRelativeIndentation(-1);
out.printlnRaw("}");
}
use of org.whole.lang.tests.model.PackageName in project whole by wholeplatform.
the class TestsHelpers method createFilterRulesMap.
public static Map<String, FilterRule> createFilterRulesMap(TestSuite testSuite) {
Map<String, FilterRule> filterRulesMap = new HashMap<String, FilterRule>();
IEntityIterator<FilterFamily> filterFamilies = IteratorFactory.childIterator();
filterFamilies.reset(testSuite.getFilterFamilies());
for (FilterFamily filterFamily : filterFamilies) {
IEntityIterator<FilterRule> filterRules = IteratorFactory.childIterator();
filterRules.reset(filterFamily.getFilterRules());
for (FilterRule filterRule : filterRules) {
String name = filterFamily.getName().getValue() + '.' + filterRule.getName().getValue();
if (filterRulesMap.get(name) != null)
filterRulesMap.remove(name);
else
filterRulesMap.put(name, filterRule);
PackageName packageName = filterFamily.getPackageName();
if (DataTypeUtils.getDataKind(packageName).isString()) {
String qualifiedName = packageName.wStringValue() + '.' + name;
filterRulesMap.put(qualifiedName, filterRule);
}
}
}
return filterRulesMap;
}
Aggregations