Commit 2fe8a13f authored by David Hoksza's avatar David Hoksza
Browse files

test with multiple annotators

parent 2083b145
package lcsb.mapviewer.annotation.services.annotators;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import lcsb.mapviewer.annotation.AnnotationTestFunctions;
import lcsb.mapviewer.annotation.cache.WebPageDownloader;
import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.species.GenericProtein;
import lcsb.mapviewer.model.map.species.Species;
public class MultipleAnnotatorsTest extends AnnotationTestFunctions {
@Autowired
KeggAnnotator keggAnnotator;
@Autowired
UniprotAnnotator uniprotAnnotator;
@Autowired
HgncAnnotator hgncAnnotator;
@Autowired
BiocompendiumAnnotator biocompendiumAnnotator;
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void testAnnotateUniprotByUniprotAndKegg() throws Exception {
try {
Species protein = new GenericProtein("id");
protein.setName("bla");
protein.addMiriamData(new MiriamData(MiriamType.UNIPROT, "P12345"));
keggAnnotator.annotateElement(protein);
uniprotAnnotator.annotateElement(protein);
hgncAnnotator.annotateElement(protein);
//biocompendiumAnnotator.annotateElement(protein);
int cntNoAnnotator = 0;
for (MiriamData md: protein.getMiriamData()) {
if (md.getAnnotator() == null) {
cntNoAnnotator++;
}
}
assertTrue("Wrong number of annotated elements with no information about annotator", cntNoAnnotator == 1);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
}
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