Package org.coode.owlapi.obo12

Source Code of org.coode.owlapi.obo12.LoadCellTestCase

package org.coode.owlapi.obo12;

import static org.junit.Assert.assertEquals;

import org.coode.owlapi.obo12.parser.OBO12DocumentFormat;
import org.junit.Test;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.io.OWLOntologyDocumentSource;
import org.semanticweb.owlapi.io.OWLOntologyDocumentSourceBase;
import org.semanticweb.owlapi.io.StreamDocumentSource;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;

@SuppressWarnings("javadoc")
public class LoadCellTestCase {

    @Test
    public void shouldParse() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        assertEquals(19, m.getOntologyParsers().size());
        @SuppressWarnings("null")
        OWLOntologyDocumentSource source = new StreamDocumentSource(getClass()
                .getResourceAsStream("/celltype.obo"),
                OWLOntologyDocumentSourceBase.getNextDocumentIRI("obo"),
                new OBO12DocumentFormat(), null);
        m.loadOntologyFromOntologyDocument(source);
    }

    @Test
    public void shouldParseOBO12() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        assertEquals(19, m.getOntologyParsers().size());
        @SuppressWarnings("null")
        OWLOntologyDocumentSource source = new StreamDocumentSource(getClass()
                .getResourceAsStream("/behavior.obo"),
                OWLOntologyDocumentSourceBase.getNextDocumentIRI("obo"),
                new OBO12DocumentFormat(), null);
        m.loadOntologyFromOntologyDocument(source);
    }

    @SuppressWarnings("null")
    @Test
    public void shouldParseGenericOBO() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        assertEquals(19, m.getOntologyParsers().size());
        OWLOntologyDocumentSource source = new StreamDocumentSource(getClass()
                .getResourceAsStream("/behavior.obo"));
        m.loadOntologyFromOntologyDocument(source);
    }
}
TOP

Related Classes of org.coode.owlapi.obo12.LoadCellTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.