Mercurial > public > html2wiki
comparison 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 |
comparison
equal
deleted
inserted
replaced
1:b6e94d49a9a9 | 2:5da2e67620f9 |
---|---|
2 * Html2WikiTest.java | 2 * Html2WikiTest.java |
3 * JUnit based test | 3 * JUnit based test |
4 * | 4 * |
5 * Created on May 9, 2006, 4:16 PM | 5 * Created on May 9, 2006, 4:16 PM |
6 */ | 6 */ |
7 | |
8 package org.nwoca.ssdt.tools.html2wiki; | 7 package org.nwoca.ssdt.tools.html2wiki; |
9 | 8 |
9 import java.io.File; | |
10 import java.net.URL; | |
10 import junit.framework.*; | 11 import junit.framework.*; |
11 import java.io.*; | 12 import org.apache.commons.io.FileUtils; |
12 | |
13 | 13 |
14 /** | 14 /** |
15 * | 15 * |
16 * @author SMITH | 16 * @author SMITH |
17 */ | 17 */ |
18 public class Html2WikiTest extends TestCase { | 18 public class Html2WikiTest extends TestCase { |
19 | 19 |
20 File path; | |
21 | |
20 public Html2WikiTest(String testName) { | 22 public Html2WikiTest(String testName) { |
21 super(testName); | 23 super(testName); |
22 } | 24 } |
23 | 25 |
24 protected void setUp() throws Exception { | 26 protected void setUp() throws Exception { |
27 path = new File(Html2WikiTest.class.getResource("/resources").toURI()); | |
25 } | 28 } |
26 | 29 |
27 protected void tearDown() throws Exception { | 30 protected void tearDown() throws Exception { |
28 } | 31 } |
29 | 32 |
30 public static Test suite() { | 33 public static Test suite() { |
31 TestSuite suite = new TestSuite(Html2WikiTest.class); | 34 TestSuite suite = new TestSuite(Html2WikiTest.class); |
32 | 35 |
33 return suite; | 36 return suite; |
37 } | |
38 | |
39 public void testChapterParsing() throws Exception { | |
40 | |
41 File f = new File(path, "sysman_handbook.html"); | |
42 | |
43 Html2Wiki converter = new Html2Wiki(FileUtils.readFileToString(f, null)); | |
44 | |
45 Html2Wiki.WikiChapter[] chapters = converter.getWikiChapters(); | |
46 | |
47 assertTrue( chapters.length > 0); | |
48 for (Html2Wiki.WikiChapter c : chapters) { | |
49 System.out.println(c); | |
50 } | |
34 } | 51 } |
35 | 52 |
36 /** | 53 /** |
37 * Test of main method, of class org.nwoca.ssdt.tools.html2wiki.Html2Wiki. | 54 * Test of main method, of class org.nwoca.ssdt.tools.html2wiki.Html2Wiki. |
38 */ | 55 // */ |
39 public void testMain() throws Exception { | 56 // public void testMain() throws Exception { |
40 System.out.println("main"); | 57 // System.out.println("main"); |
41 | 58 // |
42 | 59 // File path = new File(Html2WikiTest.class.getResource("/resources").toURI()); |
43 Html2Wiki.main(new String[] {"\\C:\\temp\\", "EMIS System Managers Manual"}); | 60 // System.out.println(path); |
44 | 61 // Html2Wiki.main(new String[]{path.toString(), "OECN System Managers Handbook"}); |
45 } | 62 // |
46 | |
47 // public void testHtml2Wiki() throws Exception { | |
48 // | |
49 // File testFile = new File("\\C:\\temp\\test.html"); | |
50 // Html2Wiki.process(testFile); | |
51 // | |
52 // } | 63 // } |
53 | |
54 } | 64 } |