Search in sources :

Example 21 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class ManualVerificationModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    addRequiredSystem(new MappingSystem());
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new InheritanceSystem());
    addRequiredSystem(new InsuranceSystem());
    addRequiredSystem(new ReadOnlySystem());
}
Also used : InsuranceSystem(org.eclipse.persistence.testing.models.insurance.InsuranceSystem) ReadOnlySystem(org.eclipse.persistence.testing.models.readonly.ReadOnlySystem) InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 22 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class MultipleClientBrokersTestModel method reset.

/**
 * Because this changes the database it must put it back to a valid state.
 */
@Override
public void reset() {
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    getExecutor().getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
}
Also used : EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 23 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class SessionsXMLBasicTestModel method setup.

@Override
public void setup() {
    originalSession = getSession();
    if ((getSession().getPlatform() instanceof TimesTenPlatform)) {
        throw new TestProblemException("This model is not intended for TimesTen databases.");
    }
    XMLSessionConfigLoader xmlLoader = new XMLSessionConfigLoader("org/eclipse/persistence/testing/models/sessionsxml/sessions.xml");
    // Do not login here, login later on.
    newXMLSession = SessionManager.getManager().getSession(xmlLoader, "EmployeeSession", getClass().getClassLoader(), false, true);
    newXMLSession.setSessionLog(originalSession.getSessionLog());
    newXMLSession.setLogLevel(originalSession.getLogLevel());
    ((DatabaseSession) originalSession).logout();
    newXMLSession.getLogin().setPlatform(originalSession.getLogin().getPlatform());
    newXMLSession.getLogin().setDriverClassName(originalSession.getLogin().getDriverClassName());
    newXMLSession.getLogin().setConnectionString(originalSession.getLogin().getConnectionString());
    newXMLSession.getLogin().setUserName(originalSession.getLogin().getUserName());
    newXMLSession.getLogin().setEncryptedPassword(originalSession.getLogin().getPassword());
    ((DatabaseSession) newXMLSession).login();
    getExecutor().setSession(newXMLSession);
    new EmployeeSystem().createTables((DatabaseSession) newXMLSession);
    new EmployeeSystem().populate((DatabaseSession) newXMLSession);
}
Also used : DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) TimesTenPlatform(org.eclipse.persistence.platform.database.TimesTenPlatform) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) XMLSessionConfigLoader(org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 24 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class DatabaseSessionAttemptLoginTwiceTest method test.

@Override
public void test() {
    EmployeeSystem employeeSystem = new EmployeeSystem();
    DatabaseLogin databaseLogin = (DatabaseLogin) getSession().getLogin().clone();
    employeeSystem.project.setLogin(databaseLogin);
    DatabaseSession newSession = employeeSystem.project.createDatabaseSession();
    newSession.login();
    try {
        newSession.login();
    } catch (org.eclipse.persistence.exceptions.EclipseLinkException e) {
        this.caughtException = e;
    } finally {
        newSession.logout();
    }
}
Also used : DatabaseLogin(org.eclipse.persistence.sessions.DatabaseLogin) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 25 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class DatabaseSessionLogoutThenLoginTest method test.

@Override
public void test() {
    EmployeeSystem employeeSystem = new EmployeeSystem();
    DatabaseLogin databaseLogin = (DatabaseLogin) getSession().getLogin().clone();
    employeeSystem.project.setLogin(databaseLogin);
    DatabaseSession newSession = employeeSystem.project.createDatabaseSession();
    newSession.login();
    try {
        newSession.logout();
        newSession.login();
    } catch (org.eclipse.persistence.exceptions.EclipseLinkException e) {
        this.caughtException = e;
    } finally {
        if (newSession.isConnected()) {
            newSession.logout();
        }
    }
}
Also used : DatabaseLogin(org.eclipse.persistence.sessions.DatabaseLogin) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) EclipseLinkException(org.eclipse.persistence.exceptions.EclipseLinkException) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Aggregations

EmployeeSystem (org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)28 InheritanceSystem (org.eclipse.persistence.testing.models.inheritance.InheritanceSystem)8 InsuranceSystem (org.eclipse.persistence.testing.models.insurance.InsuranceSystem)7 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)5 DatabaseLogin (org.eclipse.persistence.sessions.DatabaseLogin)2 EventHookSystem (org.eclipse.persistence.testing.models.events.EventHookSystem)2 OwnershipSystem (org.eclipse.persistence.testing.models.ownership.OwnershipSystem)2 IndirectListSystem (org.eclipse.persistence.testing.models.transparentindirection.IndirectListSystem)2 org.eclipse.persistence.testing.tests.unitofwork (org.eclipse.persistence.testing.tests.unitofwork)2 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)1 EclipseLinkException (org.eclipse.persistence.exceptions.EclipseLinkException)1 DatabasePlatform (org.eclipse.persistence.internal.databaseaccess.DatabasePlatform)1 DatabaseSessionImpl (org.eclipse.persistence.internal.sessions.DatabaseSessionImpl)1 ForeignReferenceMapping (org.eclipse.persistence.mappings.ForeignReferenceMapping)1 ManyToManyMapping (org.eclipse.persistence.mappings.ManyToManyMapping)1 OneToOneMapping (org.eclipse.persistence.mappings.OneToOneMapping)1 TimesTenPlatform (org.eclipse.persistence.platform.database.TimesTenPlatform)1 Project (org.eclipse.persistence.sessions.Project)1 SessionBroker (org.eclipse.persistence.sessions.broker.SessionBroker)1 XMLSessionConfigLoader (org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader)1