Package org.apache.art

Examples of org.apache.art.Painting


            try {
                assertEquals(1, objects.size());

                Iterator it = objects.iterator();
                while (it.hasNext()) {
                    Painting p = (Painting) it.next();
                    Artist a = p.getToArtist();
                    assertNotNull(a);
                    assertNotNull(a.getDateOfBirth());
                    assertTrue(a.getDateOfBirth().getClass().getName(), Date.class
                            .isAssignableFrom(a.getDateOfBirth().getClass()));
                }
View Full Code Here


                assertNotNull(list);
                assertFalse(((ValueHolder) list).isFault());

                Iterator children = list.iterator();
                while (children.hasNext()) {
                    Painting p = (Painting) children.next();
                    assertEquals(PersistenceState.COMMITTED, p.getPersistenceState());
                    // make sure properties are not null..
                    assertNotNull(p.getPaintingTitle());
                }
            }
        }
        finally {
            unblockQueries();
View Full Code Here

            assertFalse(((ValueHolder) list).isFault());
            assertEquals(2, list.size());

            Iterator children = list.iterator();
            while (children.hasNext()) {
                Painting p = (Painting) children.next();
                assertEquals(PersistenceState.COMMITTED, p.getPersistenceState());
                // make sure properties are not null..
                assertNotNull(p.getPaintingTitle());
            }

            // assert no duplicates
            Set s = new HashSet(list);
            assertEquals(s.size(), list.size());
View Full Code Here

        c.add(Calendar.DAY_OF_MONTH, -1);
        Artist a3 = context.newObject(Artist.class);
        a3.setArtistName("3");
        a3.setDateOfBirth(c.getTime());

        Painting p1 = context.newObject(Painting.class);
        p1.setEstimatedPrice(new BigDecimal(1));
        p1.setPaintingTitle("Y");
        a1.addToPaintingArray(p1);

        Painting p2 = context.newObject(Painting.class);
        p2.setEstimatedPrice(new BigDecimal(2));
        p2.setPaintingTitle("X");
        a2.addToPaintingArray(p2);

        context.commitChanges();

        SelectQuery query1 = new SelectQuery(Artist.class);
View Full Code Here

        List artists = ctxt.performQuery(select);
        assertEquals(1, artists.size());

        Artist a = (Artist) artists.get(0);
        Painting p = a.getPaintingArray().get(0);
        assertEquals(2000, p.getEstimatedPrice().intValue());
    }
View Full Code Here

        List artists = ctxt.performQuery(select);
        assertEquals(1, artists.size());

        Artist a = (Artist) artists.get(0);
        Painting p = a.getPaintingArray().get(0);
        assertEquals(2000, p.getEstimatedPrice().intValue());
    }
View Full Code Here

        DataRow artistRow = (DataRow) artists.get(0);
        Artist a = ctxt.objectFromDataRow(
                Artist.class,
                uppercaseConverter(artistRow),
                false);
        Painting p = a.getPaintingArray().get(0);

        // invalidate painting, it may have been updated in the proc
        ctxt.invalidateObjects(Collections.singletonList(p));
        assertEquals(2000, p.getEstimatedPrice().intValue());
    }
View Full Code Here

        DataRow artistRow = (DataRow) artists.get(0);
        Artist a = ctxt.objectFromDataRow(
                Artist.class,
                uppercaseConverter(artistRow),
                false);
        Painting p = a.getPaintingArray().get(0);

        // invalidate painting, it may have been updated in the proc
        ctxt.invalidateObjects(Collections.singletonList(p));
        assertEquals(2000, p.getEstimatedPrice().intValue());
    }
View Full Code Here

        DataRow artistRow = (DataRow) artists.get(0);
        Artist a = ctxt.objectFromDataRow(
                Artist.class,
                uppercaseConverter(artistRow),
                false);
        Painting p = a.getPaintingArray().get(0);

        // invalidate painting, it may have been updated in the proc
        ctxt.invalidateObjects(Collections.singletonList(p));
        assertEquals(2000, p.getEstimatedPrice().intValue());
    }
View Full Code Here

        // check the results
        assertNotNull("Null result from StoredProcedure.", artists);
        assertEquals(1, artists.size());
        Artist a = (Artist) artists.get(0);
        Painting p = a.getPaintingArray().get(0);

        // invalidate painting, it may have been updated in the proc
        ctxt.invalidateObjects(Collections.singletonList(p));
        assertEquals(1101.01, p.getEstimatedPrice().doubleValue(), 0.02);
    }
View Full Code Here

TOP

Related Classes of org.apache.art.Painting

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.