use of org.eclipse.persistence.platform.database.TimesTenPlatform 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);
}
Aggregations