Package org.apache.cayenne.exp

Examples of org.apache.cayenne.exp.Expression.match()


        assertTrue(notLike.match(noMatch));

        Artist match1 = new Artist();
        match1.setArtistName("abc123d");
        assertTrue("Failed: " + like, like.match(match1));
        assertFalse("Failed: " + notLike, notLike.match(match1));

        Artist match2 = new Artist();
        match2.setArtistName("abcd");
        assertTrue("Failed: " + like, like.match(match2));
        assertFalse("Failed: " + notLike, notLike.match(match2));
View Full Code Here


        assertFalse("Failed: " + notLike, notLike.match(match1));

        Artist match2 = new Artist();
        match2.setArtistName("abcd");
        assertTrue("Failed: " + like, like.match(match2));
        assertFalse("Failed: " + notLike, notLike.match(match2));
    }

    public void testEvaluateLIKE2() throws Exception {
        Expression like = new ASTLike(new ASTObjPath("artistName"), "abc?d");
        Expression notLike = new ASTNotLike(new ASTObjPath("artistName"), "abc?d");
View Full Code Here

        Expression notLike = new ASTNotLike(new ASTObjPath("artistName"), "abc?d");

        Artist noMatch1 = new Artist();
        noMatch1.setArtistName("dabc");
        assertFalse(like.match(noMatch1));
        assertTrue(notLike.match(noMatch1));

        Artist noMatch2 = new Artist();
        noMatch2.setArtistName("abc123d");
        assertFalse("Failed: " + like, like.match(noMatch2));
        assertTrue("Failed: " + notLike, notLike.match(noMatch2));
View Full Code Here

        assertTrue(notLike.match(noMatch1));

        Artist noMatch2 = new Artist();
        noMatch2.setArtistName("abc123d");
        assertFalse("Failed: " + like, like.match(noMatch2));
        assertTrue("Failed: " + notLike, notLike.match(noMatch2));

        Artist match = new Artist();
        match.setArtistName("abcXd");
        assertTrue("Failed: " + like, like.match(match));
        assertFalse("Failed: " + notLike, notLike.match(match));
View Full Code Here

        assertTrue("Failed: " + notLike, notLike.match(noMatch2));

        Artist match = new Artist();
        match.setArtistName("abcXd");
        assertTrue("Failed: " + like, like.match(match));
        assertFalse("Failed: " + notLike, notLike.match(match));
    }

    public void testEvaluateLIKE3() throws Exception {
        // test special chars
        Expression like = new ASTLike(new ASTObjPath("artistName"), "/./");
View Full Code Here

        // test special chars
        Expression like = new ASTLike(new ASTObjPath("artistName"), "/./");

        Artist noMatch1 = new Artist();
        noMatch1.setArtistName("/a/");
        assertFalse(like.match(noMatch1));

        Artist match = new Artist();
        match.setArtistName("/./");
        assertTrue("Failed: " + like, like.match(match));
    }
View Full Code Here

        noMatch1.setArtistName("/a/");
        assertFalse(like.match(noMatch1));

        Artist match = new Artist();
        match.setArtistName("/./");
        assertTrue("Failed: " + like, like.match(match));
    }

    public void testEvaluateLIKE_IGNORE_CASE() throws Exception {
        Expression like = new ASTLikeIgnoreCase(new ASTObjPath("artistName"), "aBcD");
        Expression notLike = new ASTNotLikeIgnoreCase(new ASTObjPath("artistName"), "aBcD");
View Full Code Here

        Expression notLike = new ASTNotLikeIgnoreCase(new ASTObjPath("artistName"), "aBcD");

        Artist noMatch1 = new Artist();
        noMatch1.setArtistName("dabc");
        assertFalse(like.match(noMatch1));
        assertTrue(notLike.match(noMatch1));

        Artist match1 = new Artist();
        match1.setArtistName("abcd");
        assertTrue("Failed: " + like, like.match(match1));
        assertFalse("Failed: " + notLike, notLike.match(match1));
View Full Code Here

        assertTrue(notLike.match(noMatch1));

        Artist match1 = new Artist();
        match1.setArtistName("abcd");
        assertTrue("Failed: " + like, like.match(match1));
        assertFalse("Failed: " + notLike, notLike.match(match1));

        Artist match2 = new Artist();
        match2.setArtistName("ABcD");
        assertTrue("Failed: " + like, like.match(match2));
        assertFalse("Failed: " + notLike, notLike.match(match2));
View Full Code Here

        assertFalse("Failed: " + notLike, notLike.match(match1));

        Artist match2 = new Artist();
        match2.setArtistName("ABcD");
        assertTrue("Failed: " + like, like.match(match2));
        assertFalse("Failed: " + notLike, notLike.match(match2));
    }

    public void testEvaluateADD() throws Exception {
        Expression add = new ASTAdd(new Object[] { new Integer(1), new Double(5.5) });
        assertEquals(6.5, ((Number) add.evaluate(null)).doubleValue(), 0.0001);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.