	@Test
	public void testConnection() throws IOException, SQLException {

		final Properties settings = createDefaultSettings();
		final EntityImporter entityImporter = new EntityImporter(settings);

		final EntityManagerFactory emf = Persistence.createEntityManagerFactory("test", settings);
		try {
			final EntityManager em = emf.createEntityManager();
			try {
				try (Connection connection = em.unwrap(SessionImpl.class).getJdbcConnectionAccess()
						.obtainConnection()) {
					entityImporter.importData(connection);
					connection.commit();
				}

				// Check that all entities found their way to the database
				final List<TestEntity> entities = em.createQuery("SELECT e FROM TestEntity e", TestEntity.class)
						.getResultList();

				// TextEntity.xml + TestData + DependentConstructorData + DependentResourceData + InjectTestData
				final int expectedEntities = 9 + 3 + 1 + 1 + 2;
				assertThat(entities).hasSize(expectedEntities);
			} finally {
				em.close();
			}
		} finally {
			emf.close();
		}
	}