Package org.apache.art

Examples of org.apache.art.Painting.readPropertyDirectly()


        // 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


        try {
            assertEquals(4, results.size());

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

            assertEquals(DataObjectUtils.intPKForObject(p2), DataObjectUtils
                    .intPKForObject(pi2));

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

            // there was a bug marking an object as dirty when clearing the relationships
            assertEquals(PersistenceState.COMMITTED, p4.getPersistenceState());
        }
        finally {
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

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.