1 22 package net.sf.anupam.csv.formatters; 23 24 import junit.framework.TestCase; 25 import org.apache.commons.logging.Log; 26 import org.apache.commons.logging.LogFactory; 27 28 import java.util.Map ; 29 30 36 public class CSVFormatterConfigParserTest 37 extends TestCase { 38 39 42 private static final Log LOG = LogFactory 43 .getLog(CSVFormatterConfigParserTest.class); 44 45 50 public CSVFormatterConfigParserTest(final String name) { 51 super(name); 52 } 53 54 59 public static void main(final String [] args) { 60 junit.textui.TestRunner.run(CSVFormatterConfigParserTest.class); 61 } 62 63 68 public void testGetFormatMappings() { 69 final CSVFormatterConfigParser parser = CSVFormatterConfigParser.getConfigParser(); 70 assertNotNull(parser); 71 72 final Map <String , FormatterConfiguration> formatterMap = parser 73 .getFormatMappings( 74 "net/sf/anupam/csv/formatters/csv-formatter-config.xml", 75 true); 76 assertNotNull("Formatter Map Should not be Null", formatterMap); 77 assertFalse("Formatter Map should not be Empty", formatterMap.isEmpty()); 78 79 for (String formatterName : formatterMap.keySet()) { 80 final FormatterConfiguration formatterConfig = formatterMap 81 .get(formatterName); 82 assertNotNull(formatterConfig); 83 LOG.info(formatterConfig); 84 } 85 86 } 87 88 } 89 | Popular Tags |