@ContextConfiguration(locations = "classpath:/CloneSettingDaoTestContext.xml")
public class UserVmCloneSettingDaoImplTest extends TestCase {
@Inject UserVmCloneSettingDaoImpl _vmcsdao;
public void makeEntry(Long vmId, String cloneType) {
UserVmCloneSettingVO vo = new UserVmCloneSettingVO(vmId, cloneType);
_vmcsdao.persist(vo);
vo = _vmcsdao.findById(vmId);
assert (vo.getCloneType().equalsIgnoreCase(cloneType)) : "Unexpected Clone Type retrieved from table! Retrieved: " + vo.getCloneType() + " while expected was: " + cloneType;
// Next test whether the record is retrieved by clone type.
List<UserVmCloneSettingVO> voList = new ArrayList<UserVmCloneSettingVO>();
voList = _vmcsdao.listByCloneType(cloneType);
assert (voList != null && !voList.isEmpty()) : "Failed to retrieve any record of VMs by clone type!";