Mercurial > public > html2wiki
annotate test/org/nwoca/ssdt/tools/html2wiki/Html2WikiTest.java @ 14:c8442e0eff84
Remove <caption> tags. Generlized {table} around {code} blocks.
author | smith@nwoca.org |
---|---|
date | Tue, 01 Feb 2011 12:34:45 -0500 |
parents | 22ed6d93442c |
children |
rev | line source |
---|---|
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
1 /* |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
2 * Html2WikiTest.java |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
3 * JUnit based test |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
4 * |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
5 * Created on May 9, 2006, 4:16 PM |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
6 */ |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
7 package org.nwoca.ssdt.tools.html2wiki; |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
8 |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
9 import java.io.File; |
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
10 import java.net.URL; |
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
11 import junit.framework.*; |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
12 import org.apache.commons.io.FileUtils; |
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
13 |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
14 /** |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
15 * |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
16 * @author SMITH |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
17 */ |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
18 public class Html2WikiTest extends TestCase { |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
19 |
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
20 File path; |
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
21 |
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
22 public Html2WikiTest(String testName) { |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
23 super(testName); |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
24 } |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
25 |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
26 protected void setUp() throws Exception { |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
27 path = new File(Html2WikiTest.class.getResource("/resources").toURI()); |
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
28 } |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
29 |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
30 protected void tearDown() throws Exception { |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
31 } |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
32 |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
33 public static Test suite() { |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
34 TestSuite suite = new TestSuite(Html2WikiTest.class); |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
35 |
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
36 return suite; |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
37 } |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
38 |
4
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
39 // public void testChapterParsing() throws Exception { |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
40 // |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
41 // File f = new File(path, "sysman_handbook.html"); |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
42 // |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
43 // Html2Wiki converter = new Html2Wiki(FileUtils.readFileToString(f, null)); |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
44 // |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
45 // Html2Wiki.WikiChapter[] chapters = converter.getWikiChapters(); |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
46 // |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
47 // assertTrue( chapters.length > 0); |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
48 // for (Html2Wiki.WikiChapter c : chapters) { |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
49 // System.out.println(c); |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
50 // } |
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
51 // } |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
52 |
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
53 /** |
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
54 * Test of main method, of class org.nwoca.ssdt.tools.html2wiki.Html2Wiki. |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
55 // */ |
4
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
56 public void testMain() throws Exception { |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
57 // System.out.println("main"); |
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
58 // |
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
59 // File path = new File(Html2WikiTest.class.getResource("/resources").toURI()); |
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
60 // System.out.println(path); |
14
c8442e0eff84
Remove <caption> tags. Generlized {table} around {code} blocks.
smith@nwoca.org
parents:
4
diff
changeset
|
61 Html2Wiki.main( new String[] {path.toString(), ""}); |
2
5da2e67620f9
Upgrade to Ivy configuration and begin clean up of tests. Added FreeBSD license.
smith@nwoca.org
parents:
0
diff
changeset
|
62 // |
4
22ed6d93442c
Start modifying transformers to Confluence wiki syntax
smith@nwoca.org
parents:
2
diff
changeset
|
63 } |
0
f8b1ea49d065
Initial version of crude HTML to WikiText converter. Customized for converting HTML files from DEC Document into Wiki markup.
smith@nwoca.org
parents:
diff
changeset
|
64 } |