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 BinaryPassThroughContentTransformerTest extends AbstractContentTransformerTest 29 { 30 private static final Log logger = LogFactory.getLog(BinaryPassThroughContentTransformerTest.class); 31 32 private ContentTransformer transformer; 33 34 public void onSetUpInTransaction() throws Exception 35 { 36 transformer = new BinaryPassThroughContentTransformer(); 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_TEXT_PLAIN); 51 assertEquals("Mimetype should not be supported", 0.0, reliability); 52 reliability = transformer.getReliability(MimetypeMap.MIMETYPE_XML, MimetypeMap.MIMETYPE_XML); 53 assertEquals("Mimetype should not be supported", 0.0, reliability); 54 reliability = transformer.getReliability(MimetypeMap.MIMETYPE_WORD, MimetypeMap.MIMETYPE_WORD); 55 assertEquals("Mimetype should be supported", 1.0, reliability); 56 reliability = transformer.getReliability(MimetypeMap.MIMETYPE_EXCEL, MimetypeMap.MIMETYPE_EXCEL); 57 assertEquals("Mimetype should be supported", 1.0, reliability); 58 } 59 } 60 | Popular Tags |