1 package org.jadetower.dao.test; 2 3 import junit.framework.TestCase; 4 import org.jadetower.dao.*; 5 import org.jadetower.dao.test.daos.ContextDao; 6 import java.util.HashMap; 7 import java.io.File; 8 9 10 public class ParentContextTestCase extends TestCase { 11 12 String expectedName = "org.jadetower.dao.test.daos.ContextDao"; 13 String expectedFile = "parent-context-example.xconf"; 14 15 public ParentContextTestCase() { 16 }; 17 18 public void testProgrammaticContext() throws Exception { 19 String[] configuration = new String[] { 20 "src/conf/parent-context-example.xconf"}; 21 22 HashMap context = new HashMap(); 23 context.put("name", expectedName); 24 context.put("file", new File("src/conf/parent-context-example.xconf")); 25 26 DaoContainer daoContainer = new DaoContainer(configuration, context, null); 27 28 DaoManager manager = daoContainer.getManager("programmatic"); 29 ContextDao dao = (ContextDao) manager.getDao("context"); 30 String name = dao.getName(); 31 String file = dao.getFile().getName(); 32 boolean pass = name.equalsIgnoreCase(expectedName) && 33 file.equalsIgnoreCase(expectedFile); 34 assertTrue(pass); 35 } 36 }

This page was automatically generated by Maven