@@ -0,0 +1,1628 @@
+package edu.cmu.sv.ws.ssnoc.test;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.sql.Timestamp;%0A%0Aimport javax.ws.rs.core.Response;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport edu.cmu.sv.ws.ssnoc.dto.Message;%0Aimport edu.cmu.sv.ws.ssnoc.dto.User;%0Aimport edu.cmu.sv.ws.ssnoc.rest.MessageService;%0Aimport edu.cmu.sv.ws.ssnoc.rest.UserGroupsService;%0Aimport edu.cmu.sv.ws.ssnoc.rest.UserService;%0A%0Apublic class SocialNetworkAnalysisTest %7B%0A%0A%09@Before%0A%09public void tearDown() throws Exception %7B%0A%09%7D%0A%0A%09@Test%0A%09public void test01_checkUserCount() %7B%0A%09%09// Add multiple users%0A%09%09for (int i = 0; i %3C 5; i++) %7B%0A%09%09%09User user = new User();%0A%09%09%09user.setUserName(%22user%22 + i);%0A%09%09%09user.setPassword(%221234%22);%0A%0A%09%09%09UserService userService = new UserService();%0A%09%09%09userService.addUser(user);%0A%09%09%7D%0A%09%09%0A%09%09assertEquals(5, userClusters.size());%0A%09%7D%0A%09%0A%0A%09@Test%0A%09public void test02_checkCloseUser()%7B%0A%09%09Time time = new Time();%0A%0A%09%09// send messages from user1 to user3 and user5%0A%09%0A%0A%09%09// send messages from user5 to user3%0A%0A%09%09// check user1 is close to user2 and user4%0A%09%09// Check user3 is close to user2 and user4 as well%0A%09%09// Check user5 is close to user2 and user4 as well%0A%09%09// Check user2 is close to user4%0A%0A%09%09// check user1 is NOT close to user3 and user5%0A%09%09// check user5 is NOT close to user3%0A%0A%09%09// Response response = UserGroupsService.add(%22foo%22, msg);%0A%09%09// assertEquals(1, userClusters.size());%0A%09%09//%0A%09%09// MessageService msgService = new MessageService();%0A%09%09// Response response = msgService.addWallMessage(%22foo%22, msg);%0A%09%09// assertEquals(((Message)response.getEntity()).getContent(),%0A%09%09// %22test test lloyd owes a me a beer%22);%0A%09%7D%0A%0A%7D%0A

Add test case for Social Network Analysis