public void addDescriptors(DatabaseSession session) { session.logout(); super.addDescriptors(session); // Force re-initialize. session.login(); }
public void test() { EmployeeProjectForIntegrityChecker project = new EmployeeProjectForIntegrityChecker(); project.setDatasourceLogin(getSession().getDatasourceLogin()); DatabaseSession session = new Project(getSession().getDatasourceLogin()).createDatabaseSession(); session.dontLogMessages(); boolean caughtError = false; try { session.login(); session.setIntegrityChecker(new IntegrityChecker()); session.getIntegrityChecker().dontCatchExceptions(); session.addDescriptors(project); } catch (DescriptorException exception) { caughtError = true; } finally { session.logout(); } if (!caughtError) { throw new TestErrorException("Test is Failed, no exception was thrown"); } }
/** Test database session creation. */ @Test public void testDatabaseSession() throws Exception { DatabaseSession session = SessionHelper.createDatabaseSession(AQTestSuite.project); session.logout(); }