Commit 1ec41e34 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

additional hgnc annotator tests

parent ec799ee1
......@@ -281,7 +281,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
"Only " + MiriamType.HGNC + " and " + MiriamType.HGNC_SYMBOL + " are accepted but " + miriamData.getDataType() + " found.");
}
try {
List<MiriamData> result = new ArrayList<MiriamData>();
List<MiriamData> result = new ArrayList<>();
String content = getWebPageContent(query);
Node xml = getXmlDocumentFromString(content);
Node response = getNode("response", xml.getChildNodes());
......
......@@ -94,6 +94,24 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
}
}
@Test
public void testGetAnnotationsForElementWithMultiHGNC() throws Exception {
try {
MiriamData snca = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
MiriamData park7 = new MiriamData(MiriamType.HGNC_SYMBOL, "PARK7");
GenericProtein proteinAlias = new GenericProtein("id");
proteinAlias.addMiriamData(snca);
proteinAlias.addMiriamData(park7);
hgncAnnotator.annotateElement(proteinAlias);
assertEquals(1, getWarnings().size());
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testGetAnnotationsForHGNC_ID() throws Exception {
try {
......@@ -290,6 +308,16 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
}
}
@Test
public void testUnknownHgncIdToName() throws Exception {
try {
assertNull(hgncAnnotator.hgncIdToHgncName(new MiriamData(MiriamType.HGNC, "asd")));
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testHgncToUniProt1() throws Exception {
try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment