use of javax.jdo.PersistenceManagerFactory in project tests by datanucleus.
the class CacheTest method testDetachAllOnCommitWithL2.
/**
* Basic test for "detachAllOnCommit" WITH L2 cache usage.
*/
public void testDetachAllOnCommitWithL2() {
Properties userProps = new Properties();
userProps.setProperty(PropertyNames.PROPERTY_DETACH_ALL_ON_COMMIT, "true");
userProps.setProperty(PropertyNames.PROPERTY_CACHE_L1_TYPE, "weak");
userProps.setProperty(PropertyNames.PROPERTY_CACHE_L2_TYPE, "weak");
PersistenceManagerFactory cachePMF = getPMF(1, userProps);
runL2CacheDetachmentTestForPMF(cachePMF, 5);
}
use of javax.jdo.PersistenceManagerFactory in project tests by datanucleus.
the class IdentifierFactoryTest method testJPOX.
/**
* Verify that putting "datanucleus.identifierFactory=jpox" results in JPOXIdentifierFactory being used
*/
public void testJPOX() {
Properties props = new Properties();
props.put("datanucleus.identifierFactory", "jpox");
PersistenceManagerFactory pmf2 = getPMF(1, props);
PersistenceManager pm = pmf2.getPersistenceManager();
ExecutionContext ec = ((JDOPersistenceManager) pm).getExecutionContext();
IdentifierFactory identifierFactory = ((RDBMSStoreManager) ec.getStoreManager()).getIdentifierFactory();
assertTrue(identifierFactory instanceof JPOXIdentifierFactory);
}
Aggregations