1 17 package org.alfresco.repo.content.transform; 18 19 import org.alfresco.repo.content.MimetypeMap; 20 import org.apache.commons.logging.Log; 21 import org.apache.commons.logging.LogFactory; 22 23 28 public class PdfBoxContentTransformerTest extends AbstractContentTransformerTest 29 { 30 private static final Log logger = LogFactory.getLog(PdfBoxContentTransformerTest.class); 31 32 private ContentTransformer transformer; 33 34 public void onSetUpInTransaction() throws Exception 35 { 36 transformer = new PdfBoxContentTransformer(); 37 } 38 39 42 protected ContentTransformer getTransformer(String sourceMimetype, String targetMimetype) 43 { 44 return transformer; 45 } 46 47 public void testReliability() throws Exception 48 { 49 double reliability = 0.0; 50 reliability = transformer.getReliability(MimetypeMap.MIMETYPE_TEXT_PLAIN, MimetypeMap.MIMETYPE_PDF); 51 assertEquals("Mimetype should not be supported", 0.0, reliability); 52 reliability = transformer.getReliability(MimetypeMap.MIMETYPE_PDF, MimetypeMap.MIMETYPE_TEXT_PLAIN); 53 assertEquals("Mimetype should be supported", 1.0, reliability); 54 } 55 } 56 | Popular Tags |