diff --git a/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/IMDPathwayTests.java b/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/IMDPathwayTests.java index 5ba5f41..716888e 100644 --- a/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/IMDPathwayTests.java +++ b/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/IMDPathwayTests.java @@ -42,7 +42,7 @@ public class IMDPathwayTests { public static List all(SPARQLHelper helper, String format) throws Exception { List assertions = new ArrayList<>(); assertions.addAll(allMetabolitesInteract(helper, format)); - assertions.addAll(metabolicConversions(helper)); + assertions.addAll(metabolicConversions(helper, format)); assertions.addAll(catalystsWithCommonDataSource(helper)); assertions.addAll(metabolicConversionIdentifiersCommon(helper, format)); assertions.addAll(diseasesHaveIdentifiers(helper)); @@ -63,7 +63,7 @@ public static List allMetabolitesInteract(SPARQLHelper helper, Strin for (int i=1; i<=table.getRowCount(); i++) { String wpURL = table.get(i, "url"); if ("text/markdown".equals(format)) { - errors += "* [" + wpURL + "](" + table.get(i, "url") + ") has an metabolite not linked to an interaction: " + + errors += "* " + asMarkdownLink(table.get(i, "url")) + " has an metabolite not linked to an interaction: " + table.get(i, "metaboliteLabel") + "\n"; } else { errors += table.get(i, "url") + " has an metabolite not linked to an interaction: " + @@ -79,8 +79,8 @@ public static List allMetabolitesInteract(SPARQLHelper helper, Strin return assertions; } - public static List metabolicConversions(SPARQLHelper helper) throws Exception { - Test test = new Test("IEMPathwayTests", "metabolicConversions"); + public static List metabolicConversions(SPARQLHelper helper, String format) throws Exception { + Test test = new Test("IEMPathwayTests", "metabolicConversions", "Unexpected metabolic conversion", true); List assertions = new ArrayList<>(); String sparql = ResourceHelper.resourceAsString("imd/metabolicConversions.rq"); StringMatrix table = helper.sparql(sparql); @@ -89,12 +89,17 @@ public static List metabolicConversions(SPARQLHelper helper) throws int errorCount = 0; if (table.getRowCount() > 0) { for (int i=1; i<=table.getRowCount(); i++) { - errors += table.get(i, "url") + " " + table.get(i, "interaction") + "\n"; + if ("text/markdown".equals(format)) { + errors += "* " + asMarkdownLink(table.get(i, "url")) + " " + table.get(i, "interaction") + "\n"; + } else { + errors += table.get(i, "url") + " " + table.get(i, "interaction") + "\n"; + } errorCount++; } } assertions.add(new AssertEquals(test, - 0, errorCount, "Unexpected interactions, not from metabolite to metabolite and not from RNA to RNA: " + errorCount, errors + 0, errorCount, "Unexpected interactions, not from metabolite to metabolite and not from RNA to RNA: " + + errorCount, errors, format )); return assertions; } @@ -138,7 +143,8 @@ public static List catalystsWithCommonDataSource(SPARQLHelper helper }}; public static List metabolicConversionIdentifiersCommon(SPARQLHelper helper, String format) throws Exception { - Test test = new Test("IEMPathwayTests", "metabolicConversionIdentifiersCommon"); + Test test = new Test("IEMPathwayTests", "metabolicConversionIdentifiersCommon", + "Common metabolite-metabolite conversion identifier", true); List assertions = new ArrayList<>(); String sparql = ResourceHelper.resourceAsString("imd/metabolicConversionIdentifiers.rq"); StringMatrix table = helper.sparql(sparql); diff --git a/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/InteractionTests.java b/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/InteractionTests.java index cbcfca6..a0673a1 100644 --- a/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/InteractionTests.java +++ b/src/main/java/nl/unimaas/bigcat/wikipathways/curator/tests/InteractionTests.java @@ -311,7 +311,7 @@ public static List possibleTranslocations(SPARQLHelper helper, Strin } } assertions.add(new AssertEquals(test, - 0, errorCount, "Interactions between identical nodes: " + errorCount, errors + 0, errorCount, "Interactions between identical nodes: " + errorCount, errors, format )); return assertions; }