*/
@SuppressWarnings("deprecation")
public void testSetHintAddHintsArgument() {
EntityManager em = emf.createEntityManager();
OpenJPAEntityManager oem = (OpenJPAEntityManager)em.getDelegate();
JDBCFetchPlan fPlan = (JDBCFetchPlan) oem.getFetchPlan();
fPlan.setHint("unrecognized.prop.name", "unrecognized.prop.value");
assertEquals(null, fPlan.getHint("unrecognized.prop.name"));
OpenJPAConfiguration conf = oem.getConfiguration();
if (conf instanceof JDBCConfiguration
&& ((JDBCConfiguration) conf).getDBDictionaryInstance()
.supportsIsolationForUpdate()) {
try {
fPlan.setHint("openjpa.jdbc.TransactionIsolation", 9999);
fail("Expecting a a IllegalArgumentException.");
} catch (Exception e) {
assertTrue("Caught expected exception",
IllegalArgumentException.class.isAssignableFrom(e.getClass()));
}
}
try {
fPlan.setHint("openjpa.FetchPlan.Isolation", new Integer(13));
fPlan.setHint("openjpa.FetchPlan.Isolation", new Integer(14));
fail("Expecting a IllegalArgumentException.");
} catch (Exception e) {
assertTrue("Caught expected exception",
IllegalArgumentException.class.isAssignableFrom(e.getClass()));
}