view test/org/nwoca/ssdt/tools/html2wiki/Html2WikiTest.java @ 2:5da2e67620f9

Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
author smith@nwoca.org
date Tue, 25 Jan 2011 17:06:57 -0500
parents f8b1ea49d065
children 22ed6d93442c
line wrap: on
line source
/*
 * Html2WikiTest.java
 * JUnit based test
 *
 * Created on May 9, 2006, 4:16 PM
 */
package org.nwoca.ssdt.tools.html2wiki;

import java.io.File;
import java.net.URL;
import junit.framework.*;
import org.apache.commons.io.FileUtils;

/**
 *
 * @author SMITH
 */
public class Html2WikiTest extends TestCase {

    File path;

    public Html2WikiTest(String testName) {
        super(testName);
    }

    protected void setUp() throws Exception {
        path = new File(Html2WikiTest.class.getResource("/resources").toURI());
    }

    protected void tearDown() throws Exception {
    }

    public static Test suite() {
        TestSuite suite = new TestSuite(Html2WikiTest.class);

        return suite;
    }

    public void testChapterParsing() throws Exception {

        File f = new File(path, "sysman_handbook.html");

        Html2Wiki converter = new Html2Wiki(FileUtils.readFileToString(f, null));

        Html2Wiki.WikiChapter[] chapters = converter.getWikiChapters();

        assertTrue( chapters.length > 0);
        for (Html2Wiki.WikiChapter c : chapters) {
            System.out.println(c);
        }
    }

    /**
     * Test of main method, of class org.nwoca.ssdt.tools.html2wiki.Html2Wiki.
//     */
//    public void testMain() throws Exception {
//        System.out.println("main");
//
//        File path = new File(Html2WikiTest.class.getResource("/resources").toURI());
//        System.out.println(path);
//        Html2Wiki.main(new String[]{path.toString(), "OECN System Managers Handbook"});
//
//    }
}