package org.appfuse.service;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import junit.framework.TestCase;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.appfuse.util.ConvertUtil;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class BaseManagerTestCase extends TestCase {
private static Log log = LogFactory.getLog(BaseManagerTestCase.class);
protected ResourceBundle rb = null;
protected Object conn = null;
protected ClassPathXmlApplicationContext ctx = null;
public BaseManagerTestCase() {
ctx = new ClassPathXmlApplicationContext("/applicationContext.xml");
String className = this.getClass().getName();
try {
rb = ResourceBundle.getBundle(className);
} catch (MissingResourceException mre) {
}
}
protected Object populate(Object obj) throws Exception {
Map map = ConvertUtil.convertBundleToMap(rb);
BeanUtils.copyProperties(obj, map);
return obj;
}
}