use of org.eclipse.persistence.internal.jpa.metamodel.BasicTypeImpl in project eclipselink by eclipse-ee4j.
the class MetamodelMetamodelTest method testBasicType.
public void testBasicType() {
EntityManager em = null;
boolean exceptionThrown = false;
try {
em = privateTestSetup();
assertNotNull(em);
Metamodel metamodel = em.getMetamodel();
assertNotNull("The metamodel should never be null after an em.getMetamodel() call here.", metamodel);
// This interface is empty - however we can test BasicTypeImpl INTERNAL functionality
// Test lazy creation of random basic types
TypeImpl aRandomType = ((MetamodelImpl) metamodel).getType(Integer.class);
assertEquals(Type.PersistenceType.BASIC, aRandomType.getPersistenceType());
BasicTypeImpl aRandomBasicType = (BasicTypeImpl) aRandomType;
assertFalse(aRandomBasicType.isEntity());
assertFalse(aRandomBasicType.isMappedSuperclass());
} catch (IllegalArgumentException iae) {
iae.printStackTrace();
exceptionThrown = true;
} finally {
cleanup(em);
assertFalse("An IAE exception should not occur here.", exceptionThrown);
}
}
Aggregations