blob: d431c20225b11f74b60f8627f0c137432f08411e [file] [log] [blame]
package org.eclipse.persistence.testing.tests.unitofwork.referencesettings;
import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl;
import org.eclipse.persistence.sessions.UnitOfWork;
import org.eclipse.persistence.testing.framework.AutoVerifyTestCase;
import org.eclipse.persistence.testing.framework.TestErrorException;
import org.eclipse.persistence.testing.models.employee.domain.Employee;
public class DeferredChangeWeakReferenceTest extends AutoVerifyTestCase {
public void test(){
UnitOfWork uow = getSession().acquireUnitOfWork();
int size = uow.readAllObjects(Employee.class).size();
try{
Long[] arr = new Long[100000];
for (int i = 0; i< 100000; ++i){
arr[i] = new Long(i);
}
}catch (Error er){
//ignore
}
if (((UnitOfWorkImpl)uow).getCloneMapping().size() != size){
throw new TestErrorException("Released Objects that should not have been released.");
}
}
}
;