Package org.apache.cayenne.unit.di

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


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

        final ClientMtTable1 childHollow = (ClientMtTable1) objects.get(3);
        child.invalidateObjects(childHollow);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

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

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


        // }
        // catch (CayenneRuntimeException e) {
        // // expected
        // }

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                Persistent hollowPeer = peerContext.localObject(
                        hollow.getObjectId(),
View Full Code Here

        peerModified.setArtistName("M2");

        assertEquals(PersistenceState.MODIFIED, modified.getPersistenceState());
        assertEquals(PersistenceState.MODIFIED, peerModified.getPersistenceState());

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {

                Persistent peerModified2 = peerContext.localObject(
                        modified.getObjectId(),
View Full Code Here

        // resolve Employees
        context1.performQuery(new SelectQuery(Employee.class));

        final DeepMergeOperation op = new DeepMergeOperation(context1);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Department d2 = (Department) op.merge(d1, d);
                assertNotNull(d2);
                assertEquals(PersistenceState.COMMITTED, d2.getPersistenceState());
View Full Code Here

        // need to make sure source relationship is resolved as a result of some Ashwood
        // strangeness...
        d1.getEmployees().size();
        final DeepMergeOperation op = new DeepMergeOperation(context1);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Department d2 = (Department) op.merge(d1, d);
                assertNotNull(d2);
                assertEquals(PersistenceState.COMMITTED, d2.getPersistenceState());
View Full Code Here

        a.setArtistName("AAA");
        context.commitChanges();

        final DeepMergeOperation op = new DeepMergeOperation(context1);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Artist a2 = (Artist) op.merge(a, d);
                assertNotNull(a2);
                assertEquals(PersistenceState.COMMITTED, a2.getPersistenceState());
View Full Code Here

        final Artist a1 = (Artist) Cayenne.objectForPK(context1, a.getObjectId());
        a1.setArtistName("BBB");
        final DeepMergeOperation op = new DeepMergeOperation(context1);

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                Artist a2 = (Artist) op.merge(a, d);
                assertNotNull(a2);
                assertEquals(PersistenceState.MODIFIED, a2.getPersistenceState());
View Full Code Here

        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(2, objects.size());

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

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

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

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

                // row should contain columns from both entities minus those duplicated in a
View Full Code Here

                prefetch.getSemantics());
        q.setFetchingDataRows(false);

        final List<?> objects = context.performQuery(q);
       
        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
           
            public void execute() {
             // without OUTER join we will get fewer objects...
                assertEquals(2, objects.size());
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.