use of org.eclipse.persistence.testing.tests.writing.UpdateChangeNothingTest in project eclipselink by eclipse-ee4j.
the class UnitOfWorkIsolatedAlwaysTestModel method addTests.
/**
* Add all unit of work test suite tests that are runnable with an isolated unit of work.
*/
@Override
public void addTests() {
addTest(new MergeCloneWithReferencesWithNullTest());
addTest(new MergeCloneWithReferencesTransparentIndirectionTest());
// bug 4518570
// addTest(new UnitOfWorkRevertAndResumeWithNewTest()); - Requires revert from cache.
// bug 4544221
addTest(new UnitOfWorkRevertWithNewObjectTest());
// bug 4569755
addTest(new UnitOfWorkNullPrimaryKeyTest());
PopulationManager manager = PopulationManager.getDefaultManager();
org.eclipse.persistence.testing.models.employee.domain.Employee employee = (org.eclipse.persistence.testing.models.employee.domain.Employee) manager.getObject(org.eclipse.persistence.testing.models.employee.domain.Employee.class, "0001");
// Tests with using unit of work.
ComplexUpdateTest test = new UpdateToNullTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateChangeValueTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateChangeNothingTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateChangeObjectTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateDeepOwnershipTest((org.eclipse.persistence.testing.models.ownership.ObjectA) manager.getObject(org.eclipse.persistence.testing.models.ownership.ObjectA.class, "example1"));
test.usesUnitOfWork = true;
addTest(test);
// addTest(new BidirectionalInsertTest(true)); - Requires merge.
addTest(new NestedUnitOfWorkTest(employee));
addTest(new NestedUnitOfWorkMultipleCommitTest(employee));
addTest(new DeepNestedUnitOfWorkTest(employee));
addTest(new MultipleUnitOfWorkTest(employee));
addTest(new InsertNewObjectTest());
// addTest(new ComplexMultipleUnitOfWorkTest()); - Requires merge.
addTest(new FaultyUnitOfWorkTest());
addTest(new LockFailureUnitOfWorkTest());
// addTest(new UnitOfWorkResumeTest(employee)); - Requires merge.
addTest(new UnitOfWorkResumeOnFailureTest(employee));
addTest(new DeletingFromParentSessionTest());
// addTest(new org.eclipse.persistence.testing.models.mapping.EqualObjectUnitOfWorkTest()); - Requires merge.
addTest(new NoIMWithValueHolderTest());
addTest(new UnitOfWorkRevertTest(employee));
// addTest(new DeepMergeCloneSerializedTest()); - Requires merge.
// addTest(new DeepMergeCloneIndirectionTest()); - Requires merge.
// addTest(new RegisterNewObjectTest()); - Requires merge.
addTest(new NoIdentityMapUnitOfWorkTest());
addTest(new RefreshObjectNoIdentityMapUnitOfWorkTest());
addTest(new RelationshipTreeInsertTest());
addTest(new UnitOfWorkComplexRefreshTest());
addTest(new ViolateObjectSpaceTest());
// code coverage
addTest(new NoValidationWithInitIdentityMaps());
addTest(new NoIdentityTest());
addTest(new NoIdentityMergeCloneTest());
addTest(new org.eclipse.persistence.testing.tests.mapping.BiDirectionInsertOrderTest());
addTest(new UnitOfWorkCommitResumeOnFailureNoFailureTest(employee));
addTest(new UnitOfWorkCommitAndResume(employee));
addTest(new NestedUnitOfWorkQuery());
addTest(new DeleteAndConform());
// addTest(new NullAggregateTest()); - Requires merge.
addTest(new UOWHasOnlyDeletesTest());
// CR 2728
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NULL, false, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.ZERO, false, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NEGATIVE, false, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NULL, true, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.ZERO, true, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NEGATIVE, true, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NULL, true, true));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.ZERO, true, true));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NEGATIVE, true, true));
// CR 2783
addTest(new NestedUnitOfWorkDeleteNewObjectTest());
// bug 3115160
addTest(new NestedUnitOfWorkDeleteNestedNewObjectTest());
// bug GitHub 624
addTest(new NestedUnitOfWorkDeleteFromNestedObjectTest());
// bug 3132979
addTest(new NestedUnitOfWorkDeleteConformedNestedNewObjectTest());
addTest(new DoubleNestedUnitOfWorkDeleteConformedNestedNewObjectTest());
// bug 3228185
addTest(new NestedUnitOfWorkNewObjectWithIndirectionTest());
// CR#3216
addTest(new UnitOfWorkDeleteNoValidationTest());
addTest(new ConcurrentNewObjectTest());
// addTest(new ConcurrentReadOnInsertTest()); - Test requires merge.
addTest(new ConcurrentRefreshOnUpdateTest());
addTest(new ConcurrentRefreshOnCloneTest());
// CR 4094
addTest(new GetIdentityMapFromUOWForREADONLYClassTest());
addTest(new UnitOfWorkCommitToDatabaseTest());
addTest(new UnitOfWorkInitializeAllIdentityMapsTest());
// CR#4204
addTest(new WasTransactionBegunPrematurelyRollbackTest());
// code coverage
addTest(new CanChangeReadOnlySetTest());
// code coverage
addTest(new GetFromNewObjectWithConformTest());
// addTest(new UOWCommitAndResumeWithPreCalcChangeSet(employee)); - Requires merge.
addTest(new PerformDeletesFirstTest());
// bug 3815959
addTest(new PerformDeletesFirstIgnoreUpdateTest());
addTest(new PerformDeletesFirstIgnoreUpdateTest2());
// bug 2612331
addTest(new CreateDeleteCreateTest());
// bug 2612602
// addTest(new WorkingCloneCopyPolicyTest()); - Requires non-isolated.
addTest(new UnregisteredNewObjectOptimisticLockTest());
// bug 3510459
addTest(new DoubleNestedUnitOfWorkRegisterNewObjectTest());
// bug 3582102
addTest(new LockOnCloneTest());
addTest(new LockOnCloneDeadlockAvoidanceTest());
// bug 3287196
addTest(new GetObjectFromIdentityMapTest());
// bug 3656068
// addTest(new ConcurrentReadOnUpdateWithEarlyTransTest()); - Requires non-isolated.
addTest(new MergeDeadIndirectionTest());
// bug 4071929
addTest(new UnitOfWorkConcurrentRevertTest());
// Add new tests here, if any.
addTest(new CommitAfterExecuteModifyQueryDuringTransTest());
// bug 4364283
addTest(new AllChangeSetsTest());
// bug 4438127
// addTest(new NewObjectIdentityTest()); - Requires merge.
// bug 4453001
addTest(new ErrorOnInsertTest());
addTest(new CollectionMappingMergeObjectTest());
addTest(new ExceptionsRaisedUnitOfWorkTest());
// bug 4736360
addTest(new NestedUOWWithNewObjectRegisteredTwiceTest());
addTest(new NestedUnitOfWorkReadOnlyClassTest());
}
use of org.eclipse.persistence.testing.tests.writing.UpdateChangeNothingTest in project eclipselink by eclipse-ee4j.
the class EmployeeAttributeChangeTrackingTestModel method getUnitOfWorkTestSuite.
/**
* Add a subset of the UnitOfWork tests in order to test the actual test flag functionality.
*/
@Override
public TestSuite getUnitOfWorkTestSuite() {
TestSuite suite = new TestSuite();
suite.setName("Unit Of Work Update Test Suite");
suite.setDescription("This suite tests change flags for updates using UnitOfWork");
PopulationManager manager = PopulationManager.getDefaultManager();
Employee employee = (Employee) manager.getObject(Employee.class, "0001");
// Tests with using unit of work.
ComplexUpdateTest test = new UpdateToNullTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeValueTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeNothingTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeObjectTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
// suite.addTest(new NestedUnitOfWorkMultipleCommitTest(employee));
suite.addTest(new MultipleUnitOfWorkTest(employee));
suite.addTest(new UnitOfWorkResumeTest(employee));
suite.addTest(new UnitOfWorkResumeOnFailureTest(employee));
suite.addTest(new UnitOfWorkCommitResumeOnFailureNoFailureTest(employee));
// suite.addTest(new UnitOfWorkCommitAndResume(employee));
suite.addTest(new UnitOfWorkRevertTest(employee));
suite.addTest(new ChangeFlagTest());
// The test below should work,
// once AttributeChangeTrackingPolicy supports for aggregate, aggregate collection and direct collection.
// suite.addTest(new ChangeEventTest());
suite.addTest(new NestedUOWWithAttributeChangeTrackingTest(employee));
suite.addTest(new WrongPropertyNameTest());
suite.addTest(new DeepMergeCloneSerializedTest());
suite.addTest(new DeepMergeCloneSerializedObjectReferenceChangesTest());
suite.addTest(new TransparentMapTest());
suite.addTest(new AggregateAttributeChangeTrackingTest());
suite.addTest(new ChangeTrackedWeakReferenceTest());
suite.addTest(new DeferredChangeWeakReferenceTest());
suite.addTest(new ForceWeakReferenceTest());
suite.addTest(new HardReferenceTest());
suite.addTest(new WeakReferenceTest());
return suite;
}
use of org.eclipse.persistence.testing.tests.writing.UpdateChangeNothingTest in project eclipselink by eclipse-ee4j.
the class EmployeeChangeFlagBasicTestModel method getUnitOfWorkTestSuite.
/**
* Add a subset of the UnitOfWork tests in order to test the actual test flag functionality.
*/
public TestSuite getUnitOfWorkTestSuite() {
TestSuite suite = new TestSuite();
suite.setName("Unit Of Work Update Test Suite");
suite.setDescription("This suite tests change flags for updates using UnitOfWork");
PopulationManager manager = PopulationManager.getDefaultManager();
Employee employee = (Employee) manager.getObject(Employee.class, "0001");
// Tests with using unit of work.
ComplexUpdateTest test = new UpdateToNullTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeValueTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeNothingTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeObjectTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
suite.addTest(new NestedUnitOfWorkTest(employee));
suite.addTest(new NestedUnitOfWorkMultipleCommitTest(employee));
suite.addTest(new DeepNestedUnitOfWorkTest(employee));
suite.addTest(new MultipleUnitOfWorkTest(employee));
suite.addTest(new UnitOfWorkResumeTest(employee));
suite.addTest(new UnitOfWorkResumeOnFailureTest(employee));
suite.addTest(new UnitOfWorkCommitResumeOnFailureNoFailureTest(employee));
suite.addTest(new UnitOfWorkCommitAndResume(employee));
suite.addTest(new UnitOfWorkRevertTest(employee));
suite.addTest(new ChangeFlagTest());
suite.addTest(new ChangeEventTest());
suite.addTest(new DeepMergeCloneSerializedTest());
suite.addTest(new DeepMergeCloneSerializedObjectReferenceChangesTest());
return suite;
}
use of org.eclipse.persistence.testing.tests.writing.UpdateChangeNothingTest in project eclipselink by eclipse-ee4j.
the class EmployeeHybridChangeTrackingTestModel method getUnitOfWorkTestSuite.
/**
* Add a subset of the UnitOfWork tests in order to test the actual test flag functionality.
*/
@Override
public TestSuite getUnitOfWorkTestSuite() {
TestSuite suite = new TestSuite();
suite.setName("Unit Of Work Update Test Suite");
suite.setDescription("This suite tests change flags for updates using UnitOfWork");
PopulationManager manager = PopulationManager.getDefaultManager();
Employee employee = (Employee) manager.getObject(Employee.class, "0001");
// Tests with using unit of work.
ComplexUpdateTest test = new UpdateToNullTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeValueTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeNothingTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
test = new UpdateChangeObjectTest(employee);
test.usesUnitOfWork = true;
suite.addTest(test);
// The test below should work,
// once AttributeChangeTrackingPolicy supports for aggregate, aggregate collection and direct collection.
// suite.addTest(new NestedUnitOfWorkTest(employee));
// suite.addTest(new NestedUnitOfWorkMultipleCommitTest(employee));
suite.addTest(new MultipleUnitOfWorkTest(employee));
suite.addTest(new UnitOfWorkResumeTest(employee));
suite.addTest(new UnitOfWorkResumeOnFailureTest(employee));
suite.addTest(new UnitOfWorkCommitResumeOnFailureNoFailureTest(employee));
// suite.addTest(new UnitOfWorkCommitAndResume(employee));
suite.addTest(new UnitOfWorkRevertTest(employee));
suite.addTest(new ChangeFlagTest());
// The test below should work,
// once AttributeChangeTrackingPolicy supports for aggregate, aggregate collection and direct collection.
// suite.addTest(new ChangeEventTest());
suite.addTest(new NestedUOWWithAttributeChangeTrackingTest(employee));
suite.addTest(new DeepMergeCloneSerializedTest());
suite.addTest(new DeepMergeCloneSerializedObjectReferenceChangesTest());
return suite;
}
use of org.eclipse.persistence.testing.tests.writing.UpdateChangeNothingTest in project eclipselink by eclipse-ee4j.
the class UnitOfWorkTestSuite method addSRGTests.
// SRG test set is maintained by QA only, do NOT add any new tests into it.
@Override
public void addSRGTests() {
PopulationManager manager = PopulationManager.getDefaultManager();
Employee employee = (Employee) manager.getObject(Employee.class, "0001");
// Tests with using unit of work.
ComplexUpdateTest test = new UpdateToNullTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateChangeValueTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateChangeNothingTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateChangeObjectTest(employee);
test.usesUnitOfWork = true;
addTest(test);
test = new UpdateDeepOwnershipTest((ObjectA) manager.getObject(ObjectA.class, "example1"));
test.usesUnitOfWork = true;
addTest(test);
addTest(new BidirectionalInsertTest(true));
addTest(new NestedUnitOfWorkTest(employee));
addTest(new NestedUnitOfWorkMultipleCommitTest(employee));
addTest(new DeepNestedUnitOfWorkTest(employee));
addTest(new MultipleUnitOfWorkTest(employee));
addTest(new InsertNewObjectTest());
addTest(new ComplexMultipleUnitOfWorkTest());
addTest(new FaultyUnitOfWorkTest());
addTest(new LockFailureUnitOfWorkTest());
addTest(new UnitOfWorkResumeTest(employee));
addTest(new UnitOfWorkResumeOnFailureTest(employee));
addTest(new DeletingFromParentSessionTest());
addTest(new org.eclipse.persistence.testing.tests.mapping.EqualObjectUnitOfWorkTest());
addTest(new NoIMWithValueHolderTest());
addTest(new UnitOfWorkRevertTest(employee));
addTest(new DeepMergeCloneSerializedTest());
addTest(new DeepMergeCloneIndirectionTest());
addTest(new RegisterNewObjectTest());
addTest(new NoIdentityMapUnitOfWorkTest());
addTest(new RefreshObjectNoIdentityMapUnitOfWorkTest());
addTest(new RelationshipTreeInsertTest());
addTest(new UnitOfWorkComplexRefreshTest());
addTest(new ViolateObjectSpaceTest());
// code coverage
addTest(new NoValidationWithInitIdentityMaps());
addTest(new NoIdentityTest());
addTest(new NoIdentityMergeCloneTest());
addTest(new org.eclipse.persistence.testing.tests.mapping.BiDirectionInsertOrderTest());
addTest(new UnitOfWorkCommitResumeOnFailureNoFailureTest(employee));
addTest(new UnitOfWorkCommitAndResume(employee));
addTest(new NestedUnitOfWorkQuery());
addTest(new DeleteAndConform());
addTest(new NullAggregateTest());
addTest(new UOWHasOnlyDeletesTest());
// CR 2728
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NULL, false, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.ZERO, false, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NEGATIVE, false, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NULL, true, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.ZERO, true, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NEGATIVE, true, false));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NULL, true, true));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.ZERO, true, true));
addTest(new RegisterNewObjectInIdentityMapNoSeqTest(IdValidation.NEGATIVE, true, true));
// CR 2783
addTest(new NestedUnitOfWorkDeleteNewObjectTest());
// bug 3115160
addTest(new NestedUnitOfWorkDeleteNestedNewObjectTest());
// bug 3132979
addTest(new NestedUnitOfWorkDeleteConformedNestedNewObjectTest());
addTest(new DoubleNestedUnitOfWorkDeleteConformedNestedNewObjectTest());
// bug 3228185
addTest(new NestedUnitOfWorkNewObjectWithIndirectionTest());
// CR#3216
addTest(new UnitOfWorkDeleteNoValidationTest());
// CR 4094
addTest(new GetIdentityMapFromUOWForREADONLYClassTest());
// code coverage testing
addTest(new UnitOfWorkCommitToDatabaseTest());
addTest(new UnitOfWorkInitializeAllIdentityMapsTest());
// CR#4204
addTest(new WasTransactionBegunPrematurelyRollbackTest());
// code coverage
addTest(new CanChangeReadOnlySetTest());
// code coverage
addTest(new GetFromNewObjectWithConformTest());
addTest(new UOWCommitAndResumeWithPreCalcChangeSet(employee));
addTest(new PerformDeletesFirstTest());
// bug 3815959
addTest(new PerformDeletesFirstIgnoreUpdateTest());
addTest(new PerformDeletesFirstIgnoreUpdateTest2());
// bug 2612331
addTest(new CreateDeleteCreateTest());
// bug 2612602
addTest(new WorkingCloneCopyPolicyTest());
addTest(new UnregisteredNewObjectOptimisticLockTest());
// bug 3510459
addTest(new DoubleNestedUnitOfWorkRegisterNewObjectTest());
// bug 3287196
addTest(new GetObjectFromIdentityMapTest());
addTest(new MergeDeadIndirectionTest());
// Add new tests here, if any.
addTest(new CommitAfterExecuteModifyQueryDuringTransTest());
// bug 4364283
addTest(new AllChangeSetsTest());
// bug 5744009
addTest(new CurrentChangeSetTest());
// bug 4453001
addTest(new ErrorOnInsertTest());
addTest(new CollectionMappingMergeObjectTest());
addTest(new ExceptionsRaisedUnitOfWorkTest());
// bug 4736360
addTest(new NestedUOWWithNewObjectRegisteredTwiceTest());
addTest(new NestedUnitOfWorkReadOnlyClassTest());
}
Aggregations