Articles for February, 2012

Ordering your JUnit Rules using a RuleChain

Tuesday, February 21st, 2012

JUnit Rules are a handy solution if one needs to alter test methods or wants to share common functionality between several test cases. JUnit 4.10 introduced a new class to order several rules according to our needs using a so called rule-chain.

In the following example, we’re going to create a simple custom rule and afterwards bind several instances of it in a specified order to a test method.

(more…)

JPA Persistence and Lucene Indexing combined in Hibernate Search

Sunday, February 5th, 2012

Often we’re writing an application that has to handle entities that – on the one side need to be persisted in a relational database using standards like the Java Persistence API (JPA) and using frameworks like Hibernate ORM or EclipseLink.

On the other side those entities and their fields are often stored in a highspeed indexer like Lucene. From this situation arises a bunch of common problems .. to synchronize both data sources, to handle special data mapped in an entity like an office document and so on..

Hibernate Search makes this all a lot easier for us as we’re hopefully going to see in the following short tutorial…

(more…)

Search
Categories