KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

23     protected MetadataExtracter getExtracter()
24     {
25         return extracter;
26     }
27
28     public void testReliability() throws Exception JavaDoc
29     {
30         for (String JavaDoc mimetype : OfficeMetadataExtracter.SUPPORTED_MIMETYPES)
31         {
32             double reliability = extracter.getReliability(mimetype);
33             assertTrue("Expected above zero reliability", reliability > 0.0);
34         }
35     }
36
37     /**
38      * Test all the supported mimetypes
39      */

40     public void testSupportedMimetypes() throws Exception JavaDoc
41     {
42         for (String JavaDoc mimetype : OfficeMetadataExtracter.SUPPORTED_MIMETYPES)
43         {
44             testExtractFromMimetype(mimetype);
45         }
46     }
47 }
48
Popular Tags