Search in sources :

Example 6 with TestSuite

use of org.whole.lang.tests.model.TestSuite in project whole by wholeplatform.

the class TestsContentAssistVisitor method findContentAssistValues.

protected boolean findContentAssistValues(IEntity entity) {
    if (!Matcher.match(TestsEntityDescriptorEnum.Name, entity) || !EntityUtils.hasParent(entity) || !Matcher.match(TestsEntityDescriptorEnum.Filter, entity.wGetParent()))
        return false;
    TestSuite testSuite = Matcher.findAncestor(TestsEntityDescriptorEnum.TestSuite, entity);
    if (testSuite == null)
        return false;
    Map<String, FilterRule> rulesMap = TestsHelpers.createFilterRulesMap(testSuite);
    List<Name> names = new ArrayList<Name>();
    for (String key : rulesMap.keySet()) names.add(TestsEntityFactory.instance.createName(key));
    setResult(names.toArray(new Name[names.size()]));
    return true;
}
Also used : TestSuite(org.whole.lang.tests.model.TestSuite) ArrayList(java.util.ArrayList) FilterRule(org.whole.lang.tests.model.FilterRule) Name(org.whole.lang.tests.model.Name)

Aggregations

TestSuite (org.whole.lang.tests.model.TestSuite)6 IEntity (org.whole.lang.model.IEntity)3 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 IBindingManager (org.whole.lang.bindings.IBindingManager)1 FilterRule (org.whole.lang.tests.model.FilterRule)1 Name (org.whole.lang.tests.model.Name)1 TestCase (org.whole.lang.tests.model.TestCase)1