use of org.eclipse.persistence.sessions.Project in project eclipselink by eclipse-ee4j.
the class SimpleMapProject method setUp.
@BeforeClass
public static void setUp() {
DynamicClassLoader dcl = new DynamicClassLoader(SimpleMapProject.class.getClassLoader());
Project project = null;
try {
project = DynamicTypeBuilder.loadDynamicProject(PROJECT_XML, createLogin(), dcl);
} catch (IOException e) {
// e.printStackTrace();
fail("cannot find simple-map-project.xml");
}
session = project.createDatabaseSession();
if (SessionLog.OFF == logLevel) {
session.dontLogMessages();
} else {
session.setLogLevel(logLevel);
}
dynamicHelper = new DynamicHelper(session);
session.login();
new DynamicSchemaManager(session).createTables();
}
use of org.eclipse.persistence.sessions.Project in project eclipselink by eclipse-ee4j.
the class SimpleMapProjectNoLogin method setUp.
@BeforeClass
public static void setUp() {
DynamicClassLoader dcl = new DynamicClassLoader(SimpleMapProjectNoLogin.class.getClassLoader());
Project project = null;
try {
project = DynamicTypeBuilder.loadDynamicProject(PROJECT_XML, createLogin(), dcl);
} catch (IOException e) {
// e.printStackTrace();
fail("cannot find simple-map-project-no-login.xml");
}
session = project.createDatabaseSession();
if (SessionLog.OFF == logLevel) {
session.dontLogMessages();
} else {
session.setLogLevel(logLevel);
}
dynamicHelper = new DynamicHelper(session);
session.login();
new DynamicSchemaManager(session).createTables();
}
use of org.eclipse.persistence.sessions.Project in project eclipselink by eclipse-ee4j.
the class DynamicTestingHelper method createSession.
public static DatabaseSession createSession() {
if (username == null) {
fail("error retrieving database username");
}
if (password == null) {
fail("error retrieving database password");
}
if (url == null) {
fail("error retrieving database url");
}
Project project = new Project(createLogin());
DatabaseSession session = project.createDatabaseSession();
if (SessionLog.OFF == logLevel) {
session.dontLogMessages();
} else {
session.setLogLevel(logLevel);
}
return session;
}
use of org.eclipse.persistence.sessions.Project in project eclipselink by eclipse-ee4j.
the class ClientSessionBrokerTestAdapter method setupTestSession.
@Override
public Session setupTestSession(Session oldSession) {
DatabaseLogin login = (DatabaseLogin) oldSession.getLogin().clone();
Project project = oldSession.getProject().clone();
project.setLogin(login);
this.server = new org.eclipse.persistence.testing.tests.clientserver.Server(project);
this.server.serverSession.setLogLevel(oldSession.getLogLevel());
this.server.serverSession.setLog(oldSession.getLog());
this.server.login();
this.server.copyDescriptors(oldSession);
SessionBroker broker = new SessionBroker();
broker.registerSession("serverSession", this.server.serverSession);
// didn't login the broker. Not needed and worried about why copyDescriptors above was for.
return broker.acquireClientSessionBroker();
}
use of org.eclipse.persistence.sessions.Project in project eclipselink by eclipse-ee4j.
the class ReadOnlyClassesInSessionBrokerTest method setup.
@Override
public void setup() {
ServerSession serverSession;
Project project = new org.eclipse.persistence.testing.models.readonly.ReadOnlyProject();
DatabaseLogin login = project.getLogin();
login.usePlatform(new OraclePlatform());
login.setDriverClassName("oracle.jdbc.OracleDriver");
login.setConnectionString("jdbc:oracle:thin:@ottvm028.ca.oracle.com:1521:toplink");
login.setUserName("QA6");
login.setPassword("password");
serverSession = (ServerSession) project.createServerSession();
this.sessionBroker = new SessionBroker();
this.sessionBroker.registerSession("broker1", serverSession);
this.sessionBroker.login();
}
Aggregations