Package com.vaadin.data.util.filter

Examples of com.vaadin.data.util.filter.Between


    }

    @Test
    public void getWhereStringForFilter_between() {
        StatementHelper sh = mockedStatementHelper(18, 65);
        Between f = new Between("AGE", 18, 65);
        Assert.assertEquals("\"AGE\" BETWEEN ? AND ?",
                QueryBuilder.getWhereStringForFilter(f, sh));
        EasyMock.verify(sh);
    }
View Full Code Here


    }

    @Test
    public void passesFilter_valueIsInRange_shouldBeTrue() {
        Item item = itemWithPropertyValue("foo", 15);
        Between between = new Between("foo", 1, 30);
        Assert.assertTrue(between.passesFilter("foo", item));
    }
View Full Code Here

    }

    @Test
    public void passesFilter_valueIsOutOfRange_shouldBeFalse() {
        Item item = itemWithPropertyValue("foo", 15);
        Between between = new Between("foo", 0, 2);
        Assert.assertFalse(between.passesFilter("foo", item));
    }
View Full Code Here

    }

    @Test
    public void passesFilter_valueNotComparable_shouldBeFalse() {
        Item item = itemWithPropertyValue("foo", new Object());
        Between between = new Between("foo", 0, 2);
        Assert.assertFalse(between.passesFilter("foo", item));
    }
View Full Code Here

        Assert.assertFalse(between.passesFilter("foo", item));
    }

    @Test
    public void appliesToProperty_differentProperties_shoudlBeFalse() {
        Between between = new Between("foo", 0, 2);
        Assert.assertFalse(between.appliesToProperty("bar"));
    }
View Full Code Here

        Assert.assertFalse(between.appliesToProperty("bar"));
    }

    @Test
    public void appliesToProperty_sameProperties_shouldBeTrue() {
        Between between = new Between("foo", 0, 2);
        Assert.assertTrue(between.appliesToProperty("foo"));
    }
View Full Code Here

        Assert.assertTrue(between.appliesToProperty("foo"));
    }

    @Test
    public void hashCode_equalInstances_shouldBeEqual() {
        Between b1 = new Between("foo", 0, 2);
        Between b2 = new Between("foo", 0, 2);
        Assert.assertEquals(b1.hashCode(), b2.hashCode());
    }
View Full Code Here

        Assert.assertEquals(b1.hashCode(), b2.hashCode());
    }

    @Test
    public void equals_differentObjects_shouldBeFalse() {
        Between b1 = new Between("foo", 0, 2);
        Object obj = new Object();
        Assert.assertFalse(b1.equals(obj));
    }
View Full Code Here

        Assert.assertFalse(b1.equals(obj));
    }

    @Test
    public void equals_sameInstance_shouldBeTrue() {
        Between b1 = new Between("foo", 0, 2);
        Between b2 = b1;
        Assert.assertTrue(b1.equals(b2));
    }
View Full Code Here

        Assert.assertTrue(b1.equals(b2));
    }

    @Test
    public void equals_equalInstances_shouldBeTrue() {
        Between b1 = new Between("foo", 0, 2);
        Between b2 = new Between("foo", 0, 2);
        Assert.assertTrue(b1.equals(b2));
    }
View Full Code Here

TOP

Related Classes of com.vaadin.data.util.filter.Between

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.