Search in sources :

Example 1 with EntityManagerSetupException

use of org.eclipse.persistence.exceptions.EntityManagerSetupException in project eclipselink by eclipse-ee4j.

the class TestSchemaGen method testJTASchemaGenerationWithoutProps.

/**
 * This test checks the inverse of
 * TestSchemaGen.testJTASchemaGenerationWithProps() Without the 2.1
 * properties defined, generating schema should fail with no JTA-DS defined.
 */
@Test
public void testJTASchemaGenerationWithoutProps() throws Exception {
    Exception e = null;
    try {
        Persistence.generateSchema(jtaPersistenceUnit, new Properties());
    } catch (Exception pe) {
        e = pe;
    }
    Assert.assertNotNull(e);
    Throwable base = getBaseException(e);
    Assert.assertTrue(base instanceof EntityManagerSetupException);
}
Also used : EntityManagerSetupException(org.eclipse.persistence.exceptions.EntityManagerSetupException) Properties(java.util.Properties) PersistenceUnitProperties(org.eclipse.persistence.config.PersistenceUnitProperties) EntityManagerSetupException(org.eclipse.persistence.exceptions.EntityManagerSetupException) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)1 PersistenceUnitProperties (org.eclipse.persistence.config.PersistenceUnitProperties)1 EntityManagerSetupException (org.eclipse.persistence.exceptions.EntityManagerSetupException)1 Test (org.junit.Test)1