@@ -0,0 +1,1528 @@
+package com.mercury.chat.user.service.protocol;%0D%0A%0D%0Aimport static org.junit.Assert.assertFalse;%0D%0Aimport static org.junit.Assert.assertTrue;%0D%0A%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport com.google.common.collect.Lists;%0D%0Aimport com.mercury.chat.common.struct.IMessage;%0D%0Aimport com.mercury.chat.common.struct.json.JsonHeader;%0D%0Aimport com.mercury.chat.common.struct.json.JsonMessage;%0D%0Aimport com.mercury.chat.user.service.UserService;%0D%0Aimport com.mercury.chat.user.service.UserServiceImpl;%0D%0A%0D%0Apublic class UserServiceTest %7B%0D%0A%09%0D%0A%09%0D%0A%09@Test%0D%0A%09public void testLoginSuccessfully()%7B%0D%0A%09%09UserService userService = UserServiceImpl.getInstance();%0D%0A%09%09boolean login = userService.login(%22god%22, %22pwd%22);%0D%0A%09%09assertTrue(login);%0D%0A%09%7D%0D%0A%09%0D%0A%09@Test%0D%0A%09public void testLoginFailed()%7B%0D%0A%09%09UserService userService = UserServiceImpl.getInstance();%0D%0A%09%09boolean login = userService.login(%22god%22, %22XXX%22);%0D%0A%09%09assertFalse(login);%0D%0A%09%7D%0D%0A%09%0D%0A%0D%0A%09@Test%0D%0A%09public void testStoreMessage()%7B%0D%0A%09%09UserService userService = UserServiceImpl.getInstance();%0D%0A%09%09List%3CIMessage%3E messages = Lists.newArrayList();%0D%0A%09%09JsonMessage msg = new JsonMessage();%0D%0A%09%09JsonHeader header = new JsonHeader();%0D%0A%09%09header.setFrom(%22god%22);%0D%0A%09%09header.setTo(%22bigboy%22);%0D%0A%09%09msg.setHeader(header);%0D%0A%09%09msg.setBody(%22Hello, Boy%22);%0D%0A%09%09messages.add(msg);%0D%0A%09%09userService.store(messages);%0D%0A%09%7D%0D%0A%09%0D%0A%09@Test%0D%0A%09public void testFindMessage()%7B%0D%0A%09%09UserService userService = UserServiceImpl.getInstance();%0D%0A%09%09List%3CIMessage%3E messages = userService.find(%22god%22);%0D%0A%09%09System.out.println(messages.size());%0D%0A%09%7D%0D%0A%09%0D%0A%09%0D%0A%7D%0D%0A

add test case for user service.