Package org.apache.cayenne.unit.di

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


        SelectQuery q = new SelectQuery("Artist", e.expWithParameters(params));
        q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);

        final List<Artist> artists = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                assertEquals(2, artists.size());
View Full Code Here


        SelectQuery q = new SelectQuery(Artist.class);
        q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);

        final List<Artist> artists = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                assertEquals(2, artists.size());
View Full Code Here

                PrefetchTreeNode.DISJOINT_PREFETCH_SEMANTICS);
        q.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);

        final List<Artist> artists = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertEquals(2, artists.size());

                Artist a1 = artists.get(0);
View Full Code Here

                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
        q.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);

        final List<Artist> artists = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                assertEquals(2, artists.size());
View Full Code Here

        try {
            SelectQuery q = new SelectQuery(Artist.class);
            q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);
            final List<Artist> result = context.performQuery(q);

            queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

                public void execute() {
                    assertFalse(result.isEmpty());
                    Artist a1 = result.get(0);
                    List<?> toMany = (List<?>) a1.readPropertyDirectly("paintingArray");
View Full Code Here

            q.setQualifier(ExpressionFactory.matchExp("artistName", "artist2"));
            q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);

            final List<Artist> result = context.performQuery(q);

            queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

                public void execute() {
                    assertFalse(result.isEmpty());
                    Artist a1 = result.get(0);
                    List<?> toMany = (List<?>) a1.readPropertyDirectly("paintingArray");
View Full Code Here

        SelectQuery q = new SelectQuery(Painting.class);
        q.addPrefetch(Painting.TO_ARTIST_PROPERTY);

        final List<Painting> result = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertFalse(result.isEmpty());
                Painting p1 = result.get(0);
View Full Code Here

        q.setQualifier(ExpressionFactory.matchExp("name", "child"));
        q.addPrefetch("toParentGroup");

        final List<ArtGroup> results = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertEquals(1, results.size());

                ArtGroup fetchedChild = results.get(0);
View Full Code Here

        SelectQuery q = new SelectQuery(Painting.class, exp);
        q.addPrefetch(Painting.TO_ARTIST_PROPERTY);

        final List<Painting> results = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertEquals(1, results.size());

                Painting painting = results.get(0);
View Full Code Here

        SelectQuery q = new SelectQuery(Painting.class, exp);
        q.addPrefetch("toArtist");

        final List<Painting> results = context.performQuery(q);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertEquals(1, results.size());

                // see that artists are resolved...
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.