@Test
public void testDelete() throws Exception {

	smsContentDAO.save(new SmsContent("Test Sms 1", "13917677725"));
	smsContentDAO.save(new SmsContent("Test Sms 2", "13917677725"));
	smsContentDAO.save(new SmsContent("Test Sms 3", "13917677725"));
	smsContentDAO.save(new SmsContent("Test Sms 4", "13917677725"));
	smsContentDAO.save(new SmsContent("Test Sms 5", "13917677725"));
	
	int rownum = 0;
	Statement stat = conn.createStatement();
	ResultSet rs = stat.executeQuery("SELECT COUNT(id) FROM sms_content");
	if (rs.next()) {
		rownum = rs.getInt(1);
	}
	
	Map<String, Object> parameters = new HashMap<String, Object>();
	parameters.put("condition", "content = 'Test Sms 1'");
	smsContentDAO.delete(parameters);
	
	stat = conn.createStatement();
	rs = stat.executeQuery("SELECT COUNT(id) FROM sms_content");
	if (rs.next()) {
		Assert.assertEquals(rownum - 1, rs.getInt(1));
		rownum = rs.getInt(1);
	}
	
	parameters.clear();
	parameters.put("condition", "content = 'Test Sms 1'");
	parameters.put("failure", 2);
	smsContentDAO.delete(parameters);
	
	stat = conn.createStatement();
	rs = stat.executeQuery("SELECT COUNT(id) FROM sms_content");
	if (rs.next()) {
		Assert.assertEquals(rownum, rs.getInt(1));
	}	
	
	parameters.clear();
	parameters.put("condition", "content like '%Test Sms%'");
	smsContentDAO.delete(parameters);
	
	stat = conn.createStatement();
	rs = stat.executeQuery("SELECT COUNT(id) FROM sms_content");
	if (rs.next()) {
		Assert.assertEquals(rownum - 4, rs.getInt(1));
	}		
}