Skip to content

Commit

Permalink
SAK-39995 Replace magic string "-presence' (sakaiproject#5597)
Browse files Browse the repository at this point in the history
... with PresenceService.PRESENCE_SUFFIX
  • Loading branch information
adrianfish authored May 14, 2018
1 parent 7a820ec commit b002a63
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1097,10 +1097,10 @@ public List<SimpleUser> getPresentUsers(String siteId, String channelId){
if (StringUtils.isNotBlank(siteId)) {

// refresh our presence at the location and retrieve the present users
String location = siteId + "-presence";
String location = siteId + PresenceService.PRESENCE_SUFFIX;
presenceService.setPresence(location);

for(UsageSession us : presenceService.getPresence(siteId + "-presence")){
for(UsageSession us : presenceService.getPresence(siteId + PresenceService.PRESENCE_SUFFIX)){
//check if still online in the heartbeat map
if (isOnline(channelId, us.getId())) {
TransferableChatMessage tcm = heartbeatMap.getIfPresent(channelId).getIfPresent(us.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ public Map<String,Object> handleLatestData(EntityReference ref, Map<String,Objec
if (siteId != null && siteId.length() > 0 && showSiteUsers) {
// A site id has been specified, so we refresh our presence at the
// location and retrieve the present users
String location = siteId + "-presence";
String location = siteId + PresenceService.PRESENCE_SUFFIX;
presenceService.setPresence(location);
List<User> presentSakaiUsers = presenceService.getPresentUsers(siteId + "-presence");
List<User> presentSakaiUsers = presenceService.getPresentUsers(siteId + PresenceService.PRESENCE_SUFFIX);
presentSakaiUsers.remove(currentUser);
for (User user : presentSakaiUsers) {
UserMessage heartbeat = heartbeatMap.get(user.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.sakaiproject.exception.PermissionException;
import org.sakaiproject.portal.api.Portal;
import org.sakaiproject.portal.api.PortalHandlerException;
import org.sakaiproject.presence.api.PresenceService;
import org.sakaiproject.site.api.Site;
import org.sakaiproject.site.cover.SiteService;
import org.sakaiproject.tool.api.ActiveTool;
Expand Down Expand Up @@ -125,7 +126,7 @@ public void doPresence(HttpServletRequest req, HttpServletResponse res,
// site's presence...
// Note: the placement is transient, but will always have the same id
// and context based on the siteId
Placement placement = new org.sakaiproject.util.Placement(siteId + "-presence",
Placement placement = new org.sakaiproject.util.Placement(siteId + PresenceService.PRESENCE_SUFFIX,
tool.getId(), tool, null, siteId, null);

portal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.sakaiproject.portal.api.StoredState;
import org.sakaiproject.portal.charon.site.AllSitesViewImpl;
import org.sakaiproject.portal.charon.site.PortalSiteHelperImpl;
import org.sakaiproject.presence.api.PresenceService;
import org.sakaiproject.tool.api.Tool;
import org.sakaiproject.tool.api.ToolSession;
import org.sakaiproject.tool.api.ToolManager;
Expand Down Expand Up @@ -562,7 +563,7 @@ public void doSite(HttpServletRequest req, HttpServletResponse res, Session sess
try{
boolean presenceEvents = ServerConfigurationService.getBoolean("presence.events.log", true);
if (presenceEvents)
org.sakaiproject.presence.cover.PresenceService.setPresence(siteId + "-presence");
org.sakaiproject.presence.cover.PresenceService.setPresence(siteId + PresenceService.PRESENCE_SUFFIX);
}catch(Exception e){}
//End - log the visit into SAKAI_EVENT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public interface PresenceService
/** This string starts the references to resources in this service. */
static final String REFERENCE_ROOT = "/presence";

/** This string gets appended to presence event references. */
static final String PRESENCE_SUFFIX = "-presence";

/** Name for the event of establishing presence at a location. */
static final String EVENT_PRESENCE = "pres.begin";

Expand Down
4 changes: 4 additions & 0 deletions sitestats/sitestats-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
<groupId>org.sakaiproject.edu-services.course-management</groupId>
<artifactId>coursemanagement-api</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.presence</groupId>
<artifactId>sakai-presence-api</artifactId>
</dependency>

<!-- Spring & Hibernate -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.sakaiproject.event.api.UsageSession;
import org.sakaiproject.event.api.UsageSessionService;
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.presence.api.PresenceService;
import org.sakaiproject.site.api.Site;
import org.sakaiproject.site.api.SiteService;
import org.sakaiproject.sitestats.api.EventStat;
Expand All @@ -78,8 +79,6 @@
*/
@Slf4j
public class StatsUpdateManagerImpl extends HibernateDaoSupport implements Runnable, StatsUpdateManager, Observer, StatsUpdateManagerMXBean {
private final static String PRESENCE_SUFFIX = "-presence";
private final static int PRESENCE_SUFFIX_LENGTH = PRESENCE_SUFFIX.length();

/** Spring bean members */
private boolean collectThreadEnabled = true;
Expand Down Expand Up @@ -1606,8 +1605,8 @@ private String parseSiteId(Event e){
|| StatsManager.SITEVISITEND_EVENTID.equals(eventId)){
// presence (site visit) syntax (/presence/SITE_ID-presence)
String[] parts = eventRef.split("/");
if(parts.length > 2 && parts[2].endsWith(PRESENCE_SUFFIX)) {
return parts[2].substring(0, parts[2].length() - PRESENCE_SUFFIX_LENGTH);
if(parts.length > 2 && parts[2].endsWith(PresenceService.PRESENCE_SUFFIX)) {
return parts[2].substring(0, parts[2].length() - PresenceService.PRESENCE_SUFFIX.length());
}

}else{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.sakaiproject.event.api.Event;
import org.sakaiproject.event.api.EventTrackingService;
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.presence.api.PresenceService;
import org.sakaiproject.site.api.Site;
import org.sakaiproject.site.api.SiteService;
import org.sakaiproject.sitestats.api.EventStat;
Expand Down Expand Up @@ -211,8 +212,8 @@ public void testInvalidEvents() {
@Test
public void testSiteVisits() {
// #1 Test: 2 site visit (different users)
Event eSV1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
Event eSV2 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_B_ID, "session-id-b");
Event eSV1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Event eSV2 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_B_ID, "session-id-b");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV1, eSV2)));
// #1: SST_EVENTS
List<EventStat> r1 = (List<EventStat>) db.getResultsForClass(EventStatImpl.class);
Expand Down Expand Up @@ -248,8 +249,8 @@ public void testSiteVisits() {

// #2 Test: 2 site visit (same users)
db.deleteAll();
eSV1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV2 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
eSV2 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV1, eSV2)));
// #2: SST_EVENTS
r1 = (List<EventStat>) db.getResultsForClass(EventStatImpl.class);
Expand Down Expand Up @@ -279,28 +280,28 @@ public void testSitePresenceSplitUpdates() {
// Start and end across collections.
{
List<Event> events = new ArrayList<>();
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/" + FakeData.SITE_A_ID + "-presence", null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/" + FakeData.SITE_A_ID + PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id"));
Assert.assertTrue(M_sum.collectEvents(events));
}
{
List<Event> events = new ArrayList<>();
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + "-presence", null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id"));
Assert.assertTrue(M_sum.collectEvents(events));
}

// Start and end in the same collection.
{
List<Event> events = new ArrayList<>();
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/" + FakeData.SITE_A_ID + "-presence", null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + "-presence", null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/" + FakeData.SITE_A_ID + PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id"));
Assert.assertTrue(M_sum.collectEvents(events));
}
// Multiple end events in the same collection.
{
List<Event> events = new ArrayList<>();
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/" + FakeData.SITE_A_ID + "-presence", null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + "-presence", null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + "-presence", null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/" + FakeData.SITE_A_ID + PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id"));
events.add(M_sum.buildEvent(new Date(), StatsManager.SITEVISITEND_EVENTID, "/presence/" + FakeData.SITE_A_ID + PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id"));
Assert.assertTrue(M_sum.collectEvents(events));
}
}
Expand Down Expand Up @@ -431,8 +432,8 @@ public void testSitePresences() {

// BEGIN SITE PRESENCE
Date now = new Date();
Event eSV1 = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
Event eSV2 = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_B_ID, "session-id-b");
Event eSV1 = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Event eSV2 = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_B_ID, "session-id-b");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV1, eSV2)));
// ... check SST_PRESENCES
List<SitePresence> r1 = (List<SitePresence>) db.getResultsForClass(SitePresenceImpl.class);
Expand All @@ -459,8 +460,8 @@ public void testSitePresences() {
Thread.sleep(minPresenceTime);
}catch(Exception e) {}
now = new Date();
Event eSV1e = M_sum.buildEvent(now, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
Event eSV2e = M_sum.buildEvent(now, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_B_ID, "session-id-b");
Event eSV1e = M_sum.buildEvent(now, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Event eSV2e = M_sum.buildEvent(now, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_B_ID, "session-id-b");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV1e, eSV2e)));
// ... check SST_PRESENCES
r1 = (List<SitePresence>) db.getResultsForClass(SitePresenceImpl.class);
Expand Down Expand Up @@ -488,7 +489,7 @@ public void testSitePresences() {

// BEGIN SITE PRESENCE
now = new Date();
eSV1 = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV1 = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV1)));
try{
// give it time before ending presence
Expand All @@ -497,7 +498,7 @@ public void testSitePresences() {
}catch(Exception e) {}
Date now2 = new Date();
long secondDuration = now2.getTime() - now.getTime();
eSV2 = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV2 = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV2)));
// ... check SST_PRESENCES
r1 = (List<SitePresence>) db.getResultsForClass(SitePresenceImpl.class);
Expand All @@ -512,7 +513,7 @@ public void testSitePresences() {

// END SITE PRESENCE
now = new Date();
eSV1e = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV1e = M_sum.buildEvent(now, StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV1e)));
try{
// give it time before ending presence
Expand All @@ -521,7 +522,7 @@ public void testSitePresences() {
}catch(Exception e) {}
now2 = new Date();
secondDuration = now2.getTime() - now.getTime();
eSV2e = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV2e = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV2e)));
// ... check SST_PRESENCES
r1 = (List<SitePresence>) db.getResultsForClass(SitePresenceImpl.class);
Expand Down Expand Up @@ -559,7 +560,7 @@ public void testSitePresences() {
}catch(Exception e) {}
now2 = new Date();
secondDuration = now2.getTime() - now.getTime();
eSV2e = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV2e = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV2e)));
r1 = (List<SitePresence>) db.getResultsForClass(SitePresenceImpl.class);
Assert.assertEquals(1, r1.size());
Expand Down Expand Up @@ -596,7 +597,7 @@ public void testSitePresences() {
}catch(Exception e) {}
now2 = new Date();
secondDuration = now2.getTime() - now.getTime();
eSV2e = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
eSV2e = M_sum.buildEvent(now2, StatsManager.SITEVISITEND_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
Assert.assertTrue(M_sum.collectEvents(Arrays.asList(eSV2e)));
r1 = (List<SitePresence>) db.getResultsForClass(SitePresenceImpl.class);
Assert.assertEquals(1, r1.size());
Expand Down Expand Up @@ -711,8 +712,8 @@ public void testConfigIsCollectAdminEvents() {
// #3: collect admin events
Assert.assertEquals(true, M_sum.isCollectAdminEvents());
// make sure it processes admin events
Event e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, "admin", "session-id-a");
Event e2 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
Event e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, "admin", "session-id-a");
Event e2 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
M_sum.collectEvents(Arrays.asList(e1, e2));
List<SiteVisits> results2 = (List<SiteVisits>) db.getResultsForClass(SiteVisitsImpl.class);
Assert.assertEquals(1, results2.size());
Expand All @@ -737,23 +738,23 @@ public void testConfigIsCollectEventsForSiteWithToolOnly() {
// make sure events get processed for sites with SiteStats only
M_sum.setCollectEventsForSiteWithToolOnly(true);
Assert.assertEquals(true, M_sum.isCollectEventsForSiteWithToolOnly());
Event e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
Event e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
M_sum.collectEvent(e1);
List<SiteVisits> results2 = (List<SiteVisits>) db.getResultsForClass(SiteVisitsImpl.class);
Assert.assertEquals(1, results2.size());
e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_B_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_B_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
M_sum.collectEvent(e1);
results2 = (List<SiteVisits>) db.getResultsForClass(SiteVisitsImpl.class);
Assert.assertEquals(1, results2.size());
// make sure events get processed for any sites
db.deleteAll();
M_sum.setCollectEventsForSiteWithToolOnly(false);
Assert.assertEquals(false, M_sum.isCollectEventsForSiteWithToolOnly());
e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_A_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
M_sum.collectEvent(e1);
results2 = (List<SiteVisits>) db.getResultsForClass(SiteVisitsImpl.class);
Assert.assertEquals(1, results2.size());
e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_B_ID+"-presence", null, FakeData.USER_A_ID, "session-id-a");
e1 = M_sum.buildEvent(new Date(), StatsManager.SITEVISIT_EVENTID, "/presence/"+FakeData.SITE_B_ID+PresenceService.PRESENCE_SUFFIX, null, FakeData.USER_A_ID, "session-id-a");
M_sum.collectEvent(e1);
results2 = (List<SiteVisits>) db.getResultsForClass(SiteVisitsImpl.class);
Assert.assertEquals(2, results2.size());
Expand Down

0 comments on commit b002a63

Please sign in to comment.