Search in sources :

Example 21 with TestWarningException

use of org.eclipse.persistence.testing.framework.TestWarningException in project eclipselink by eclipse-ee4j.

the class RownumFilteringQueryTest method setup.

@Override
public void setup() {
    DatabaseSession session = (DatabaseSession) getSession();
    DatabasePlatform platform = getSession().getPlatform();
    if (!platform.isOracle()) {
        throw new TestWarningException("Oracle Pagination not supported on platform " + platform);
    }
    tracker = new QuerySQLTracker(session);
}
Also used : DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) DatabasePlatform(org.eclipse.persistence.internal.databaseaccess.DatabasePlatform) TestWarningException(org.eclipse.persistence.testing.framework.TestWarningException)

Example 22 with TestWarningException

use of org.eclipse.persistence.testing.framework.TestWarningException in project eclipselink by eclipse-ee4j.

the class UnitOfWorkClientSessionTestModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    // H2 has locking issue with multiple connections.
    if (getSession().getPlatform().isH2()) {
        throw new TestWarningException("H2 has locking issue with multiple connections");
    }
    addRequiredSystem(new OwnershipSystem());
    addRequiredSystem(new IndirectListSystem());
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new InsuranceSystem());
    addRequiredSystem(new MappingSystem());
    addRequiredSystem(new UOWSystem());
    addRequiredSystem(new InheritanceSystem());
}
Also used : InsuranceSystem(org.eclipse.persistence.testing.models.insurance.InsuranceSystem) MappingSystem(org.eclipse.persistence.testing.models.mapping.MappingSystem) OwnershipSystem(org.eclipse.persistence.testing.models.ownership.OwnershipSystem) InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) IndirectListSystem(org.eclipse.persistence.testing.models.transparentindirection.IndirectListSystem) TestWarningException(org.eclipse.persistence.testing.framework.TestWarningException) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 23 with TestWarningException

use of org.eclipse.persistence.testing.framework.TestWarningException in project eclipselink by eclipse-ee4j.

the class LockOnCloneTest method setup.

@Override
public void setup() {
    if (getSession().isDistributedSession()) {
        throw new TestWarningException("Test unavailable on Remote UnitOfWork because of timing issues");
    }
    getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
    getSession().getDescriptor(ConcurrentAddress.class).getEventManager().addListener(listener);
    UnitOfWork uow = getSession().acquireUnitOfWork();
    this.person = ConcurrentPerson.example1();
    // get the UOW clone to ensure the PK will be set in the case of Isolate in UOW test model
    this.person = (ConcurrentPerson) uow.registerObject(this.person);
    uow.commit();
    ConcurrentAddress.RUNNING_TEST = ConcurrentAddress.LOCK_ON_CLONE_TEST;
}
Also used : UnitOfWork(org.eclipse.persistence.sessions.UnitOfWork) TestWarningException(org.eclipse.persistence.testing.framework.TestWarningException)

Example 24 with TestWarningException

use of org.eclipse.persistence.testing.framework.TestWarningException in project eclipselink by eclipse-ee4j.

the class MergeCloneWithReferencesTransparentIndirectionTest method setup.

@Override
public void setup() {
    if (getSession() instanceof org.eclipse.persistence.sessions.remote.RemoteSession) {
        throw new TestWarningException("This test cannot be run through the remote.");
    }
    order = new Order();
    order.addLine(new OrderLine());
    order.addLine(new OrderLine());
    UnitOfWork uow = getSession().acquireUnitOfWork();
    uow.registerObject(order);
    uow.commit();
}
Also used : Order(org.eclipse.persistence.testing.models.transparentindirection.Order) UnitOfWork(org.eclipse.persistence.sessions.UnitOfWork) OrderLine(org.eclipse.persistence.testing.models.transparentindirection.OrderLine) TestWarningException(org.eclipse.persistence.testing.framework.TestWarningException)

Example 25 with TestWarningException

use of org.eclipse.persistence.testing.framework.TestWarningException in project eclipselink by eclipse-ee4j.

the class RegisterNewObjectInIdentityMapNoSeqTest method setup.

@Override
public void setup() {
    zeroFailed = false;
    negativeFailed = false;
    zeroOverridden = false;
    negativeOverridden = false;
    getAbstractSession().beginTransaction();
    ClassDescriptor descriptor = getSession().getClassDescriptor(Weather.class);
    idValidationOriginal = descriptor.getIdValidation();
    descriptor.setIdValidation(idValidation);
    if (keepSequencing) {
        if (descriptor.getSequence() == null) {
            // ReturningPolicyTestModel substitutes sequences for returning
            throw new TestWarningException("Cannot run test with descriptor.getSequence() == null");
        }
        if (!shouldAlwaysOverrideExistingValue) {
            if (descriptor.getSequence().shouldAcquireValueAfterInsert()) {
                throw new TestProblemException("Cannot run test with keepSequencing==true and alwayOverrideExistingValueOriginal==false with Identity sequence: it should always override");
            }
        }
        shouldAlwaysOverrideExistingValueOriginal = descriptor.getSequence().shouldAlwaysOverrideExistingValue();
        descriptor.getSequence().setShouldAlwaysOverrideExistingValue(shouldAlwaysOverrideExistingValue);
    } else {
        sequenceNumberField = descriptor.getSequenceNumberField();
        descriptor.setSequenceNumberField(null);
        sequenceNumberName = descriptor.getSequenceNumberName();
        descriptor.setSequenceNumberName(null);
    }
}
Also used : ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) TestWarningException(org.eclipse.persistence.testing.framework.TestWarningException)

Aggregations

TestWarningException (org.eclipse.persistence.testing.framework.TestWarningException)29 UnitOfWork (org.eclipse.persistence.sessions.UnitOfWork)9 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)7 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)5 ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)4 BigDecimal (java.math.BigDecimal)3 Vector (java.util.Vector)3 ReadAllQuery (org.eclipse.persistence.queries.ReadAllQuery)3 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)3 DataSource (javax.sql.DataSource)2 DatabasePlatform (org.eclipse.persistence.internal.databaseaccess.DatabasePlatform)2 AbstractSession (org.eclipse.persistence.internal.sessions.AbstractSession)2 ReportQuery (org.eclipse.persistence.queries.ReportQuery)2 ScrollableCursor (org.eclipse.persistence.queries.ScrollableCursor)2 DatabaseLogin (org.eclipse.persistence.sessions.DatabaseLogin)2 JNDIConnector (org.eclipse.persistence.sessions.JNDIConnector)2 TestProblemException (org.eclipse.persistence.testing.framework.TestProblemException)2 Address (org.eclipse.persistence.testing.models.employee.domain.Address)2 Order (org.eclipse.persistence.testing.models.transparentindirection.Order)2 Connection (java.sql.Connection)1