@Override
public Description getDescription() {
if (description == null)
- description = Description.createTestDescription(ModelledSTSTestRunner.class.getName(), test.getName(), new Integer(test.hashCode()));
+ description = Description.createTestDescription(test.getParentName(), test.getName(), new Integer(test.hashCode()));
return description;
}
public class ModelledSTSTest {
private final String name;
+ private final String parentName;
private final String code;
private final int priority;
private final boolean ignored;
private CombinedCoverage coverage;
private Map<String, String> variables;
- ModelledSTSTest(String name, String code, int priority, boolean ignored, Set<String> dependencies, Map<String, String> variables) {
+ ModelledSTSTest(String name, String parentName, String code, int priority, boolean ignored, Set<String> dependencies, Map<String, String> variables) {
this.name = name;
+ this.parentName = parentName;
this.code = code;
this.priority = priority;
this.ignored = ignored;
return name;
}
+ public String getParentName() {
+ return parentName;
+ }
+
public String getCode() {
return code;
}
String value = graph.getRelatedValue(stsVariable, TESTS.STSVariable_definition);
variables.put(name, value);
}
- return new ModelledSTSTest(testName, code, priority != null ? priority : -1, ignored != null ? ignored : false, new HashSet<>(Arrays.asList(actualDeps)), variables);
+ Resource parent = graph.getSingleObject(test, L0.PartOf);
+ String parentName;
+ String possibleURI = graph.getPossibleURI(parent);
+ if (possibleURI != null)
+ parentName = possibleURI;
+ else
+ parentName = graph.getRelatedValue2(parent, L0.HasName, Bindings.STRING);
+ return new ModelledSTSTest(testName, parentName, code, priority != null ? priority : -1, ignored != null ? ignored : false, new HashSet<>(Arrays.asList(actualDeps)), variables);
}
public static ModelledSTSSuite toModelledSuite(ReadGraph graph, Resource suite, List<ModelledSTSTest> children) throws DatabaseException {