Search in sources :

Example 1 with PublicationType

use of ubic.gemma.model.common.description.PublicationType in project Gemma by PavlidisLab.

the class PubMedXMLParserTest method testParseRetracted.

/*
     * PMID 7914452 is an example of a retracted article.
     */
@Test
public void testParseRetracted() {
    try {
        testStream = PubMedXMLParserTest.class.getResourceAsStream("/data/pubmed-retracted.xml");
        Collection<BibliographicReference> brl = testParser.parse(testStream);
        BibliographicReference br = brl.iterator().next();
        assertNotNull(br.getAbstractText());
        assertEquals("Retracted [In: Garey CE, Schwarzman AL, Rise ML, Seyfried TN. Nat Genet. 1995 Sep;11(1):104 PMID=7550304]", br.getDescription());
        boolean ok = false;
        for (PublicationType pt : br.getPublicationTypes()) {
            if ("Retracted Publication".equals(pt.getType())) {
                ok = true;
            }
        }
        assertTrue(ok);
    } catch (RuntimeException e) {
        this.logOrThrowException(e);
    }
}
Also used : PublicationType(ubic.gemma.model.common.description.PublicationType) BibliographicReference(ubic.gemma.model.common.description.BibliographicReference) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BibliographicReference (ubic.gemma.model.common.description.BibliographicReference)1 PublicationType (ubic.gemma.model.common.description.PublicationType)1