blob: 03cdc29afe6ae5927cd4fbe1b1f4510b60e623dd [file] [log] [blame]
/*
* Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
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 {
@Override
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] = (long) i;
}
}catch (Error er){
//ignore
}
if (((UnitOfWorkImpl)uow).getCloneMapping().size() != size){
throw new TestErrorException("Released Objects that should not have been released.");
}
}
}
;