1 package org.jgroups.tests; 2 3 import junit.framework.TestCase; 4 import org.apache.commons.logging.Log; 5 import org.apache.commons.logging.LogFactory; 6 import org.jgroups.conf.XmlConfigurator; 7 import org.jgroups.util.Util; 8 9 import java.io.InputStream ; 10 11 12 public class XmlConfigurationTest extends TestCase { 13 14 protected Log log=LogFactory.getLog(getClass()); 15 16 17 public XmlConfigurationTest(String Name_) { 18 super(Name_); 19 } 20 21 22 public void testBasic() { 23 try { 24 InputStream default_config=Util.getResourceAsStream("udp.xml", this.getClass()); 25 XmlConfigurator conf=XmlConfigurator.getInstance(default_config); 26 if(log.isDebugEnabled()) log.debug(conf.getProtocolStackString()); 27 assertTrue("Successfully parsed a valid XML configuration file.", true); 28 } 29 catch(Exception x) { 30 fail(x.getMessage()); 31 } 32 } 33 34 35 36 public static void main(String [] args) { 37 String [] testCaseName={XmlConfigurationTest.class.getName()}; 38 junit.swingui.TestRunner.main(testCaseName); 39 } 40 41 } 42 | Popular Tags |