Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333037

Summary: ReturningPolicyTestModel never runs 4 sub models.
Product: z_Archived Reporter: Andrei Ilitchev <andrei.ilitchev>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
suggested patch none

Description Andrei Ilitchev CLA 2010-12-21 14:11:36 EST
This is purely testing bug.

Currently ReturningPolicyTestModel contains 4 sub models that use SubstituteSequencingWithReturningPolicyAdapter.

Currently each one of them fails to run producing:

VERSION: Eclipse Persistence Services - 2.2.0.qualifier
TEST MODEL NAME: ComplexUpdateAndUnitOfWorkTestModel using SubstituteSequencingWithReturningPolicyAdapter
MODEL DESCRIPTION: 

RESULTS OF TEST MODEL: ComplexUpdateAndUnitOfWorkTestModel using SubstituteSequencingWithReturningPolicyAdapter
SETUP WARNING: 
Exception [EclipseLink-0] (Eclipse Persistence Services - 2.2.0.qualifier): org.eclipse.persistence.testing.framework.TestWarningException
Exception Description: Currently supports Oracle platform only

That occurs even on Oracle!

That is caused by SubstituteSequencingWithReturningPolicyAdapter.createSequences method, where:
if (!session.getPlatform().isOracle()) {
    throw new TestWarningException("Currently supports Oracle platform only");
}
was mistakenly substituted for:
if (session.getPlatform().supportsSequenceObjects()) {
    throw new TestWarningException("Currently supports Oracle platform only");
}

After fixing this error (that occured more than a year ago) running ReturningPolicyTestModel (now including the 4 previously missing sub models) produced several test failures.

The failures where caused by added (or altered) tests that never ran under ReturningPolicyTestModel.
All errors appear to be caused by the tests - not by the core.
Comment 1 Andrei Ilitchev CLA 2010-12-21 14:22:47 EST
Created attachment 185661 [details]
suggested patch

The patch reverses the boolean check that caused the 4 sub models to be excluded.

Adding additional attribute to Cousin and Relative classes fixed failures of AggregateRelationshipsOneToOneTestCase and AggregateRelationshipsManyToManyTestCase.
The failures occured because when sequecing is substituted for returning lack of any other (than PK) fields caused creation of an illegal insert statment without fields to be inserted, though with a field to be returned.

RegisterNewObjectInIdentityMapNoSeqTest has to be augmented because - when it uses sequencing - it relies upon that being "before-insert" sequencing (like table sequencing), however ReturningPolicy functions like "after-insert" sequencing (like identity) and therefore these tests should not be run under ReturningPolicyTestModel (which is easily identified by descriptor's sequence being null).
Comment 2 Andrei Ilitchev CLA 2010-12-21 14:28:42 EST
fixed in trunk (2.3)
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:16:26 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:27:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink