Package org.semanticweb.owlapi.util

Examples of org.semanticweb.owlapi.util.VersionInfo


public class VerifyVersionInfoTestCase {

    @Test
    public void checkMatchVersion() throws Exception {
        // given
        VersionInfo info = VersionInfo.getVersionInfo();
        Document doc = DocumentBuilderFactory.newInstance()
                .newDocumentBuilder().parse(new File("pom.xml"));
        NodeList list = doc.getDocumentElement().getChildNodes();
        boolean found = false;
        for (int i = 0; i < list.getLength() && !found; i++) {
            Node n = list.item(i);
            if (n instanceof Element
                    && ((Element) n).getTagName().equals("version")) {
                String version = n.getTextContent();
                if (!version.equals(info.getVersion())) {
                    System.out
                            .println("VerifyVersionInfo.checkMatchVersion() WARNING: update the version in VersionInfo");
                }
                // assertEquals(version, info.getVersion());
                found = true;
            }
        }
        if (!found) {
            File file = new File("../pom.xml");
            if (file.exists()) {
                doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
                        .parse(file);
                list = doc.getDocumentElement().getChildNodes();
                found = false;
                for (int i = 0; i < list.getLength() && !found; i++) {
                    Node n = list.item(i);
                    if (n instanceof Element
                            && ((Element) n).getTagName().equals("version")) {
                        String version = n.getTextContent();
                        if (!version.equals(info.getVersion())) {
                            System.out
                                    .println("VerifyVersionInfo.checkMatchVersion() WARNING: update the version in VersionInfo");
                        }
                        // assertEquals(version, info.getVersion());
                        found = true;
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.VersionInfo

Copyright © 2018 www.massapicom. 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.