use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyComplexPkTests method testBSetAExistingANewB.
public void testBSetAExistingANewB() throws Exception {
resetDB();
beginTransaction();
try {
final PlatformLocal platform = findPlatform(new Integer(1));
final GameLocal game = createGame(new Integer(33));
final Set<PlatformLocal> platformSets = game.getPlatforms();
platformSets.add(platform);
} finally {
completeTransaction();
}
assertLinked(1, 33);
}
use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyTests 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 ManyToManyTests method testBSetAExistingBNewA.
public void testBSetAExistingBNewA() throws Exception {
resetDB();
beginTransaction();
try {
final PlatformLocal platform = createPlatform(new Integer(4));
final GameLocal game = findGame(new Integer(11));
final Set<PlatformLocal> platformSets = game.getPlatforms();
platformSets.add(platform);
} finally {
completeTransaction();
}
assertLinked(4, 11);
}
use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyTests method testASetBDropExisting.
public void testASetBDropExisting() throws Exception {
resetDB();
beginTransaction();
try {
PlatformLocal platform = findPlatform(new Integer(1));
platform.setGames(new HashSet<GameLocal>());
platform = findPlatform(new Integer(2));
platform.setGames(new HashSet<GameLocal>());
platform = findPlatform(new Integer(3));
platform.setGames(new HashSet<GameLocal>());
} finally {
completeTransaction();
}
assertAllUnlinked();
}
use of org.apache.openejb.test.entity.cmr.manytomany.PlatformLocal in project tomee by apache.
the class ManyToManyTests method testRemoveRelationships.
public void testRemoveRelationships() throws Exception {
resetDB();
beginTransaction();
try {
final PlatformLocal platform = findPlatform(new Integer(1));
platform.remove();
} finally {
completeTransaction();
}
assertPlatformDeleted(1);
}
Aggregations