You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am using arquillian-persistence-dbunit with Spring java configuration, I always get this error org.jboss.arquillian.transaction.impl.lifecycle.TransactionProviderNotFoundException.
My Test class :
@RunWith(Arquillian.class)
@Transactional(PersistanceTestConfig.TRANSACTION_NAME)
@SpringAnnotationConfiguration(classes = {ArquillianConfiguration.class})
@DataSource(PersistanceTestConfig.MY_DATASOURCE)
@UsingDataSet({"database/myDataset.yml"})
public class MyTestClass{
@Deployment(testable = false)
public static WebArchive createArchive(){
//returns a webArchive
}
@Test
public void myTestMethod(){
//do something
}
}
My Persistence SpringConfig :
public class PersistanceTestConfig {
public static final String TRANSACTION_NAME = "transaction";
public static final String MY_DATASOURCE = "myDatasource";
private Properties getJPAProperties() {
final Properties jpaProperties = new Properties();
jpaProperties.setProperty("hibernate.hbm2ddl.auto", "create");
jpaProperties.setProperty("hibernate.show_sql", "true");
jpaProperties.setProperty("hibernate.format_sql", "true");
jpaProperties.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
return jpaProperties;
}
@Bean(name = MY_DATASOURCE)
public DataSource getDataSource(){
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL)
.continueOnError(false).ignoreFailedDrops(true).build();
}
@Bean
@Autowired
public LocalContainerEntityManagerFactoryBean getEntityManagerREFCS( DataSource dataSource) {
final LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
localContainerEntityManagerFactoryBean.setDataSource(dataSource);
localContainerEntityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
localContainerEntityManagerFactoryBean.setPackagesToScan("com.myapp.dao.beans");
localContainerEntityManagerFactoryBean.setPersistenceUnitName("pUnitName");
localContainerEntityManagerFactoryBean.setJpaProperties(getJPAProperties());
return localContainerEntityManagerFactoryBean;
}
}
When I am using
arquillian-persistence-dbunit
with Spring java configuration, I always get this errororg.jboss.arquillian.transaction.impl.lifecycle.TransactionProviderNotFoundException
.My Test class :
My Persistence SpringConfig :
You can have more insight of the problem here
The text was updated successfully, but these errors were encountered: