KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > content > metadata > PdfBoxMetadataExtracterTest


1 package org.alfresco.repo.content.metadata;
2
3 import org.alfresco.repo.content.MimetypeMap;
4
5 /**
6  * @see org.alfresco.repo.content.metadata.PdfBoxMetadataExtracter
7  *
8  * @author Jesper Steen Møller
9  */

10 public class PdfBoxMetadataExtracterTest extends AbstractMetadataExtracterTest
11 {
12     private MetadataExtracter extracter;
13
14     @Override JavaDoc
15     public void setUp() throws Exception JavaDoc
16     {
17         super.setUp();
18         extracter = new PdfBoxMetadataExtracter();
19     }
20
21     /**
22      * @return Returns the same transformer regardless - it is allowed
23      */

24     protected MetadataExtracter getExtracter()
25     {
26         return extracter;
27     }
28
29     public void testReliability() throws Exception JavaDoc
30     {
31         double reliability = 0.0;
32         reliability = extracter.getReliability(MimetypeMap.MIMETYPE_TEXT_PLAIN);
33         assertEquals("Mimetype should not be supported", 0.0, reliability);
34
35         reliability = extracter.getReliability(MimetypeMap.MIMETYPE_PDF);
36         assertEquals("Mimetype should be supported", 1.0, reliability);
37     }
38
39     public void testPdfExtraction() throws Exception JavaDoc
40     {
41         testExtractFromMimetype(MimetypeMap.MIMETYPE_PDF);
42     }
43 }
44
Popular Tags