1
15
16 package gate.email;
17
18 import java.util.Map;
19
20 import junit.framework.*;
21
22 import gate.Gate;
23
25
26
29 public class TestEmail extends TestCase
30 {
31
32 private static final boolean DEBUG = false;
33
34
35 public TestEmail(String name) { super(name); }
36
37
38 public void setUp() {
39 }
41
42 public void testUnpackMarkup() throws Exception{
43 Map markupElementsMap = null;
45 gate.Document doc = null;
46 doc = gate.Factory.newDocument(Gate.getUrl("tests/email/test.eml"), "ISO-8859-1");
48
49 gate.DocumentFormat docFormat = gate.DocumentFormat.getDocumentFormat(
51 doc, doc.getSourceUrl()
52 );
53 assertTrue( "Bad document Format was produced.EmailDocumentFormat was expected",
54 docFormat instanceof gate.corpora.EmailDocumentFormat
55 );
56
57 docFormat.unpackMarkup (doc,"DocumentContent");
58 gate.corpora.TestDocument.verifyNodeIdConsistency(doc);
60
61 }
63 public static void main(String[] args) {
64 try{
65 Gate.init();
66 TestEmail testEmail = new TestEmail("");
67 testEmail.testUnpackMarkup();
68
69 }catch(Exception e){
70 e.printStackTrace();
71 }
72 }
73
74
77 public void testEmail(){
78 EmailDocumentHandler emailDocumentHandler = new EmailDocumentHandler();
79 emailDocumentHandler.testSelf();
80 }
82
83 public static Test suite() {
84 return new TestSuite(TestEmail.class);
85 }
87 }