Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Use hibernate test cache when running tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Munoz committed Feb 28, 2013
1 parent 8cc443c commit e8ace01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions zanata-war/pom.xml
Expand Up @@ -1335,6 +1335,13 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-testing</artifactId>
<version>${hibernate.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion zanata-war/src/test/resources/META-INF/persistence.xml
Expand Up @@ -56,7 +56,8 @@

<properties>
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory" />
<!-- Use test version of hibernate cache -->
<property name="hibernate.cache.region.factory_class" value="org.hibernate.testing.cache.CachingRegionFactory" />
<property name="hibernate.hbm2ddl.auto" value="create"/>

<property name="hibernate.connection.driver_class" value="org.h2.Driver" />
Expand Down

3 comments on commit e8ace01

@seanf
Copy link
Contributor

@seanf seanf commented on e8ace01 Jul 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlosmunoz Do you remember what this change was for? It came up yesterday when I was trying to get the tests working with the WildFly profile.

@seanf
Copy link
Contributor

@seanf seanf commented on e8ace01 Jul 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.hibernate.testing.cache.CachingRegionFactory doesn't have any documentation I can find, but it seems to be backed by ConcurrentHashMaps. So would you say it's just an in-memory cache for use in unit tests?

@carlosmunoz
Copy link
Member

@carlosmunoz carlosmunoz commented on e8ace01 Jul 5, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.