Search in sources :

Example 1 with Oracle12Platform

use of org.eclipse.persistence.platform.database.oracle.Oracle12Platform in project eclipselink by eclipse-ee4j.

the class XDBTestModel method addForcedRequiredSystems.

@Override
public void addForcedRequiredSystems() {
    addForcedRequiredSystem(new XMLTypeEmployeeSystem());
    oldPlatform = getSession().getPlatform();
    if (!(oldPlatform instanceof OraclePlatform)) {
        throw new TestProblemException("This model is intended for Oracle databases through OCI");
    }
    this.getSession().getLogin().setPlatform(new Oracle12Platform());
    getDatabaseSession().logout();
    getDatabaseSession().login();
    try {
        super.addForcedRequiredSystems();
    } catch (Exception ex) {
        String message = ex.getMessage();
        if ((message != null) && (message.indexOf("invalid datatype") > 0)) {
            throw new TestProblemException("This model will only work on Oracle 9i and up");
        } else {
            throw new TestProblemException("Error occurred", ex);
        }
    }
}
Also used : TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) Oracle12Platform(org.eclipse.persistence.platform.database.oracle.Oracle12Platform) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) OraclePlatform(org.eclipse.persistence.platform.database.OraclePlatform)

Aggregations

OraclePlatform (org.eclipse.persistence.platform.database.OraclePlatform)1 Oracle12Platform (org.eclipse.persistence.platform.database.oracle.Oracle12Platform)1 TestProblemException (org.eclipse.persistence.testing.framework.TestProblemException)1