@Test public void testPersistenceUnitConfigurationException() { PersistenceUnitConfigurationException exception = new PersistenceUnitConfigurationException("Error with string"); Assert.assertNotNull(exception); exception = new PersistenceUnitConfigurationException(new RuntimeException()); Assert.assertNotNull(exception); exception = new PersistenceUnitConfigurationException(); Assert.assertNotNull(exception); exception = new PersistenceUnitConfigurationException("KunderaTests", new RuntimeException()); Assert.assertNotNull(exception); exception = new PersistenceUnitConfigurationException("error with string "); Assert.assertNotNull(exception); exception = new PersistenceUnitConfigurationException(new RuntimeException()); Assert.assertNotNull(exception); }
@Override public void configure() { log.info("Loading Metadata from persistence.xml ..."); ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata(); try { Map<String, PersistenceUnitMetadata> metadatas = findPersistenceMetadatas(); for (String persistenceUnit : persistenceUnits) { if (!metadatas.containsKey(persistenceUnit)) { log.error("Unconfigured persistence unit: " + persistenceUnit + " please validate with persistence.xml"); throw new PersistenceUnitConfigurationException("Invalid persistence unit: " + persistenceUnit + " provided"); } } log.info("Finishing persistence unit metadata configuration ..."); appMetadata.addPersistenceUnitMetadata(metadatas); } catch (InvalidConfigurationException icex) { log.error("Error occurred during persistence unit configuration, Caused by: .", icex); throw new PersistenceLoaderException(icex); } }
throw new PersistenceUnitConfigurationException( "For Neo4J, it's mandatory to specify kundera.datastore.file.path property in persistence.xml");
throw new PersistenceUnitConfigurationException("Invalid persistence provider : " + puInfo.getPersistenceProviderClassName() + ", persistence provider must be " + PROVIDER_IMPLEMENTATION_NAME + ".");
throw new PersistenceUnitConfigurationException( "For Neo4J, it's mandatory to specify kundera.datastore.file.path property in persistence.xml");