use of org.datanucleus.samples.rdbms.datastore.AReallyObnoxiouslyLongWindedNamedObject in project tests by datanucleus.
the class SchemaTest method testClassWithLongName.
/**
* Test for a class with a very long name that exceeds the maximum length for the schema.
* Checks that the name of the table in the schema is truncated (or rather that it doesnt throw an exception, i.e auto-truncates it).
* @throws Exception
*/
public void testClassWithLongName() throws Exception {
addClassesToSchema(new Class[] { AReallyObnoxiouslyLongWindedNamedObject.class });
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
try {
tx.begin();
AReallyObnoxiouslyLongWindedNamedObject obj = new AReallyObnoxiouslyLongWindedNamedObject("Test");
pm.makePersistent(obj);
pm.flush();
pm.getExtent(AReallyObnoxiouslyLongWindedNamedObject.class);
tx.rollback();
} catch (Exception e) {
LOG.error(e);
fail(e.toString());
} finally {
if (tx.isActive()) {
tx.rollback();
}
pm.close();
}
}
Aggregations