Examples of GameLocal


Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

    public void testModifyCmrCollectionInNewTx() throws Exception {
        resetDB();
        beginTransaction();
        Set games;
        GameLocal newGame;
        try {
            PlatformLocal platform = findPlatform(new Integer(1));
            newGame = createGame(new Integer(33));
            games = platform.getGames();
        } finally {
            completeTransaction();
        }

        beginTransaction();
        try {
            // CMR collections should still be readable
            assertFalse(games.isEmpty());
            assertEquals(2, games.size());
            for (Iterator iter = games.iterator(); iter.hasNext();) {
                GameLocal game = (GameLocal) iter.next();
                if (game.getId().equals(new Integer(11))) {
                    assertEquals("value11", game.getName());
                } else if (game.getId().equals(new Integer(22))) {
                    assertEquals("value22", game.getName());
                } else {
                    fail();
                }
            }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

        resetDB();
        beginTransaction();
        Set games;
        try {
            PlatformLocal platform = findPlatform(new Integer(1));
            GameLocal game = findGame(new Integer(11));
            games = platform.getGames();
            assertFalse(games.isEmpty());
            assertEquals(2, games.size());

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

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

        resetDB();
        beginTransaction();
        Set games;
        try {
            PlatformLocal platform = findPlatform(new Integer(1));
            GameLocal game = findGame(new Integer(11));
            games = platform.getGames();
            assertFalse(games.isEmpty());
            assertEquals(2, games.size());

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

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

        s.close();
        c.close();
    }

    private GameLocal createGame(int gameId) throws CreateException {
        GameLocal menu = gameLocalHome.create(gameId);
        menu.setName("value" + gameId);
        return menu;
    }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

            PlatformLocal platform2 = createPlatform(2);
            assertNotNull("platform2.getGames() is null", platform2.getGames());
            PlatformLocal platform3 = createPlatform(3);
            assertNotNull("platform3.getGames() is null", platform3.getGames());

            GameLocal game1 = createGame(11);
            assertNotNull("game1.getPlatforms() is null", game1.getPlatforms());
            GameLocal game2 = createGame(22);
            assertNotNull("game2.getPlatforms() is null", game2.getPlatforms());

            platform1.getGames().add(game1);

            platform1.getGames().add(game2);
            platform2.getGames().add(game2);
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

        try {
            PlatformLocal platform = findPlatform(new Integer(1));
            Set<GameLocal> gameSets = platform.getGames();
            assertEquals(2, gameSets.size());
            for (Iterator iter = gameSets.iterator(); iter.hasNext();) {
                GameLocal game = (GameLocal) iter.next();
                if (game.getId().equals(new Integer(11))) {
                    assertEquals("value11", game.getName());
                } else if (game.getId().equals(new Integer(22))) {
                    assertEquals("value22", game.getName());
                } else {
                    fail();
                }
            }
        } finally {
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

    public void testBGetAExistingAB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            GameLocal game = findGame(new Integer(22));
            Set aSet = game.getPlatforms();
            assertEquals(3, aSet.size());
            for (Iterator iter = aSet.iterator(); iter.hasNext();) {
                PlatformLocal platform = (PlatformLocal) iter.next();
                if (platform.getId().equals(new Integer(1))) {
                    assertEquals("value1", platform.getName());
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

    public void testBSetADropExisting() throws Exception {
        resetDB();
        beginTransaction();
        try {
            GameLocal game = findGame(new Integer(11));
            game.setPlatforms(new HashSet<PlatformLocal>());
            game = findGame(new Integer(22));
            game.setPlatforms(new HashSet<PlatformLocal>());
        } finally {
            completeTransaction();
        }

        assertAllUnlinked();
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

    public void testASetBNewAB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            PlatformLocal platform = createPlatform(new Integer(4));
            GameLocal game = createGame(new Integer(33));
            Set<GameLocal> gameSets = platform.getGames();
            gameSets.add(game);
        } finally {
            completeTransaction();
        }
View Full Code Here

Examples of org.apache.openejb.test.entity.cmr.manytomany.GameLocal

    public void testBSetANewAB() throws Exception {
        resetDB();
        beginTransaction();
        try {
            PlatformLocal platform = createPlatform(new Integer(4));
            GameLocal game = createGame(new Integer(33));
            Set<PlatformLocal> platformSets = game.getPlatforms();
            platformSets.add(platform);
        } finally {
            completeTransaction();
        }
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.