| 1 16 package com.blandware.atleap.service.core; 17 18 import com.blandware.atleap.common.util.ConvertUtil; 19 import org.apache.commons.beanutils.BeanUtils; 20 import org.apache.commons.logging.Log; 21 import org.apache.commons.logging.LogFactory; 22 import org.jmock.MockObjectTestCase; 23 24 import java.util.Map ; 25 import java.util.MissingResourceException ; 26 import java.util.ResourceBundle ; 27 28 36 public abstract class BaseManagerTestCase extends MockObjectTestCase { 37 39 protected final Log log = LogFactory.getLog(getClass()); 40 protected ResourceBundle rb; 41 42 44 public BaseManagerTestCase() { 45 String className = this.getClass().getName(); 48 49 try { 50 rb = ResourceBundle.getBundle(className); 51 } catch ( MissingResourceException mre ) { 52 } 54 } 55 56 58 66 protected Object populate(Object obj) throws Exception { 67 Map map = ConvertUtil.convertBundleToMap(rb); 70 71 BeanUtils.copyProperties(obj, map); 72 73 return obj; 74 } 75 } 76 | Popular Tags |