Search in sources :

Example 1 with Resource

use of org.eclipse.persistence.testing.models.relationshipmaintenance.Resource in project eclipselink by eclipse-ee4j.

the class TransparentIndirectionAddOverflowBehaviourTest method verify.

/*
     * Checks to see that the names of the updated version and the origional are the same
     */
@Override
public void verify() {
    FieldOffice cachedOffice2 = (FieldOffice) getSession().readObject(this.clone2);
    SalesPerson cachedTransfer = (SalesPerson) getSession().readObject(this.transfer);
    Resource cachedResource = (Resource) getSession().readObject(this.resource);
    if (cachedOffice2.getSalespeople().contains(cachedTransfer)) {
        throw new TestErrorException("Failed to replicate Set behavior for double add when tracking changes");
    }
    if (!cachedOffice2.getResources().contains(cachedResource)) {
        throw new TestErrorException("Failed to replicate List behavior for double add when tracking changes");
    }
}
Also used : FieldOffice(org.eclipse.persistence.testing.models.relationshipmaintenance.FieldOffice) SalesPerson(org.eclipse.persistence.testing.models.relationshipmaintenance.SalesPerson) Resource(org.eclipse.persistence.testing.models.relationshipmaintenance.Resource) TestErrorException(org.eclipse.persistence.testing.framework.TestErrorException)

Example 2 with Resource

use of org.eclipse.persistence.testing.models.relationshipmaintenance.Resource in project eclipselink by eclipse-ee4j.

the class TransparentIndirectionTest method verify.

/*
     * Checks to see that the names of the updated version and the origional are the same
     */
@Override
public void verify() {
    FieldOffice cachedOffice = (FieldOffice) getSession().readObject(this.clone);
    FieldOffice cachedOffice2 = (FieldOffice) getSession().readObject(this.clone2);
    SalesPerson cachedTransfer = (SalesPerson) getSession().readObject(this.transfer);
    SalesPerson cachedTransfer2 = (SalesPerson) getSession().readObject(this.transfer2);
    Resource cachedResource = (Resource) getSession().readObject(this.resource);
    if (cachedOffice.getSalespeople().contains(cachedTransfer)) {
        throw new TestErrorException("Failed to track changes from indirect list with transparent indirection");
    }
    if (!cachedOffice2.getSalespeople().contains(cachedTransfer)) {
        throw new TestErrorException("Failed to track changes when new entire collection set with transparent indirection");
    }
    if (cachedOffice2.getSalespeople().contains(cachedTransfer2)) {
        throw new TestErrorException("Failed to merge changes from indirect list with transparent indirection");
    }
    if (!cachedOffice.getSalespeople().contains(cachedTransfer2)) {
        throw new TestErrorException("Failed to merge changes when new entire collection set with transparent indirection");
    }
    if (cachedOffice.getResources().contains(cachedResource)) {
        throw new TestErrorException("Failed to track changes from indirect list without indirection");
    }
    if (!cachedOffice2.getResources().contains(cachedResource)) {
        throw new TestErrorException("Failed to track changes when new entire collection set without indirection");
    }
}
Also used : FieldOffice(org.eclipse.persistence.testing.models.relationshipmaintenance.FieldOffice) SalesPerson(org.eclipse.persistence.testing.models.relationshipmaintenance.SalesPerson) Resource(org.eclipse.persistence.testing.models.relationshipmaintenance.Resource) TestErrorException(org.eclipse.persistence.testing.framework.TestErrorException)

Aggregations

TestErrorException (org.eclipse.persistence.testing.framework.TestErrorException)2 FieldOffice (org.eclipse.persistence.testing.models.relationshipmaintenance.FieldOffice)2 Resource (org.eclipse.persistence.testing.models.relationshipmaintenance.Resource)2 SalesPerson (org.eclipse.persistence.testing.models.relationshipmaintenance.SalesPerson)2