01: package test.spring;
02:
03: import dalma.EngineFactory;
04: import dalma.Engine;
05: import org.springframework.beans.factory.xml.XmlBeanFactory;
06: import org.springframework.core.io.ClassPathResource;
07: import junit.framework.TestCase;
08:
09: /**
10: * Spring configuration test.
11: * @author Kohsuke Kawaguchi
12: */
13: public class SpringTest extends TestCase {
14: public void test1() throws Exception {
15: XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource(
16: "config.xml", SpringTest.class));
17: EngineFactory ef = (EngineFactory) xbf.getBean("engine");
18: Engine engine = ef.newInstance();
19: assertNotNull(engine.getEndPoint("e-mail"));
20: engine.start();
21: engine.stop();
22: }
23: }
|