Package org.apache.cayenne.exp

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


        assertFalse(notEqualTo.match(match));

        Artist noMatch = new Artist();
        noMatch.setArtistName("123");
        assertFalse("Failed: " + equalTo, equalTo.match(noMatch));
        assertTrue("Failed: " + notEqualTo, notEqualTo.match(noMatch));
    }

    public void testEvaluateEQUAL_TONull() throws Exception {
        Expression equalTo = new ASTEqual(new ASTObjPath("artistName"), null);
View Full Code Here


    public void testEvaluateEQUAL_TONull() throws Exception {
        Expression equalTo = new ASTEqual(new ASTObjPath("artistName"), null);

        Artist match = new Artist();
        assertTrue(equalTo.match(match));

        Artist noMatch = new Artist();
        noMatch.setArtistName("123");
        assertFalse("Failed: " + equalTo, equalTo.match(noMatch));
    }
View Full Code Here

        Artist match = new Artist();
        assertTrue(equalTo.match(match));

        Artist noMatch = new Artist();
        noMatch.setArtistName("123");
        assertFalse("Failed: " + equalTo, equalTo.match(noMatch));
    }

    public void testEvaluateNOT_EQUAL_TONull() throws Exception {
        Expression equalTo = new ASTNotEqual(new ASTObjPath("artistName"), null);
View Full Code Here

    public void testEvaluateNOT_EQUAL_TONull() throws Exception {
        Expression equalTo = new ASTNotEqual(new ASTObjPath("artistName"), null);

        Artist match = new Artist();
        assertFalse(equalTo.match(match));

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

        Artist match = new Artist();
        assertFalse(equalTo.match(match));

        Artist noMatch = new Artist();
        noMatch.setArtistName("123");
        assertTrue("Failed: " + equalTo, equalTo.match(noMatch));
    }

    public void testEvaluateEQUAL_TODataObject() throws Exception {
        DataContext context = createDataContext();
        Artist a1 = (Artist) context.newObject("Artist");
View Full Code Here

        p1.setToArtist(a1);
        p2.setToArtist(a2);

        Expression e = new ASTEqual(new ASTObjPath("toArtist"), a1);

        assertTrue(e.match(p1));
        assertFalse(e.match(p2));
        assertFalse(e.match(p3));
    }

    public void testEvaluateAND() throws Exception {
View Full Code Here

        p2.setToArtist(a2);

        Expression e = new ASTEqual(new ASTObjPath("toArtist"), a1);

        assertTrue(e.match(p1));
        assertFalse(e.match(p2));
        assertFalse(e.match(p3));
    }

    public void testEvaluateAND() throws Exception {
        Expression e1 = new ASTEqual(new ASTObjPath("artistName"), "abc");
View Full Code Here

        Expression e = new ASTEqual(new ASTObjPath("toArtist"), a1);

        assertTrue(e.match(p1));
        assertFalse(e.match(p2));
        assertFalse(e.match(p3));
    }

    public void testEvaluateAND() throws Exception {
        Expression e1 = new ASTEqual(new ASTObjPath("artistName"), "abc");
        Expression e2 = new ASTEqual(new ASTObjPath("artistName"), "abc");
View Full Code Here

                new ASTObjPath("estimatedPrice"),
                new BigDecimal(10000d));

        Painting noMatch = new Painting();
        noMatch.setEstimatedPrice(new BigDecimal(10001));
        assertFalse("Failed: " + e, e.match(noMatch));

        Painting noMatch1 = new Painting();
        noMatch1.setEstimatedPrice(new BigDecimal(10000));
        assertFalse("Failed: " + e, e.match(noMatch1));
View Full Code Here

        noMatch.setEstimatedPrice(new BigDecimal(10001));
        assertFalse("Failed: " + e, e.match(noMatch));

        Painting noMatch1 = new Painting();
        noMatch1.setEstimatedPrice(new BigDecimal(10000));
        assertFalse("Failed: " + e, e.match(noMatch1));

        Painting match = new Painting();
        match.setEstimatedPrice(new BigDecimal(9999));
        assertTrue("Failed: " + e, e.match(match));
    }
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.