Package org.wicketstuff.jamon.web

Examples of org.wicketstuff.jamon.web.PropertyModelObjectComparator



public class PropertyModelObjectComparatorTest {
    @Test
    public void shouldReturnZeroIfObjectsAreEqual() {
        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(true, "name");
        assertEquals(0, ascComparator.compare(new PropertyModelObject("ben"), new PropertyModelObject("ben")));

        PropertyModelObjectComparator descComparator = new PropertyModelObjectComparator(false, "name");
        assertEquals(0, descComparator.compare(new PropertyModelObject("ben"), new PropertyModelObject("ben")));
    }
View Full Code Here


        assertEquals(0, descComparator.compare(new PropertyModelObject("ben"), new PropertyModelObject("ben")));
    }
   
    @Test
    public void shouldReturnNegativeIfObject1IsConsideredLessThanObject2AndSortOrderIsAscending() {
        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(true, "name");
        assertEquals(-1, ascComparator.compare(new PropertyModelObject("ben1"), new PropertyModelObject("ben2")));
    }
View Full Code Here

        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(true, "name");
        assertEquals(-1, ascComparator.compare(new PropertyModelObject("ben1"), new PropertyModelObject("ben2")));
    }
    @Test
    public void shouldReturnPositiveIfObject1IsConsideredLessThanObject2AndSortOrderIsDescending() {
        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(false, "name");
        assertEquals(1, ascComparator.compare(new PropertyModelObject("ben1"), new PropertyModelObject("ben2")));
    }
View Full Code Here

        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(false, "name");
        assertEquals(1, ascComparator.compare(new PropertyModelObject("ben1"), new PropertyModelObject("ben2")));
    }
    @Test
    public void shouldReturnPositiveIfObject1IsConsideredMoreThanObject2AndSortOrderIsAscending() {
        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(true, "name");
        assertEquals(1, ascComparator.compare(new PropertyModelObject("ben2"), new PropertyModelObject("ben1")));
    }
View Full Code Here

        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(true, "name");
        assertEquals(1, ascComparator.compare(new PropertyModelObject("ben2"), new PropertyModelObject("ben1")));
    }
    @Test
    public void shouldReturnNegativeIfObject1IsConsideredMoreThanObject2AndSortOrderIsDescending() {
        PropertyModelObjectComparator ascComparator = new PropertyModelObjectComparator(false, "name");
        assertEquals(-1, ascComparator.compare(new PropertyModelObject("ben2"), new PropertyModelObject("ben1")));
    }
View Full Code Here

TOP

Related Classes of org.wicketstuff.jamon.web.PropertyModelObjectComparator

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.