diff 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 diff
--- a/test/org/nwoca/ssdt/tools/html2wiki/Html2WikiTest.java	Thu Jun 08 18:11:12 2006 -0400
+++ b/test/org/nwoca/ssdt/tools/html2wiki/Html2WikiTest.java	Tue Jan 25 17:06:57 2011 -0500
@@ -4,24 +4,27 @@
  *
  * 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 java.io.*;
-
+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 {
@@ -29,26 +32,33 @@
 
     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");
-        
-        
-         Html2Wiki.main(new String[] {"\\C:\\temp\\", "EMIS System Managers Manual"});
-        
-    }
-    
-//    public  void testHtml2Wiki() throws Exception {
-//        
-//        File testFile = new File("\\C:\\temp\\test.html");
-//        Html2Wiki.process(testFile);
-//        
+//     */
+//    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"});
+//
 //    }
-    
 }