Search in sources :

Example 1 with PackageName

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("}");
}
Also used : PackageName(org.whole.lang.tests.model.PackageName)

Example 2 with PackageName

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("}");
}
Also used : PackageName(org.whole.lang.tests.model.PackageName)

Example 3 with PackageName

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("}");
}
Also used : PackageName(org.whole.lang.tests.model.PackageName)

Example 4 with PackageName

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;
}
Also used : FilterFamily(org.whole.lang.tests.model.FilterFamily) HashMap(java.util.HashMap) PackageName(org.whole.lang.tests.model.PackageName) FilterRule(org.whole.lang.tests.reflect.TestsEntityDescriptorEnum.FilterRule) FilterRule(org.whole.lang.tests.model.FilterRule)

Aggregations

PackageName (org.whole.lang.tests.model.PackageName)4 HashMap (java.util.HashMap)1 FilterFamily (org.whole.lang.tests.model.FilterFamily)1 FilterRule (org.whole.lang.tests.model.FilterRule)1 FilterRule (org.whole.lang.tests.reflect.TestsEntityDescriptorEnum.FilterRule)1