Package pygmy.nntp.test

Source Code of pygmy.nntp.test.ArticleTest

package pygmy.nntp.test;

import junit.framework.TestCase;
import junit.framework.Test;
import junit.framework.TestSuite;
import pygmy.nntp.Article;

import java.io.File;
import java.io.IOException;

public class ArticleTest extends TestCase {

    protected void setUp() throws Exception {
        super.setUp();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void testArticle() throws IOException {
        Article article = NntpTestUtil.createArticle("test.eml");

        assertEquals( "1.0", article.getHeader().get("Mime-Version") );
        assertEquals( "<blkdu9$pd8$1@hood.uits.indiana.edu>", article.getMessageId() );
        assertEquals( "Re: Static inner classes", article.getSubject() );
        String[] newsgroups = { "comp.lang.java.programmer" };
        for( int i = 0; i < newsgroups.length; i++ ) {
            assertEquals( newsgroups[i], article.getNewsgroups()[i] );
        }
    }

    public static Test suite() {
        return new TestSuite(ArticleTest.class);
    }

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }
}
TOP

Related Classes of pygmy.nntp.test.ArticleTest

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.