/* public void testReceiveUpdatedLifeDrive() throws Exception { setUpAndStart(); protocol.resetEvents(); // receive push (necessary, because client doesn't request life drive at start up anymore) protocol.mockPushReceived(new APIEvent(APIEvent.TIMELINE_CHANGE)); // activities requested Assert.assertEquals("Protocol", new Event[] { new Event(Event.Context.TEST, MockCommunicationManager.SEND_REQUEST, ServerRequest.GET + ":" + ServerRequest.ACTIVITIES) }, protocol.getEvents()); // request timed out protocol.mockErrorReceived(ResponseListener.REQUEST_TIMED_OUT, ServiceObject.ACTIVITY); Assert.assertEquals("Protocol", new Event[] { new Event(Event.Context.TEST, MockCommunicationManager.SEND_REQUEST, ServerRequest.GET + ":" + ServerRequest.ACTIVITIES), new Event(Event.Context.TEST, MockCommunicationManager.SEND_REQUEST, ServerRequest.GET + ":" + ServerRequest.ACTIVITIES) }, protocol.getEvents()); // receive activities ServiceObject[] serviceObjects = new ServiceObject[4]; { Hashtable ht = new Hashtable(); Vector flags = new Vector(); flags.addElement("timeline"); Hashtable contact = new Hashtable(); contact.put("contactid", new Long(70001)); Vector contactList = new Vector(); contactList.addElement(contact); ht.put("activityid", new Long(301)); ht.put("flaglist", flags); ht.put("type", "contact_received_status_update"); ht.put("title", "Cup of tea"); ht.put("description", "Having a nice cuppa."); ht.put("time", new Long(123456)); ht.put("contactlist", contactList); serviceObjects[0] = new com.zyb.nowplus.data.protocol.types.Activity(ht); } { Hashtable ht = new Hashtable(); Vector flags = new Vector(); flags.addElement("timeline"); ht.put("activityid", new Long(302)); ht.put("flaglist", flags); ht.put("type", "contact_received_status_update"); ht.put("title", "Feet"); ht.put("description", "Putting my feet up."); ht.put("time", new Long(1234)); serviceObjects[1] = new com.zyb.nowplus.data.protocol.types.Activity(ht); } { Hashtable ht = new Hashtable(); Vector flags = new Vector(); flags.addElement("timeline"); ht.put("activityid", new Long(303)); ht.put("flaglist", flags); ht.put("type", "contact_received_status_update"); ht.put("title", "Pipe"); ht.put("description", "Lighting a pipe."); ht.put("time", new Long(12345)); serviceObjects[2] = new com.zyb.nowplus.data.protocol.types.Activity(ht); } { Hashtable ht = new Hashtable(); Vector flags = new Vector(); flags.addElement("timeline"); ht.put("activityid", new Long(304)); ht.put("flaglist", flags); ht.put("type", "contact_received_status_update"); ht.put("title", "No description"); ht.put("description", " "); ht.put("time", new Long(123456)); serviceObjects[3] = new com.zyb.nowplus.data.protocol.types.Activity(ht); } protocol.mockItemsReceived(serviceObjects, ServiceObject.ACTIVITY); // display life drive Assert.assertEquals("Listener", new Event[] { new Event(Event.Context.APP, Event.App.START, null), new Event(Event.Context.CONTACTS, Event.Contacts.REFRESH_LIST, null), new Event(Event.Context.APP, Event.App.READY, null), new Event(Event.Context.ACTIVITY, Event.Activities.LIFE_DRIVE_CHANGED, new Integer(3)), }, getEvents()); ListSelection ls = model.getLifeDrive(0, 20); Assert.assertEquals(3, ls.getTotal()); { Activity activity = (Activity) ls.getEntries()[0]; Assert.assertEquals(301, activity.getId()); Assert.assertEquals(Activity.TYPE_CONTACT_RECEIVED_STATUS_UPDATE, activity.getType()); Assert.assertEquals(model.getContacts(null, 20).getEntries(), activity.getInvolvedContacts()); Assert.assertEquals("Cup of tea", activity.getTitle()); Assert.assertEquals("Having a nice cuppa.", activity.getDescription()); Assert.assertEquals(123456000, activity.getTime()); } { Activity activity = (Activity) ls.getEntries()[1]; Assert.assertEquals(303, activity.getId()); } { Activity activity = (Activity) ls.getEntries()[2]; Assert.assertEquals(302, activity.getId()); } Assert.assertEquals(0, model.getFriendsStream(0, 20).getTotal()); model.exit(false); } */ public void tearDown() { model.detach(this); settingsStore = null; contactsStore = null; syncManager = null; contentSinkAndSource = null; protocol = null; emailProtocol = null; context = null; model = null; }