use of org.neusoft.neubbs.entity.MessageDO in project neubbs by nuitcoder.
the class MessageDAOTest method testGetMessage.
/**
* 测试获取消息信息
*/
@Test
@Transactional
public void testGetMessage() {
MessageDO message = this.saveTestMessageDOToDatabase();
System.out.println("get message information: " + message);
}
use of org.neusoft.neubbs.entity.MessageDO in project neubbs by nuitcoder.
the class MessageDAOTest method saveTestMessageDOToDatabase.
/**
* 保存测试消息至数据库
*
* @return MessageDO 重查询的消息对象
*/
private MessageDO saveTestMessageDOToDatabase() {
MessageDO message = new MessageDO();
message.setSource("System Notice");
message.setSenderId(1);
message.setContent("welcome all user!");
message.setReceiverId(6);
Assert.assertEquals(1, messageDAO.saveMessage(message));
return messageDAO.getMessage(message.getId());
}
use of org.neusoft.neubbs.entity.MessageDO in project neubbs by nuitcoder.
the class MessageDAOTest method testUpdateMessageReceiveTime.
/**
* 测试更新接收时间
*/
@Test
@Transactional
public void testUpdateMessageReceiveTime() {
MessageDO message = this.saveTestMessageDOToDatabase();
int messageId = message.getId();
Assert.assertEquals(1, messageDAO.updateMessageReceiveTime(messageId));
MessageDO afterMessage = messageDAO.getMessage(messageId);
Date afterReceiveTime = afterMessage.getReceiveTime();
Assert.assertNotNull(afterMessage);
System.out.println("update id=" + messageId + " message receive time=<" + afterReceiveTime + ">");
}
use of org.neusoft.neubbs.entity.MessageDO in project neubbs by nuitcoder.
the class MessageDAOTest method testSaveMessage.
/**
* 测试保存消息
*/
@Test
@Transactional
public void testSaveMessage() {
MessageDO message = this.saveTestMessageDOToDatabase();
System.out.println("success save message: " + message);
}
Aggregations