一个非常好的FRAMWRK!是一个外国组织做的!不!
源代码在线查看: testxmlparser.java
package com.jdon.controller.config;
import junit.framework.*;
import java.util.*;
public class TestXmlParser extends TestCase {
private XmlParser xmlParser1 = null;
private XmlParser xmlParser2 = null;
private XmlParser xmlParser3 = null;
protected void setUp() throws Exception {
super.setUp();
xmlParser1 = new XmlModelParser();
xmlParser2 = new XmlServiceParser();
xmlParser3 = new XmlPojoServiceParser();
}
protected void tearDown() throws Exception {
xmlParser1 = null;
xmlParser2 = null;
xmlParser3 = null;
super.tearDown();
}
public void testLoad() {
String configFileName = "jdonframework.xml";
Map expectedReturn = null;
Map actualReturn = xmlParser1.load(configFileName);
Assert.assertNotNull(actualReturn);
actualReturn = xmlParser2.load(configFileName);
Assert.assertNotNull(actualReturn);
xmlParser3.setDoc(xmlParser2.getDoc());
actualReturn = xmlParser3.load(configFileName);
Assert.assertNotNull(actualReturn);
/**@todo fill in the test code*/
}
}