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));
}
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));
}
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);
}
}
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;
}
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() {
}
};
}
Aggregations