Package org.apache.cayenne.unit.di

Examples of org.apache.cayenne.unit.di.UnitTestClosure


        q.addPrefetch(Painting.TO_ARTIST_PROPERTY).setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        final List<?> objects = context.performQuery(q);
       
        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
           
            public void execute() {
                assertEquals(3, objects.size());

                Iterator<?> it = objects.iterator();
View Full Code Here


        assertEquals("java.util.Date", dateOfBirth.getType());
        dateOfBirth.setType("java.sql.Date");
        try {
            final List<?> objects = context.performQuery(q);
           
            queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
               
                public void execute() {
                    assertEquals(1, objects.size());

                    Iterator<?> it = objects.iterator();
View Full Code Here

        q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY).setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        final List<?> objects = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
           
            public void execute() {
                assertEquals(3, objects.size());

                Iterator<?> it = objects.iterator();
View Full Code Here

        q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY).setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        final List<?> objects = context.performQuery(q);
       
        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
           
            public void execute() {
                assertEquals(1, objects.size());

                Artist a = (Artist) objects.get(0);
View Full Code Here

                new ObjectId("Gallery", Gallery.GALLERY_ID_PK_COLUMN, 33001));
        assertNull(g1);

        final List<?> objects = context.performQuery(q);
       
        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
           
            public void execute() {
                assertEquals(3, objects.size());

                Iterator<?> it = objects.iterator();
View Full Code Here

        query.setPageSize(5);
        final List<?> objects = context.performQuery(query);
        assertNotNull(objects);
        assertTrue(objects instanceof IncrementalFaultList<?>);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertEquals(7, objects.size());
            }
        });
View Full Code Here

        // trigger object creation in the peer nested DC
        Cayenne.objectForPK(childContextPeer, Painting.class, 33001);
        childP1.setToArtist(null);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();
                assertEquals(PersistenceState.COMMITTED, childP1.getPersistenceState());
View Full Code Here

        final Artist childCommitted = (Artist) objects.get(1);

        final Artist childHollow = (Artist) objects.get(3);
        childContext.invalidateObjects(childHollow);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();

                // * all modified child objects must be in committed state now
View Full Code Here

        // ensure painting array is fully resolved...
        childModifiedToMany.getPaintingArray().size();
        childModifiedToMany.addToPaintingArray((Painting) objects.get(3));

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Painting parentModifiedSimple = null;
                Artist parentModifiedToMany = null;
View Full Code Here

        final PaintingInfo childDetail1 = childContext.newObject(PaintingInfo.class);
        childDetail1.setTextReview("Detail1");
        childDetail1.setPainting(childMaster);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                childContext.commitChangesToParent();

                assertEquals(PersistenceState.COMMITTED, childMaster
View Full Code Here

TOP

Related Classes of org.apache.cayenne.unit.di.UnitTestClosure

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.