Package net.sourceforge.yagsbook.encyclopedia.articles

Examples of net.sourceforge.yagsbook.encyclopedia.articles.Article


    public void
    testArticle() {
        MockArticle     mock = new MockArticle();
       
        try {
            Article     article = new Article("test", mock.toXML());       
        } catch (IOException e) {
            fail("Failed to parse article");
        }
    }
View Full Code Here


    public void
    testGetUri() {
        MockArticle     mock = new MockArticle();
       
        try {
            Article     article = new Article("test", mock.toXML());
            assertEquals("Value of returned URI was unexpected", "test",
                        article.getUri());
        } catch (IOException e) {
            fail("Failed to parse article");
        }
    }
View Full Code Here

        final String    TITLE = "Test Article";
       
        MockArticle     mock = new MockArticle();
        mock.setTitle(TITLE);
        try {
            Article     article = new Article("test", mock.toXML());
            assertEquals("Value of returned title was wrong", TITLE,
                         article.getTitle());
        } catch (IOException e) {
            fail("Failed to parse article");
        }
    }
View Full Code Here

        final String    AUTHOR = "Some Author";
       
        MockArticle     mock = new MockArticle();
        mock.setAuthor(AUTHOR);
        try {
            Article     article = new Article("test", mock.toXML());
            assertEquals("Value of returned author was wrong", AUTHOR,
                         article.getAuthor());
        } catch (IOException e) {
            fail("Failed to parse article");
        }
    }
View Full Code Here

       
        MockArticle     mock = new MockArticle();
        mock.setVersion("$Revision: 1.2 $");
       
        try {
            Article     article = new Article("test", mock.toXML());
            assertEquals("Value of returned version was wrong", VERSION,
                         article.getVersion());
        } catch (IOException e) {
            fail("Failed to parse article");
        }
    }
View Full Code Here

       
        MockArticle     mock = new MockArticle();
        mock.setDate("$Date: 2005/04/10 11:43:00 $");
       
        try {
            Article     article = new Article("test", mock.toXML());
            assertEquals("Value of returned version was wrong", DATE,
                         article.getDate());
        } catch (IOException e) {
            fail("Failed to parse article");
        }
    }
View Full Code Here

       
        MockArticle     mock = new MockArticle();
        mock.setSubject(new Topic(URI, NAME));
       
        try {
            Article     article = new Article("test", mock.toXML());
           
            Topic       subject = article.getSubject();
            assertEquals("Subject has wrong uri", URI, subject.getUri());
            assertEquals("Subject has wrong name", NAME, subject.getName());
        } catch (IOException e) {
            fail("Failed to parse article");
        }
View Full Code Here

       
        MockArticle     mock = new MockArticle();
        mock.setCategory(CATEGORY);
       
        try {
            Article     article = new Article("test", mock.toXML());
            assertEquals("Value of returned category was wrong", CATEGORY,
                         article.getCategory());
        } catch (IOException e) {
            fail("Failed to parse article");
        }
    }
View Full Code Here

            topics[i] = new Topic(URI+i, NAME+i);
        }
        mock.setTopics(topics);
       
        try {
            Article     article = new Article("test", mock.toXML());
            Iterator    iter = article.getTopics();
           
            int count = 0;
            while (iter.hasNext()) {
                Topic   topic = (Topic) iter.next();
               
View Full Code Here

        }
        body.append("</sect1>");
        mock.setBody(body.toString());
       
        try {
            Article     article = new Article("test", mock.toXML());
            Iterator    iter = article.getReferences();
           
            if (!iter.hasNext()) {
                fail("Did not find any references");
            }
           
View Full Code Here

TOP

Related Classes of net.sourceforge.yagsbook.encyclopedia.articles.Article

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.