@SuppressWarnings("deprecation")
@Test
public void testQuery() throws Exception {

	smsContentDAO.save(new SmsContent("Test Sms 1", "13917677725"));
	Thread.sleep(1000);
	smsContentDAO.save(new SmsContent("Test Sms 2", "13917677725"));
	Thread.sleep(1000);
	smsContentDAO.save(new SmsContent("Test Sms 3", "13917677725"));
	Thread.sleep(1000);
	smsContentDAO.save(new SmsContent("Test Sms 4", "13917677725"));
	Thread.sleep(1000);
	smsContentDAO.save(new SmsContent("Test Sms 5", "13000000000"));
	Date date = new Date();
	date.setYear(date.getYear() + 10);
	smsContentDAO.save(new SmsContent("Test Sms 6", "13917677725", date));		
	
	Map<String, Object> parameters = new HashMap<String, Object>();
	parameters.put("condition", "mobile = '13917677725'");
	List<SmsContent> contents = smsContentDAO.query(parameters);
	Assert.assertEquals(4, contents.size());
	int i = 1;
	for (SmsContent content : contents) {
		Assert.assertEquals("Test Sms " + i++, content.getContent());
	}
	
	parameters.clear();
	parameters.put("limit", "3");
	contents = smsContentDAO.query(parameters);
	Assert.assertEquals(3, contents.size());
	i = 1;
	for (SmsContent content : contents) {
		Assert.assertEquals("Test Sms " + i++, content.getContent());
	}
	
	parameters.clear();
	Assert.assertEquals(5, smsContentDAO.query(parameters).size());
	
	parameters.clear();
	parameters.put("condition", "mobile = '13917677725'");
	parameters.put("failure", "-1");
	Assert.assertEquals(0, smsContentDAO.query(parameters).size());
}