Generating Database Schemas with JPA 2.1

Prior JPA 2.1, most JPA providers (Hibernate, EclipseLink, OpenJPA) would have a proprietary way to generate the database schema (Data Definition Language scripts) from Entities. In the JPA 2.1 specification (JSR 338) there is a new section called 9.4 Schema Generation introducing an API and some properties to generate a database schema in a standard and portable way. Properties in persistence.xml In the history of JPA specification, we … Continue reading Generating Database Schemas with JPA 2.1

Test your JAX-RS 2.0 Web Service URIs… Without Mocks

After the announcement of the NoMock Movement I had to write another post about integration testing. Here it goes  : how to test your nice RESTful URIs ? Use Case Often you hear that URIs have to be expressive… and you want to test that your URIs are nicely written. How do you do that ? Unit testing with mock frameworks such as Restito or … Continue reading Test your JAX-RS 2.0 Web Service URIs… Without Mocks

Let’s Turn Integration Tests with Maven to a First-Class Citizen

I would like to thank Arnaud Heritier who gave me plenty of tips and advices to write this blog. In fact if you want to endorse someone on Maven in LinkedIn, he is the man, not me ;o) If you use Maven in your projects you might wonder what “Let’s Turn Integration Tests with Maven into a First-Class Citizen” means. A bit of introduction on that. … Continue reading Let’s Turn Integration Tests with Maven to a First-Class Citizen

No, you don’t need to mock your SOAP Web Service to test it

A short blog about a topic I was discussing last week with a customer: testing SOAP Web Services. If you follow my blog you would know by now that I’m not a fan of unit testing in MOCK environments. Not because I don’t like it or I have religious believes that don’t allow me to use JUnit and Mockito. It’s just because with the work I do (mostly … Continue reading No, you don’t need to mock your SOAP Web Service to test it

WYTIWYR : What You Test Is What You Run

I’m fed up with unit testing !

It’s 2012 and my first resolution of the year is to finally tell the truth about testing : unit testing is pretty much useless when your code runs inside a container. How do you unit test an EJB which relies on the container services (i.e transaction, injection, security…) ? Well, you mock the database access, you mock your security layer, you mock your dependencies, you mock your validation layer… to test what ? A bit of business logic. Yes. Unit test is interesting when you have complex business logic to test so you can have quick feedback. Otherwise, it’s a waste of time which doesn’t test your container services. So I’m not saying unit testing is completely useless, I’m saying that integration testing is also to be considered when you run your code inside a Java EE container. Continue reading WYTIWYR : What You Test Is What You Run