1 17 package org.alfresco.repo.content.transform; 18 19 import org.alfresco.repo.content.MimetypeMap; 20 21 26 public class HtmlParserContentTransformerTest extends AbstractContentTransformerTest 27 { 28 private static final String SOME_CONTENT = "azAz10!£$%^&*()\t\r\n"; 29 30 private ContentTransformer transformer; 31 32 @Override 33 public void onSetUpInTransaction() throws Exception 34 { 35 transformer = new HtmlParserContentTransformer(); 36 } 37 38 protected ContentTransformer getTransformer(String sourceMimetype, String targetMimetype) 39 { 40 return transformer; 41 } 42 43 public void testSetUp() throws Exception 44 { 45 assertNotNull(transformer); 46 } 47 48 public void checkReliability() throws Exception 49 { 50 double reliability = transformer.getReliability(MimetypeMap.MIMETYPE_HTML, MimetypeMap.MIMETYPE_TEXT_PLAIN); 52 assertEquals("Reliability incorrect", 1.0, reliability); 54 reliability = transformer.getReliability(MimetypeMap.MIMETYPE_TEXT_PLAIN, MimetypeMap.MIMETYPE_HTML); 56 assertEquals("Reliability incorrect", 0.0, reliability); } 58 } 59 | Popular Tags |