Examples of ArtistLocal


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

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

        resetDB();
        beginTransaction();
        Set songs;
        SongLocal newSong;
        try {
            ArtistLocal artist = findArtist(new Integer(1));
            newSong = createSong(new Integer(33));
            songs = artist.getComposed();
        } finally {
            completeTransaction();
        }

        // CMR collections should still be readable
View Full Code Here

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

        resetDB();
        beginTransaction();
        Set songs;
        SongLocal newSong;
        try {
            ArtistLocal artist = findArtist(new Integer(1));
            newSong = createSong(new Integer(33));
            songs = artist.getComposed();
        } finally {
            completeTransaction();
        }

        beginTransaction();
View Full Code Here

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

    public void testIteratorConcurrentModification() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(new Integer(1));
            SongLocal song = findSong(new Integer(11));
            Set songs = artist.getComposed();
            assertFalse(songs.isEmpty());
            assertEquals(2, songs.size());

            Iterator iterator = songs.iterator();
View Full Code Here

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

    public void testIteratorAndRemove() throws Exception {
        resetDB();
        beginTransaction();
        try {
            ArtistLocal artist = findArtist(new Integer(1));
            SongLocal song = findSong(new Integer(11));
            Set games = artist.getComposed();
            assertFalse(games.isEmpty());
            assertEquals(2, games.size());

            Iterator iterator = games.iterator();

            assertTrue(games.contains(song));
            artist.remove();
            assertFalse(games.contains(song));
            assertEquals(0, games.size());

            try {
                iterator.next();
View Full Code Here

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

            completeTransaction();
        }
    }

    private ArtistLocal createArtist(int songId) throws CreateException {
        ArtistLocal artist = artistLocalHome.create(songId);
        artist.setName("value" + songId);
        return artist;
    }
View Full Code Here

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

        } finally {
            close(statement);
            close(connection);
        }

        ArtistLocal artist1 = createArtist(1);
        createArtist(2);

        SongLocal song1 = createSong(11);
        SongLocal song2 = createSong(22);
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.