Examples of ROArtist


Examples of org.apache.art.ROArtist

                "Map expected, got " + objects.get(0).getClass(),
                objects.get(0) instanceof Map);
    }

    public void testCommitChangesRO1() throws Exception {
        ROArtist a1 = (ROArtist) context.newObject("ROArtist");
        a1.writePropertyDirectly("artistName", "abc");
        a1.setPersistenceState(PersistenceState.MODIFIED);

        try {
            context.commitChanges();
            fail("Inserting a 'read-only' object must fail.");
        }
View Full Code Here

Examples of org.apache.art.ROArtist

            // must blow on saving new "read-only" object.
        }
    }

    public void testCommitChangesRO2() throws Exception {
        ROArtist a1 = fetchROArtist("artist1");
        a1.writeProperty("artistName", "abc");

        try {
            context.commitChanges();
            fail("Updating a 'read-only' object must fail.");
        }
View Full Code Here

Examples of org.apache.art.ROArtist

            // must blow on saving new "read-only" object.
        }
    }

    public void testCommitChangesRO3() throws Exception {
        ROArtist a1 = fetchROArtist("artist1");
        context.deleteObject(a1);

        try {
            context.commitChanges();
            fail("Deleting a 'read-only' object must fail.");
View Full Code Here

Examples of org.apache.art.ROArtist

            // must blow on saving new "read-only" object.
        }
    }

    public void testCommitChangesRO4() throws Exception {
        ROArtist a1 = fetchROArtist("artist1");
        Painting painting = (Painting) context.newObject("Painting");
        painting.setPaintingTitle("paint");
        a1.addToPaintingArray(painting);

        assertEquals(PersistenceState.MODIFIED, a1.getPersistenceState());
        try {
            context.commitChanges();
        }
        catch (Exception ex) {
            fail("Updating 'read-only' object's to-many must succeed, instead an exception was thrown: "
                    + ex);
        }

        assertEquals(PersistenceState.COMMITTED, a1.getPersistenceState());
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ROArtist

                objects.get(0) instanceof Map);
    }

    public void testCommitChangesRO1() throws Exception {

        ROArtist a1 = (ROArtist) context.newObject("ROArtist");
        a1.writePropertyDirectly("artistName", "abc");
        a1.setPersistenceState(PersistenceState.MODIFIED);

        try {
            context.commitChanges();
            fail("Inserting a 'read-only' object must fail.");
        }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ROArtist

        createArtistsDataSet();

        SelectQuery query = new SelectQuery(ROArtist.class, ExpressionFactory.matchExp(
                Artist.ARTIST_NAME_PROPERTY,
                "artist1"));
        ROArtist a1 = (ROArtist) context.performQuery(query).get(0);
        a1.writeProperty(ROArtist.ARTIST_NAME_PROPERTY, "abc");

        try {
            context.commitChanges();
            fail("Updating a 'read-only' object must fail.");
        }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ROArtist

        createArtistsDataSet();

        SelectQuery query = new SelectQuery(ROArtist.class, ExpressionFactory.matchExp(
                Artist.ARTIST_NAME_PROPERTY,
                "artist1"));
        ROArtist a1 = (ROArtist) context.performQuery(query).get(0);
        context.deleteObject(a1);

        try {
            context.commitChanges();
            fail("Deleting a 'read-only' object must fail.");
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ROArtist

        createArtistsDataSet();

        SelectQuery query = new SelectQuery(ROArtist.class, ExpressionFactory.matchExp(
                Artist.ARTIST_NAME_PROPERTY,
                "artist1"));
        ROArtist a1 = (ROArtist) context.performQuery(query).get(0);

        Painting painting = context.newObject(Painting.class);
        painting.setPaintingTitle("paint");
        a1.addToPaintingArray(painting);

        assertEquals(PersistenceState.MODIFIED, a1.getPersistenceState());
        try {
            context.commitChanges();
        }
        catch (Exception ex) {
            fail("Updating 'read-only' object's to-many must succeed, instead an exception was thrown: "
                    + ex);
        }

        assertEquals(PersistenceState.COMMITTED, a1.getPersistenceState());
    }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ROArtist

                objects.get(0) instanceof Map<?, ?>);
    }

    public void testCommitChangesRO1() throws Exception {

        ROArtist a1 = (ROArtist) context.newObject("ROArtist");
        a1.writePropertyDirectly("artistName", "abc");
        a1.setPersistenceState(PersistenceState.MODIFIED);

        try {
            context.commitChanges();
            fail("Inserting a 'read-only' object must fail.");
        }
View Full Code Here

Examples of org.apache.cayenne.testdo.testmap.ROArtist

        createArtistsDataSet();

        SelectQuery query = new SelectQuery(ROArtist.class, ExpressionFactory.matchExp(
                Artist.ARTIST_NAME_PROPERTY,
                "artist1"));
        ROArtist a1 = (ROArtist) context.performQuery(query).get(0);
        a1.writeProperty(ROArtist.ARTIST_NAME_PROPERTY, "abc");

        try {
            context.commitChanges();
            fail("Updating a 'read-only' object must fail.");
        }
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.