Unit testing algorithms

In the last weeks, I've been improving my computer science knowledge by solving programming problems. Since these problems have multiple solutions, I find myself writing duplicated unit tests. And refactoring these tests is cumbersome (if find&replace doesn't work). To make the point clear, I'm going to pick a problem with many possible implementations: sorting an … Continue reading Unit testing algorithms

Testing JPQL queries straight from Intellij

In my current project, most of the queries are written in Java Persistence Query Language (JPQL). As with any *QL (that eventually gets translated to SQL), it’s cumbersome to do the translation of the *QL to SQL and vice-versa. This translation is generally done when you’re creating a new query or trying to debug an … Continue reading Testing JPQL queries straight from Intellij

Excluding Hibernate entities from auto-generation

Today I had to do something completely new with Hibernate, within the scope of a unit test. I had a group of entities and wanted to exclude one of them from the schema auto-generation (hibernate.hbm2ddl.auto=create). After spending a couple of hours trying out different things and reading Stackoverflow answers, I hit jackpot with this cool … Continue reading Excluding Hibernate entities from auto-generation