Author: epbernard
Date: 2010-07-30 06:10:24 -0400 (Fri, 30 Jul 2010)
New Revision: 20087
Modified:
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/JBossTSTest.java
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/infra/H2dataSourceProvider.java
Log:
HSEARCH-562 Add JTA test with JBoss TS: Clean test execution
Put db in a temp directory and erase it when done.
Likewise, erase JBoss TS default directory for recovery.
Modified:
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/JBossTSTest.java
===================================================================
---
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/JBossTSTest.java 2010-07-30
10:09:48 UTC (rev 20086)
+++
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/JBossTSTest.java 2010-07-30
10:10:24 UTC (rev 20087)
@@ -1,5 +1,6 @@
package org.hibernate.search.test.integration.jbossjta;
+import java.io.File;
import java.util.HashMap;
import java.util.List;
import javax.persistence.EntityManager;
@@ -39,9 +40,13 @@
public class JBossTSTest {
private static EntityManagerFactory factory;
+ public static File tempDirectory = new File( "./test-tmp" );
@BeforeClass
public static void setUp() throws Exception {
+ FileHelper.delete( tempDirectory );
+ tempDirectory.mkdir();
+
TxControl.setDefaultTimeout(0);
H2dataSourceProvider dsProvider = new H2dataSourceProvider();
final XADataSource h2DataSource = dsProvider.getDataSource(
dsProvider.getDataSourceName() );
@@ -85,6 +90,8 @@
@AfterClass
public static void tearDown() {
factory.close();
+ FileHelper.delete( tempDirectory );
+ FileHelper.delete( new File("./PutObjectStoreDirHere") );
}
@Test
Modified:
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/infra/H2dataSourceProvider.java
===================================================================
---
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/infra/H2dataSourceProvider.java 2010-07-30
10:09:48 UTC (rev 20086)
+++
search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/integration/jbossjta/infra/H2dataSourceProvider.java 2010-07-30
10:10:24 UTC (rev 20087)
@@ -17,7 +17,7 @@
static {
final JdbcDataSource dataSource = new JdbcDataSource();
- dataSource.setURL( "jdbc:h2:file:h2db" );
+ dataSource.setURL( "jdbc:h2:file:./test-tmp/h2db" );
dataSource.setUser( "sa" );
dataSource.setPassword( "" );
dynamicClass = new DataSourceByNameProvider( DATASOURCE_NAME, dataSource );
Show replies by date