- String suiteName = graph.getRelatedValue2(root, L0.HasName, Bindings.STRING);
- String moduleNameFilter = graph.getPossibleRelatedValue2(root, TESTS.STSSuite_moduleNameFilter, Bindings.STRING);
- suite = new STSSuite(root, suiteName, moduleNameFilter);
- List<STSTest> tests = new ArrayList<>();
- for (Resource test : graph.getObjects(root, L0.ConsistsOf)) {
- String testName = graph.getRelatedValue2(test, L0.HasName, Bindings.STRING);
- String definition = graph.getRelatedValue2(test, TESTS.STSTest_definition, Bindings.STRING);
- Integer executionPrioprity = graph.getRelatedValue2(test, TESTS.STSTest_executionPriority, Bindings.INTEGER);
- tests.add(new STSTest(test, suite, definition, testName, executionPrioprity));
- }
- Collections.sort(tests, (o1, o2) -> {
- if (o1.priority < o2.priority)
- return -1;
- else if (o1.priority > o2.priority)
- return 1;
- else return AlphanumComparator.COMPARATOR.compare(o1.name, o2.name);
- });
- suite.children(tests.toArray(new STSTest[tests.size()]));
+ List<ModelledSTSTest> tests = new ArrayList<>();
+ for (Resource test : graph.getObjects(root, L0.ConsistsOf))
+ tests.add(STSSuiteTestCollector.toModelledTest(graph, test));
+
+ suite = new STSSuite(STSSuiteTestCollector.toModelledSuite(graph, root, tests));