Search in sources :

Example 11 with UserActionList

use of org.opencastproject.usertracking.api.UserActionList in project opencast by opencast.

the class UserTrackingServiceImplTest method verifyUserActionListsByTypeAndMediapackage.

/**
 * Gets the user action list based on type and mediapackage, performs some asserts
 * @throws Exception
 */
private void verifyUserActionListsByTypeAndMediapackage(String type, String mp, int count, int offset, int limit, int total) {
    UserActionList ual = service.getUserActionsByTypeAndMediapackageId(type, mp, offset, limit);
    Assert.assertEquals(limit, ual.getLimit());
    Assert.assertEquals(offset, ual.getOffset());
    Assert.assertEquals(total, ual.getTotal());
    Assert.assertEquals(count, ual.getUserActions().size());
    // This method does the same thing, except it orders by creation date.
    ual = service.getUserActionsByTypeAndMediapackageIdByDate(type, mp, offset, limit);
    Assert.assertEquals(limit, ual.getLimit());
    Assert.assertEquals(offset, ual.getOffset());
    Assert.assertEquals(total, ual.getTotal());
    Assert.assertEquals(count, ual.getUserActions().size());
    // This method does the same thing, except it orders by the reverse of the creation date.
    ual = service.getUserActionsByTypeAndMediapackageIdByDescendingDate(type, mp, offset, limit);
    Assert.assertEquals(limit, ual.getLimit());
    Assert.assertEquals(offset, ual.getOffset());
    Assert.assertEquals(total, ual.getTotal());
    Assert.assertEquals(count, ual.getUserActions().size());
}
Also used : UserActionList(org.opencastproject.usertracking.api.UserActionList)

Example 12 with UserActionList

use of org.opencastproject.usertracking.api.UserActionList in project opencast by opencast.

the class UserTrackingServiceImplTest method verifyUserActionListsByDay.

/**
 * Gets the user action list based on date, performs some asserts
 * @throws Exception
 */
private void verifyUserActionListsByDay(String day, int count, int offset, int limit, int total) {
    UserActionList ual = service.getUserActionsByDay(day, offset, limit);
    Assert.assertEquals(limit, ual.getLimit());
    Assert.assertEquals(offset, ual.getOffset());
    Assert.assertEquals(total, ual.getTotal());
    Assert.assertEquals(count, ual.getUserActions().size());
}
Also used : UserActionList(org.opencastproject.usertracking.api.UserActionList)

Example 13 with UserActionList

use of org.opencastproject.usertracking.api.UserActionList in project opencast by opencast.

the class UserTrackingServiceImplTest method verifyUserActionLists.

/**
 * Gets the user action list, performs some asserts
 * @throws Exception
 */
private void verifyUserActionLists(int count, int offset, int limit, int total) {
    UserActionList ual = service.getUserActions(offset, limit);
    Assert.assertEquals(limit, ual.getLimit());
    Assert.assertEquals(offset, ual.getOffset());
    Assert.assertEquals(total, ual.getTotal());
    Assert.assertEquals(count, ual.getUserActions().size());
}
Also used : UserActionList(org.opencastproject.usertracking.api.UserActionList)

Example 14 with UserActionList

use of org.opencastproject.usertracking.api.UserActionList in project opencast by opencast.

the class UserTrackingServiceImplTest method verifyUserActionListsByTypeAndDay.

/**
 * Gets the user action list based on type and date, performs some asserts
 * @throws Exception
 */
private void verifyUserActionListsByTypeAndDay(String type, String day, int count, int offset, int limit, int total) {
    UserActionList ual = service.getUserActionsByTypeAndDay(type, day, offset, limit);
    Assert.assertEquals(limit, ual.getLimit());
    Assert.assertEquals(offset, ual.getOffset());
    Assert.assertEquals(total, ual.getTotal());
    Assert.assertEquals(count, ual.getUserActions().size());
}
Also used : UserActionList(org.opencastproject.usertracking.api.UserActionList)

Aggregations

UserActionList (org.opencastproject.usertracking.api.UserActionList)14 UserAction (org.opencastproject.usertracking.api.UserAction)9 EntityManager (javax.persistence.EntityManager)7 Query (javax.persistence.Query)7 Calendar (java.util.Calendar)2 GregorianCalendar (java.util.GregorianCalendar)2 Test (org.junit.Test)2 Footprint (org.opencastproject.usertracking.api.Footprint)2 UserSession (org.opencastproject.usertracking.api.UserSession)2 LinkedList (java.util.LinkedList)1