Search in sources :

Example 21 with TestProblemException

use of org.eclipse.persistence.testing.framework.TestProblemException in project eclipselink by eclipse-ee4j.

the class DataNucleusPerformanceRegressionModel method setupProvider.

/**
 * Setup the JPA provider.
 */
@Override
public void setupProvider() {
    // Configure provider to be DataNucleus.
    String providerClass = "org.datanucleus.jpa.PersistenceProviderImpl";
    PersistenceProvider provider = null;
    try {
        provider = (PersistenceProvider) Class.forName(providerClass).getConstructor().newInstance();
    } catch (Exception error) {
        throw new TestProblemException("Failed to create persistence provider.", error);
    }
    Map properties = new HashMap();
    // properties.put("jakarta.persistence.nonJtaDataSource", "datasource");
    properties.put("jakarta.persistence.jdbc.driver", getSession().getLogin().getDriverClassName());
    properties.put("jakarta.persistence.jdbc.url", getSession().getLogin().getConnectionString());
    properties.put("jakarta.persistence.jdbc.user", getSession().getLogin().getUserName());
    properties.put("jakarta.persistence.jdbc.password", getSession().getLogin().getPassword());
    if (getSession().shouldLogMessages()) {
    // properties.put("openjpa.Log", "DefaultLevel=WARN,SQL=TRACE");
    }
    getExecutor().setEntityManagerFactory(provider.createEntityManagerFactory("performance", properties));
}
Also used : HashMap(java.util.HashMap) PersistenceProvider(jakarta.persistence.spi.PersistenceProvider) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) Map(java.util.Map) HashMap(java.util.HashMap) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException)

Example 22 with TestProblemException

use of org.eclipse.persistence.testing.framework.TestProblemException in project eclipselink by eclipse-ee4j.

the class EssentialsJPAPerformanceRegressionModel method setupProvider.

/**
 * Setup the JPA provider.
 */
@Override
public void setupProvider() {
    // Configure provider to be TopLink.
    String providerClass = "oracle.toplink.essentials.PersistenceProvider";
    PersistenceProvider provider = null;
    try {
        provider = (PersistenceProvider) Class.forName(providerClass).getConstructor().newInstance();
    } catch (Exception error) {
        throw new TestProblemException("Failed to create persistence provider.", error);
    }
    Map properties = new HashMap();
    properties.put("toplink.jdbc.driver", getSession().getLogin().getDriverClassName());
    properties.put("toplink.jdbc.url", getSession().getLogin().getConnectionString());
    properties.put("toplink.jdbc.user", getSession().getLogin().getUserName());
    properties.put("toplink.jdbc.password", getSession().getLogin().getPassword());
    properties.put("toplink.logging.level", getSession().getSessionLog().getLevelString());
    getExecutor().setEntityManagerFactory(provider.createEntityManagerFactory("performance", properties));
}
Also used : HashMap(java.util.HashMap) PersistenceProvider(jakarta.persistence.spi.PersistenceProvider) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) Map(java.util.Map) HashMap(java.util.HashMap) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException)

Example 23 with TestProblemException

use of org.eclipse.persistence.testing.framework.TestProblemException in project eclipselink by eclipse-ee4j.

the class BroadcastSetupHelper method startCacheSynchronization.

public void startCacheSynchronization(AbstractSession session, boolean isSource) {
    try {
        sessions.put(session, isSource);
        if (sessions.size() == 1) {
            createFactory();
            startFactory();
        }
        RemoteCommandManager rcm = new RemoteCommandManager(session);
        createTransportManager(rcm);
        session.setShouldPropagateChanges(true);
        rcm.initialize();
        getEventLock().attach(session, isSource);
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new TestProblemException("exception in startCacheSynchronization ", ex);
    }
}
Also used : RemoteCommandManager(org.eclipse.persistence.sessions.coordination.RemoteCommandManager) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) TestErrorException(org.eclipse.persistence.testing.framework.TestErrorException) NamingException(javax.naming.NamingException)

Example 24 with TestProblemException

use of org.eclipse.persistence.testing.framework.TestProblemException in project eclipselink by eclipse-ee4j.

the class RMISessionBrokerRemoteModel method createConnection.

public static RMIConnection createConnection() {
    RMISessionBrokerServerManager serverManager = null;
    // Set the client security manager
    try {
        System.setSecurityManager(new RMISecurityManager());
    } catch (Exception exception) {
        System.out.println("Security violation " + exception.toString());
    }
    // Get the remote factory object from the Registry
    try {
        serverManager = (RMISessionBrokerServerManager) Naming.lookup("SERVER-BROKER-MANAGER");
    } catch (Exception exception) {
        throw new TestProblemException(exception.toString());
    }
    RMIConnection rmiConnection = null;
    try {
        rmiConnection = new RMIConnection(serverManager.createRemoteSessionController());
    } catch (RemoteException exception) {
        System.out.println("Error in invocation " + exception.toString());
    }
    return rmiConnection;
}
Also used : TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) RMIConnection(org.eclipse.persistence.sessions.remote.rmi.RMIConnection) RMISecurityManager(java.rmi.RMISecurityManager) RemoteException(java.rmi.RemoteException) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) RemoteException(java.rmi.RemoteException)

Example 25 with TestProblemException

use of org.eclipse.persistence.testing.framework.TestProblemException in project eclipselink by eclipse-ee4j.

the class Query_SpatialOp_ExpExp_Tests method suite.

public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.setName("Query_SpatialOp_ExpExp_Tests");
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDORelateRectangle"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDORelateCircle"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDORelateArbitraryLine"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOFilterRectangle"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOFilterRectangleNullParams"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOFilterCircle"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOFilterArbitraryLine"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOWithinDistanceRectangle"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOWithinDistanceRectangleUsingMaxResolution"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOWithinDistanceCircle"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOWithinDistanceArbitraryLine"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOWithinDistanceNullParamsMatchingCircle1004"));
    suite.addTest(new Query_SpatialOp_ExpExp_Tests("testSDOWithinDistanceNullParamsNotMatching"));
    return new TestSetup(suite) {

        protected void setUp() {
            try {
                SimpleSpatialTestCase.repopulate(getSession(), true);
            } catch (Exception e) {
                throw new TestProblemException("Could not setup JGeometry test model", e);
            }
        }

        protected void tearDown() {
        }
    };
}
Also used : TestSetup(junit.extensions.TestSetup) TestSuite(junit.framework.TestSuite) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException) TestProblemException(org.eclipse.persistence.testing.framework.TestProblemException)

Aggregations

TestProblemException (org.eclipse.persistence.testing.framework.TestProblemException)48 TestSetup (junit.extensions.TestSetup)18 TestSuite (junit.framework.TestSuite)18 PersistenceProvider (jakarta.persistence.spi.PersistenceProvider)7 HashMap (java.util.HashMap)7 Map (java.util.Map)7 SQLException (java.sql.SQLException)4 Vector (java.util.Vector)3 NamingException (javax.naming.NamingException)3 ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)3 DatabaseAccessor (org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor)3 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)3 TestErrorException (org.eclipse.persistence.testing.framework.TestErrorException)3 TestWarningException (org.eclipse.persistence.testing.framework.TestWarningException)3 RMISecurityManager (java.rmi.RMISecurityManager)2 RemoteException (java.rmi.RemoteException)2 Connection (java.sql.Connection)2 Statement (java.sql.Statement)2 DatabaseException (org.eclipse.persistence.exceptions.DatabaseException)2 Expression (org.eclipse.persistence.expressions.Expression)2