Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.ResourceSortCriterion


     */
    @Test
    public void testGetSortByDateAdded()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.DATE_ADDED, SortDirection.ASCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("dateAdded", sort.getSort()[0].getField());
View Full Code Here


     */
    @Test
    public void testGetSortByDateAddedDescending()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.DATE_ADDED, SortDirection.DESCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("dateAdded", sort.getSort()[0].getField());
View Full Code Here

     */
    @Test
    public void testGetSortByFollowersCount()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.FOLLOWERS_COUNT, SortDirection.ASCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("followersCount", sort.getSort()[0].getField());
View Full Code Here

     */
    @Test
    public void testGetSortByFollowersCountDescending()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.FOLLOWERS_COUNT, SortDirection.DESCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("followersCount", sort.getSort()[0].getField());
View Full Code Here

     */
    @Test
    public void testGetSortByName()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.NAME, SortDirection.ASCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("byName", sort.getSort()[0].getField());
View Full Code Here

     */
    @Test
    public void testGetSortByNameDescending()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.NAME, SortDirection.DESCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("byName", sort.getSort()[0].getField());
View Full Code Here

     */
    @Test
    public void testGetSortByUpdatesCount()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.UPDATES_COUNT, SortDirection.ASCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("updatesCount", sort.getSort()[0].getField());
View Full Code Here

     */
    @Test
    public void testGetSortByUpdatesCountDescending()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.UPDATES_COUNT, SortDirection.DESCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
        assertEquals("updatesCount", sort.getSort()[0].getField());
View Full Code Here

     */
    @Test
    public void testGetSortByNameAscendingAndUpdatesDescending()
    {
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.NAME, SortDirection.ASCENDING));
        sortCrit.add(new ResourceSortCriterion(SortField.UPDATES_COUNT, SortDirection.DESCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        Sort sort = sut.getSort(criteria);
        assertEquals(2, sort.getSort().length);

View Full Code Here

    @Test
    public void testGetSortByFollowersCountDescendingFromOverride()
    {
        // setup the override as followersCount, descending
        List<ResourceSortCriterion> overridingSortCrit = new ArrayList<ResourceSortCriterion>();
        overridingSortCrit.add(new ResourceSortCriterion(SortField.FOLLOWERS_COUNT, SortDirection.DESCENDING));
        sut.setOverridingSortCriteria(new ResourceSortCriteria(overridingSortCrit));

        // now try different input criteria - name
        List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
        sortCrit.add(new ResourceSortCriterion(SortField.NAME, SortDirection.ASCENDING));
        ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);

        // sort should come back as followers count, descending, ignoring the input criteria
        Sort sort = sut.getSort(criteria);
        assertEquals(1, sort.getSort().length);
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.ResourceSortCriterion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.