Package org.apache.cayenne.testdo.testmap

Examples of org.apache.cayenne.testdo.testmap.Painting.readPropertyDirectly()


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

                // testing non-null to-one target
                Painting p0 = results.get(0);
                Object o2 = p0.readPropertyDirectly(Painting.TO_PAINTING_INFO_PROPERTY);
                assertTrue(o2 instanceof PaintingInfo);
                PaintingInfo pi2 = (PaintingInfo) o2;
                assertEquals(PersistenceState.COMMITTED, pi2.getPersistenceState());
                assertEquals(Cayenne.intPKForObject(p0), Cayenne.intPKForObject(pi2));
View Full Code Here


                assertEquals(PersistenceState.COMMITTED, pi2.getPersistenceState());
                assertEquals(Cayenne.intPKForObject(p0), Cayenne.intPKForObject(pi2));

                // testing null to-one target
                Painting p1 = results.get(1);
                assertNull(p1.readPropertyDirectly(Painting.TO_PAINTING_INFO_PROPERTY));

                // there was a bug marking an object as dirty when clearing the
                // relationships
                assertEquals(PersistenceState.COMMITTED, p1.getPersistenceState());
            }
View Full Code Here

        // make sure toOne relationships from Paintings
        // are resolved...
        altPainting1.getToArtist();
        altPainting2.getToArtist();
        assertSame(altArtist, altPainting1.readPropertyDirectly("toArtist"));
        assertSame(altArtist, altPainting2.readPropertyDirectly("toArtist"));

        // delete painting
        context.deleteObject(painting1);
        context.commitChanges();
View Full Code Here

        ctxt.commitChanges();
       
        ctxt = createDataContext();
        Painting painting = fetchPainting();

        assertTrue(painting.readPropertyDirectly("toPaintingInfo") instanceof Fault);

        // test that taking a snapshot does not trigger a fault, and generally works well
        Map snapshot = ctxt.currentSnapshot(painting);

        assertEquals(paintingName, snapshot.get("PAINTING_TITLE"));
View Full Code Here

        // test that taking a snapshot does not trigger a fault, and generally works well
        Map snapshot = ctxt.currentSnapshot(painting);

        assertEquals(paintingName, snapshot.get("PAINTING_TITLE"));
        assertTrue(painting.readPropertyDirectly("toPaintingInfo") instanceof Fault);
    }

}
View Full Code Here

        // make sure toOne relationships from Paintings
        // are resolved...
        altPainting1.getToArtist();
        altPainting2.getToArtist();
        assertSame(altArtist, altPainting1.readPropertyDirectly("toArtist"));
        assertSame(altArtist, altPainting2.readPropertyDirectly("toArtist"));

        // delete painting
        context.deleteObjects(painting1);
        context.commitChanges();
View Full Code Here

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

                // testing non-null to-one target
                Painting p0 = results.get(0);
                Object o2 = p0.readPropertyDirectly(Painting.TO_PAINTING_INFO_PROPERTY);
                assertTrue(o2 instanceof PaintingInfo);
                PaintingInfo pi2 = (PaintingInfo) o2;
                assertEquals(PersistenceState.COMMITTED, pi2.getPersistenceState());
                assertEquals(Cayenne.intPKForObject(p0), Cayenne.intPKForObject(pi2));
View Full Code Here

                assertEquals(PersistenceState.COMMITTED, pi2.getPersistenceState());
                assertEquals(Cayenne.intPKForObject(p0), Cayenne.intPKForObject(pi2));

                // testing null to-one target
                Painting p1 = results.get(1);
                assertNull(p1.readPropertyDirectly(Painting.TO_PAINTING_INFO_PROPERTY));

                // there was a bug marking an object as dirty when clearing the
                // relationships
                assertEquals(PersistenceState.COMMITTED, p1.getPersistenceState());
            }
View Full Code Here

        // make sure toOne relationships from Paintings
        // are resolved...
        altPainting1.getToArtist();
        altPainting2.getToArtist();
        assertSame(altArtist, altPainting1.readPropertyDirectly("toArtist"));
        assertSame(altArtist, altPainting2.readPropertyDirectly("toArtist"));

        // delete painting
        context.deleteObjects(painting1);
        context.commitChanges();
View Full Code Here

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

                // testing non-null to-one target
                Painting p0 = results.get(0);
                Object o2 = p0.readPropertyDirectly(Painting.TO_PAINTING_INFO_PROPERTY);
                assertTrue(o2 instanceof PaintingInfo);
                PaintingInfo pi2 = (PaintingInfo) o2;
                assertEquals(PersistenceState.COMMITTED, pi2.getPersistenceState());
                assertEquals(Cayenne.intPKForObject(p0), Cayenne.intPKForObject(pi2));
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.