Search in sources :

Example 6 with OrderBy

use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams.OrderBy in project openolat by klemens.

the class RepositoryEntryAuthorQueriesTest method searchViews_orderBy.

@Test
public void searchViews_orderBy() {
    Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("view-");
    dbInstance.commit();
    Roles roles = securityManager.getRoles(id);
    SearchAuthorRepositoryEntryViewParams params = new SearchAuthorRepositoryEntryViewParams(id, roles);
    params.setMarked(Boolean.TRUE);
    for (OrderBy orderBy : OrderBy.values()) {
        params.setOrderBy(orderBy);
        params.setOrderByAsc(true);
        List<RepositoryEntryAuthorView> viewAsc = repositoryEntryAuthorViewQueries.searchViews(params, 0, 10);
        Assert.assertNotNull(viewAsc);
        params.setOrderByAsc(false);
        List<RepositoryEntryAuthorView> viewDesc = repositoryEntryAuthorViewQueries.searchViews(params, 0, 10);
        Assert.assertNotNull(viewDesc);
    }
}
Also used : OrderBy(org.olat.repository.model.SearchAuthorRepositoryEntryViewParams.OrderBy) RepositoryEntryAuthorView(org.olat.repository.RepositoryEntryAuthorView) Roles(org.olat.core.id.Roles) Identity(org.olat.core.id.Identity) SearchAuthorRepositoryEntryViewParams(org.olat.repository.model.SearchAuthorRepositoryEntryViewParams) Test(org.junit.Test)

Aggregations

OrderBy (org.olat.repository.model.SearchAuthorRepositoryEntryViewParams.OrderBy)6 RepositoryEntryAuthorView (org.olat.repository.RepositoryEntryAuthorView)4 Test (org.junit.Test)2 DefaultResultInfos (org.olat.core.commons.persistence.DefaultResultInfos)2 Identity (org.olat.core.id.Identity)2 Roles (org.olat.core.id.Roles)2 SearchAuthorRepositoryEntryViewParams (org.olat.repository.model.SearchAuthorRepositoryEntryViewParams)2