Examples of readPropertyDirectly()


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

    public void testNewToMany() throws Exception {
        Artist artist = context.newObject(Artist.class);
        artist.setArtistName("test");
        assertTrue(artist.readPropertyDirectly("paintingArray") instanceof ToManyList);

        ToManyList list = (ToManyList) artist.readPropertyDirectly("paintingArray");
        assertFalse(list.isFault());

        context.commitChanges();

        assertFalse(list.isFault());
View Full Code Here

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

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

        context.invalidateObjects(Collections.singleton(o1));
        assertEquals(PersistenceState.HOLLOW, o1.getPersistenceState());
        assertNull(o1.readPropertyDirectly("artistName"));

        context.prepareForAccess(o1, null, false);
        assertEquals(PersistenceState.COMMITTED, o1.getPersistenceState());
        assertEquals("a", o1.readPropertyDirectly("artistName"));
    }
View Full Code Here

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

        assertEquals(PersistenceState.HOLLOW, o1.getPersistenceState());
        assertNull(o1.readPropertyDirectly("artistName"));

        context.prepareForAccess(o1, null, false);
        assertEquals(PersistenceState.COMMITTED, o1.getPersistenceState());
        assertEquals("a", o1.readPropertyDirectly("artistName"));
    }

    public void testResolveFaultFailure() {
        DataContext context = createDataContext();
View Full Code Here

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

        // needed
        ThreadedTestHelper helper = new ThreadedTestHelper() {

            @Override
            protected void assertResult() throws Exception {
                Object value = altArtist.readPropertyDirectly("paintingArray");
                assertTrue("Unexpected: " + value, value instanceof ToManyList);
                assertTrue(((ToManyList) value).isFault());
            }
        };
        helper.assertWithTimeout(2000);
View Full Code Here

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

        assertNull("CDO serialized by itself shouldn't have a DataContext: "
                + deserialized.getObjectContext(), deserialized.getObjectContext());

        // test that to-many relationships are initialized
        assertTrue(deserialized.readPropertyDirectly("paintingArray") instanceof ToManyList);
        ToManyList list = (ToManyList) artist.readPropertyDirectly("paintingArray");
        assertFalse(list.isFault());
    }

    public void testSerializeCommitted() throws Exception {
View Full Code Here

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

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertFalse(result.isEmpty());
                Artist b1 = result.get(0);
                List<Painting> toMany = (List<Painting>) b1.readPropertyDirectly(Artist.PAINTING_ARRAY_PROPERTY);
                assertNotNull(toMany);
                assertFalse(((ValueHolder) toMany).isFault());
                assertEquals(2, toMany.size());

                List<String> names = new ArrayList<String>();
View Full Code Here

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

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertFalse(result.isEmpty());
                Bag b1 = result.get(0);
                List<Ball> balls = (List<Ball>) b1.readPropertyDirectly(Bag.BALLS_PROPERTY);
                assertNotNull(balls);
                assertFalse(((ValueHolder) balls).isFault());
                assertEquals(6, balls.size());

                List<Integer> volumes = new ArrayList<Integer>();
View Full Code Here

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

        queryInterceptor.runWithQueriesBlocked(new UnitTestClosure() {

            public void execute() {
                assertFalse(result.isEmpty());
                Bag b1 = result.get(0);
                List<Thing> things = (List<Thing>) b1.readPropertyDirectly(Bag.THINGS_PROPERTY);
                assertNotNull(things);
                assertFalse(((ValueHolder) things).isFault());
                assertEquals(6, things.size());

                List<Integer> volumes = new ArrayList<Integer>();
View Full Code Here

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

            public void execute() {
                assertFalse(result.isEmpty());

                Bag bag = result.get(0);
                List<Box> boxes = (List<Box>) bag.readPropertyDirectly(Bag.BOXES_PROPERTY);
                assertNotNull(boxes);
                assertFalse(((ValueHolder) boxes).isFault());
                assertEquals(2, boxes.size());

                Box big = null;
View Full Code Here

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

        // create new context
        context = createDataContext();
        BinaryPKTest2 fetchedDetail = (BinaryPKTest2) context.performQuery(
                new SelectQuery(BinaryPKTest2.class)).get(0);

        assertNotNull(fetchedDetail.readPropertyDirectly("toBinaryPKMaster"));

        BinaryPKTest1 fetchedMaster = fetchedDetail.getToBinaryPKMaster();
        assertNotNull(fetchedMaster);
        assertEquals(PersistenceState.HOLLOW, fetchedMaster.getPersistenceState());
        assertEquals("master1", fetchedMaster.getName());
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.