use of org.eclipse.persistence.testing.framework.TestErrorException in project eclipselink by eclipse-ee4j.
the class TestReadAggregateEntity1MMapMapping method reset.
@Override
public void reset() {
UnitOfWork uow = getSession().acquireUnitOfWork();
Iterator i = holders.iterator();
while (i.hasNext()) {
AggregateEntity1MMapHolder holder = (AggregateEntity1MMapHolder) i.next();
Iterator j = holder.getAggregateToEntityMap().keySet().iterator();
while (j.hasNext()) {
uow.deleteObject(holder.getAggregateToEntityMap().get(j.next()));
}
}
uow.deleteAllObjects(holders);
uow.commit();
if (!verifyDelete(holders.get(0))) {
throw new TestErrorException("Delete was unsuccessful.");
}
mapping.setJoinFetch(oldFetchJoinValue);
}
use of org.eclipse.persistence.testing.framework.TestErrorException in project eclipselink by eclipse-ee4j.
the class TestReadAggregateEntity1MMapMapping method verify.
@Override
public void verify() {
if (holders == null || holders.size() != 1) {
throw new TestErrorException("Incorrect number of MapHolders was read.");
}
AggregateEntity1MMapHolder holder = (AggregateEntity1MMapHolder) holders.get(0);
if (!((IndirectMap) holder.getAggregateToEntityMap()).getValueHolder().isInstantiated() && fetchJoinRelationship > 0) {
throw new TestErrorException("Relationship was not properly joined.");
}
if (holder.getAggregateToEntityMap().size() != 2) {
throw new TestErrorException("Incorrect Number of MapEntityValues was read.");
}
AggregateMapKey mapKey = new AggregateMapKey();
mapKey.setKey(11);
AEOTMMapValue value = (AEOTMMapValue) holder.getAggregateToEntityMap().get(mapKey);
if (value.getId() != 1) {
throw new TestErrorException("Incorrect MapEntityValues was read.");
}
}
use of org.eclipse.persistence.testing.framework.TestErrorException in project eclipselink by eclipse-ee4j.
the class TestReadDirectEntityMapMapping method verify.
@Override
public void verify() {
if (holders == null || holders.size() != 1) {
throw new TestErrorException("Incorrect number of MapHolders was read.");
}
DirectEntityMapHolder holder = (DirectEntityMapHolder) holders.get(0);
if (!((IndirectMap) holder.getDirectToEntityMap()).getValueHolder().isInstantiated() && fetchJoinRelationship > 0) {
throw new TestErrorException("Relationship was not properly joined.");
}
if (holder.getDirectToEntityMap().size() != 2) {
throw new TestErrorException("Incorrect Number of MapEntityValues was read.");
}
EntityMapValue value = (EntityMapValue) holder.getDirectToEntityMap().get(11);
if (value.getId() != 1) {
throw new TestErrorException("Incorrect MapEntityValues was read.");
}
}
use of org.eclipse.persistence.testing.framework.TestErrorException in project eclipselink by eclipse-ee4j.
the class TestReadDirectEntityU1MMapMapping method verify.
@Override
public void verify() {
if (holders == null || holders.size() != 1) {
throw new TestErrorException("Incorrect number of MapHolders was read.");
}
DirectEntityU1MMapHolder holder = (DirectEntityU1MMapHolder) holders.get(0);
if (!((IndirectMap) holder.getDirectToEntityMap()).getValueHolder().isInstantiated() && fetchJoinRelationship > 0) {
throw new TestErrorException("Relationship was not properly joined.");
}
if (holder.getDirectToEntityMap().size() != 2) {
throw new TestErrorException("Incorrect Number of MapEntityValues was read.");
}
EntityMapValue value = (EntityMapValue) holder.getDirectToEntityMap().get(11);
if (value.getId() != 1) {
throw new TestErrorException("Incorrect MapEntityValues was read.");
}
}
use of org.eclipse.persistence.testing.framework.TestErrorException in project eclipselink by eclipse-ee4j.
the class TestReadEntityDirectMapMapping method reset.
@Override
public void reset() {
UnitOfWork uow = getSession().acquireUnitOfWork();
Iterator i = holders.iterator();
while (i.hasNext()) {
EntityDirectMapHolder holder = (EntityDirectMapHolder) i.next();
Iterator j = holder.getEntityToDirectMap().keySet().iterator();
while (j.hasNext()) {
uow.deleteObject(j.next());
}
}
uow.deleteAllObjects(holders);
uow.commit();
if (!verifyDelete(holders.get(0))) {
throw new TestErrorException("Delete was unsuccessful.");
}
mapping.setJoinFetch(oldFetchJoinValue);
}
Aggregations