1 54 package org.w3c.tidy; 55 56 import java.io.StringWriter ; 57 58 import junit.framework.TestCase; 59 60 import org.apache.commons.logging.Log; 61 import org.apache.commons.logging.LogFactory; 62 63 64 68 public class ConfigurationTest extends TestCase 69 { 70 71 74 private static Log log = LogFactory.getLog(ConfigurationTest.class); 75 76 80 public void testPrintConfig() throws Exception 81 { 82 Tidy tidy = new Tidy(); 83 Configuration configuration = tidy.getConfiguration(); 84 StringWriter writer = new StringWriter (); 85 configuration.printConfigOptions(writer, false); 86 String result = writer.toString(); 87 assertTrue(result.length() > 200); 89 log.debug(result); 90 } 91 92 96 public void testPrintActualConfig() throws Exception 97 { 98 Tidy tidy = new Tidy(); 99 tidy.getConfiguration().tt.defineTag(Dict.TAGTYPE_INLINE, "something"); 100 tidy.getConfiguration().tt.defineTag(Dict.TAGTYPE_INLINE, "second"); 101 Configuration configuration = tidy.getConfiguration(); 102 StringWriter writer = new StringWriter (); 103 configuration.printConfigOptions(writer, true); 104 String result = writer.toString(); 105 assertTrue(result.length() > 200); 107 log.debug(result); 108 } 109 110 } | Popular Tags |