Examples of ArtistLocal


Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test05_BSetANewAB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(2);
            SongLocal song = findSong(22);
            song.setPerformer(artist);
        } finally {
            completeTransaction();
        }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test06_ASetBExistingBNewA() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(2);
            SongLocal song = findSong(11);
            Set<SongLocal> songSets = artist.getPerformed();
            songSets.add(song);
        } finally {
            completeTransaction();
        }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test07_BSetAExistingBNewA() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(2);
            SongLocal song = findSong(11);
            song.setPerformer(artist);
        } finally {
            completeTransaction();
        }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test08_ASetBExistingANewB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(1);
            SongLocal song = createSong(33);
            Set<SongLocal> songSets = artist.getPerformed();
            songSets.add(song);
        } finally {
            completeTransaction();
        }
        assertLinked(1, 11, 22, 33);
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test09_BSetAExistingANewB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(1);
            SongLocal song = createSong(33);
            song.setPerformer(artist);
        } finally {
            completeTransaction();
        }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test10_RemoveRelationships() throws Exception {
        resetDB();
        beginTransaction();
        try {
            SongLocal song = findSong(11);
            ArtistLocal artist = song.getPerformer();
            Set<SongLocal> songs = artist.getPerformed();
            assertTrue(songs.contains(song));
            song.remove();
            assertFalse(songs.contains(song));
        } finally {
            completeTransaction();
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

        try {
            SongLocal song = findSong(11);

            song.setBpm(2);

            ArtistLocal artist = song.getPerformer();
            assertEquals(new Integer(2), artist.getId());
            assertEquals("value2", artist.getName());
        } finally {
            completeTransaction();
        }
    }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test11_Delete() throws Exception {
        resetDB();

        beginTransaction();
        try {
            ArtistLocal artist = findArtist(1);
            artist.setPerformed(new HashSet<SongLocal>());
            Set<SongLocal> songs = artist.getComposed();
            Set<SongLocal> bsCopies = new HashSet<SongLocal>(songs);
            assertSame(songs, artist.getComposed());
            artist.remove();
            assertTrue("CMR collection is not empty " + System.identityHashCode(songs), songs.isEmpty());
            for (SongLocal songLocal : bsCopies) {
                assertNull(songLocal.getComposer());
            }
        } finally {
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void test12_CascadeDelete() throws Exception {
        resetDB();

        beginTransaction();
        try {
            ArtistLocal artist = findArtist(1);
            Set<SongLocal> songs = artist.getPerformed();
            assertFalse(songs.isEmpty());
            artist.remove();
            assertTrue(songs.isEmpty());
        } finally {
            completeTransaction();
        }
        Connection c = ds.getConnection();
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.onetomany.ArtistLocal

    public void testIllegalCmrCollectionArgument() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(new Integer(1));
            Set songs = artist.getComposed();

            try {
                songs.add(new Object());
                fail("expected games.add(new Object()) to throw an IllegalArgumentException");
            } catch (IllegalArgumentException e) {
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.