Examples of UnitTestClosure


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

        ClientMtTable2 o2 = context.newObject(ClientMtTable2.class);
        o2.setTable1(o1);
        o2.setTable1(null);

        DataChannelSyncStats stats = clientServerInterceptor
                .runWithSyncStatsCollection(new UnitTestClosure() {

                    public void execute() {
                        context.commitChanges();
                    }
                });
View Full Code Here

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

        final NamedQuery q1 = new NamedQuery("MtQueryWithLocalCache");

        final List<?> result1 = context.performQuery(q1);
        assertEquals(3, result1.size());

        clientServerInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                List<?> result2 = context.performQuery(q1);
                assertSame(result1, result2);
            }
View Full Code Here

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

                Collections.singletonMap("g", "g2"));

        final List<?> result1 = context.performQuery(q1);
        assertEquals(1, result1.size());

        clientServerInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                List<?> result2 = context.performQuery(q1);
                assertSame(result1, result2);
            }
        });

        final List<?> result3 = context.performQuery(q2);
        assertNotSame(result1, result3);
        assertEquals(1, result3.size());

        clientServerInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                List<?> result4 = context.performQuery(q2);
                assertSame(result3, result4);
View Full Code Here

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

        EJBQLQuery query = new EJBQLQuery(ejbql);

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

        queryBlocker.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

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

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

        EJBQLQuery query = new EJBQLQuery(ejbql);

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

        queryBlocker.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                assertEquals(1, objects.size());
View Full Code Here

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

        ClientMtTable1 o1 = context.newObject(ClientMtTable1.class);
        o1.setGlobalAttribute1("v1");
        context.deleteObject(o1);

        DataChannelSyncStats stats = clientServerInterceptor
                .runWithSyncStatsCollection(new UnitTestClosure() {

                    public void execute() {
                        context.commitChanges();
                    }
                });
View Full Code Here

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

        runtime.getDataDomain().setMaxIdQualifierSize(10);
       
        final SelectQuery query = new SelectQuery(Artist.class);
        query.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY).setSemantics(PrefetchTreeNode.DISJOINT_BY_ID_PREFETCH_SEMANTICS);

        int queriesCount = queryInterceptor.runWithQueryCounter(new UnitTestClosure() {

            public void execute() {
                context.performQuery(query);
            }
        });
View Full Code Here

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

        runtime.getDataDomain().setMaxIdQualifierSize(0);

        final SelectQuery query = new SelectQuery(Artist.class);
        query.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY).setSemantics(PrefetchTreeNode.DISJOINT_BY_ID_PREFETCH_SEMANTICS);

        int queriesCount = queryInterceptor.runWithQueryCounter(new UnitTestClosure() {

            public void execute() {
                context.performQuery(query);
            }
        });
View Full Code Here

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

        runtime.getDataDomain().setMaxIdQualifierSize(-1);

        final SelectQuery query = new SelectQuery(Artist.class);
        query.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY).setSemantics(PrefetchTreeNode.DISJOINT_BY_ID_PREFETCH_SEMANTICS);

        int queriesCount = queryInterceptor.runWithQueryCounter(new UnitTestClosure() {

            public void execute() {
                context.performQuery(query);
            }
        });
View Full Code Here

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

        runtime.getDataDomain().setMaxIdQualifierSize(5);

        final SelectQuery query = new SelectQuery(Painting.class);
        query.setPageSize(10);
        int queriesCount = queryInterceptor.runWithQueryCounter(new UnitTestClosure() {

            public void execute() {
                final List<Painting> boxes = context.performQuery(query);
                for (Painting box : boxes) {
                    box.getToArtist();
                }
            }
        });

        assertEquals(21, queriesCount);

        queriesCount = queryInterceptor.runWithQueryCounter(new UnitTestClosure() {

            public void execute() {
                final List<Painting> boxes = context.performQuery(query);
                List<Painting> tempList = new ArrayList<Painting>();
                tempList.addAll(boxes);
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.