use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyComplexPkTests method testBSetANewAB.
public void testBSetANewAB() throws Exception {
resetDB();
beginTransaction();
try {
final PlatformLocal platform = createPlatform(new Integer(4));
final GameLocal game = createGame(new Integer(33));
final Set<PlatformLocal> platformSets = game.getPlatforms();
platformSets.add(platform);
} finally {
completeTransaction();
}
assertLinked(4, 33);
}
use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyComplexPkTests method testBSetADropExisting.
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();
}
use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyComplexPkTests method testRemoveRelationships.
public void testRemoveRelationships() throws Exception {
resetDB();
beginTransaction();
try {
final PlatformLocal platform = findPlatform(new Integer(1));
platform.remove();
} finally {
completeTransaction();
}
assertPlatformDeleted(1);
}
use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyComplexPkTests method testIteratorConcurrentModification.
public void testIteratorConcurrentModification() throws Exception {
resetDB();
beginTransaction();
final Set games;
try {
final PlatformLocal platform = findPlatform(new Integer(1));
final GameLocal game = findGame(new Integer(11));
games = platform.getGames();
assertFalse(games.isEmpty());
assertEquals(2, games.size());
final Iterator iterator = games.iterator();
games.remove(game);
assertEquals(1, games.size());
try {
iterator.next();
fail("expected iterator.next() to throw an ConcurrentModificationException");
} catch (final ConcurrentModificationException expected) {
}
} finally {
completeTransaction();
}
}
use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyComplexPkTests method testASetBExistingANewB.
public void testASetBExistingANewB() throws Exception {
resetDB();
beginTransaction();
try {
final PlatformLocal platform = findPlatform(new Integer(1));
final GameLocal game = createGame(new Integer(33));
final Set<GameLocal> gameSets = platform.getGames();
gameSets.add(game);
} finally {
completeTransaction();
}
assertLinked(1, 33);
}
Aggregations