Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Nov 13, 2024
1 parent e967ff2 commit 7a09506
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,29 @@ public QueryList initializeTemplateQueryHandler(QuerySource templateSource) thro
// and they can be correctly assigned to the results.
queryData.add(new QueryData(index++ - templateData.templates, QueryData.QueryType.TEMPLATE_INSTANCE, templateData.queries.size() - templateData.templates + templateIndex));
}
queryData.add(new QueryData(index++, QueryData.QueryType.TEMPLATE_INSTANCE, templateIndex));
else {
queryData.add(new QueryData(index++, QueryData.QueryType.TEMPLATE_INSTANCE, templateIndex));
}
} else if (templateIndex < templateData.templates && index == templateData.indices[templateIndex]) {
// query is a template
if (templateConfig.individualResults()) {
// Give the templates the last ids.
index++;
queryData.add(new QueryData(templateData.queries.size() - templateData.templates + templateIndex++, QueryData.QueryType.TEMPLATE, null));
} else {
templateIndex++;
queryData.add(new QueryData(index++, QueryData.QueryType.TEMPLATE, null));
}
templateIndex++;
queryData.add(new QueryData(index++, QueryData.QueryType.TEMPLATE, null));
} else {
// query is neither a template nor an instance
final var update = QueryData.checkIfUpdate(new ByteArrayInputStream(query.getBytes()));
if (templateConfig.individualResults()) {
// Fill the gaps caused by the templates.
queryData.add(new QueryData(index++ - templateIndex, update ? QueryData.QueryType.UPDATE : QueryData.QueryType.DEFAULT, null));
}
queryData.add(new QueryData(index++, update ? QueryData.QueryType.UPDATE : QueryData.QueryType.DEFAULT, null));
else {
queryData.add(new QueryData(index++, update ? QueryData.QueryType.UPDATE : QueryData.QueryType.DEFAULT, null));
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ public void calculateAndSaveMetrics(Calendar start, Calendar end) {
m.add(workerRes, RDF.type, IONT.worker);
m.add(workerRes, IPROP.workerID, toInfinitePrecisionIntegerLiteral(worker.getWorkerID()));
m.add(workerRes, IPROP.workerType, ResourceFactory.createTypedLiteral(worker.getClass().getSimpleName()));
m.add(workerRes, IPROP.noOfQueries, toInfinitePrecisionIntegerLiteral(
if (config.queries().getConfig() == null || config.queries().getConfig().template() == null)
m.add(workerRes, IPROP.noOfQueries, toInfinitePrecisionIntegerLiteral(config.queries().getExecutableQueryCount()));
else
m.add(workerRes, IPROP.noOfQueries, toInfinitePrecisionIntegerLiteral(
config.queries().getConfig().template().individualResults() ?
config.queries().getExecutableQueryCount() :
config.queries().getRepresentedQueryCount()));
Expand Down

0 comments on commit 7a09506

Please sign in to comment.