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

O Java EE 6 Application Servers, Where Art Thou?

Nearly two years ago (time flies), when Java EE 6 came out, I wrote a post about application servers where I did some micro benchmarking (basically, startup time). I had plenty of comments and recently I had many people asking for some updates. Witht Java EE 6 booming, with some cloud vendors moving to Java EE 6, it was time to update this microbenchmark and focus on Java EE 6 application servers. BTW, if you want to know what Java EE 6 is, you can check the slides of a presentationI gave a few times.

The benchmark

Same disclaimer as last time : This is not a real benchmark ! so I’ll copy paste the paragraph I wrote last time :

In this test I’m just concerned about the usability of an application server for a developer. The idea is to download it, install it, start it and take some measurements : size of download, ease of installation, size of disk, startup time, size of RAM. Continue reading O Java EE 6 Application Servers, Where Art Thou?

Walking through the Java EE 6 implementation maze

I’ve been asked so many times “what are the implementations of such or such specification in Java EE 6 ?” or “what is the reference implementation of such a spec ?“. Because I always forget some (and to be honest, sometimes I don’t even know if a spec has several implementations of not), I’m writing this post to help me (and you) to remember.

So here is a non-exhaustive list of the several Java EE 6 implementations (please leave a comment to add anything to this list) … Continue reading Walking through the Java EE 6 implementation maze

Adding CDI to an existing Java EE 6 application

In my previous post I’ve shown you how to bootstrap CDI in several environments (GlassFish, Tomcat, Jetty, Java SE). So now let’s go a bit further and use it in real code. As its name states, CDI (Contexts and Dependency Injection) is also about Dependency Injection, so let’s focus on just this feature for now. I will not define what DI (Dependency Injection) is. If you don’t know I’ll leave you to check the definition, the origins of this pattern and even a book that covers it all. Continue reading Adding CDI to an existing Java EE 6 application

Bootstrapping CDI in several environments

I feel like writing some posts about CDI (Contexts and Dependency Injection). So this is the first one of a series of x posts (0<x<10). I will not go through the entire history of CDI (formerly called Web Beans, splitted in two JSRs… and so on), but will try to give you information on how to use it in different environments, explain you injection, context management, scoping, decorators and so on. So you can think of this series of posts as a humble step by step CDI tutorial. You can also read the very good documentation on the JBoss website (where I got some help and inspiration).
Continue reading Bootstrapping CDI in several environments

Java EE 6 ? Excuse my French !

It’s been a long time since I haven’t blogged about what I am doing on evenings and week-ends. For people who think that I watch TV and have BBQs on Saturdays, I have to tell you that I don’t have any TV (it’s been over 20 years now) and I don’t have a garden to cook my burgers. No, I’ve spent my spare time updating my Java EE 6 book.

In this second edition I have updated the content and added new sections. When the first version of the book got out it was in June 2009 and Java EE 6 hadn’t been released yet (December 2009). So there were some topics that I didn’t cover because they were not completely finished (like the Criteria API in JPA 2.0). I’ve also updated the frameworks (GlassFish 3.0.1) and the code so it’s more accurate. The book is planned to be published in September 2010. As always there is a full list of people I need to thank for this second edition. Writing or updating a book is hard work and comfort is always needed. Continue reading Java EE 6 ? Excuse my French !

Dédicace du livre Java EE 6

Aujourd’hui, les exemplaires du livre Java EE 6 sont enfin arrivés en Europe. J’ai reçu ma petite collection privée de 20 exemplaires ainsi que tous les bons libraires informatiques parisiens. Alors, si vous faites partis des quelques rares qui n’ont pas encore ce best-seller, je vous propose de nous retrouver samedi 20 juin à la librairie Le Monde En Tique de 15h50 à 18h pour … Continue reading Dédicace du livre Java EE 6

Bienvenu chez le Ch’ti JUG

Dans la famille Présentation Java EE 6, je voudrai les Ch’tis. Qques jours après mes présentations GlassFish et Java EE 6 à la conférence GeeCon à Cracovie, ce soir je me suis rendu à Lille pour présenter les nouveautés de la future plateforme entreprise. Dernier en date de la longue lignée des JUGs français, le Ch’ti JUG était inauguré ce soir en grandes pompes : … Continue reading Bienvenu chez le Ch’ti JUG

Présentation Java EE 6 au Ch’ti JUG

2008, c’était l’année de Bienvenue chez les Ch’tis. 2009 c’est l’année du Ch’ti JUG. Mais non, je ne ponctuerai pas ce post de “biloute”, ‘j’te dis quoi” et autres “heiiinnnnn!”. En fait, je veux juste vous informer de l’événement del ch’nord (ha, je me suis laissé aller là) à ne pas louper : une présentation sur Java EE 6 pour l’inauguration du Ch’ti JUG. Hé … Continue reading Présentation Java EE 6 au Ch’ti JUG

Looking for Java EE 6 expert members to organize a BOF at Jazoon

Jazoon, the international conference on Java technology, will be held in Zurich from the 22nd to the 25th of June. For four days you will have the chance to go to many technical presentations, with good speakers and also plenty of BOFs. I‘ve sumitted a talk on Java EE 6 and I‘ve also submitted a BOF on the same topic. The BOF is called Why … Continue reading Looking for Java EE 6 expert members to organize a BOF at Jazoon

Java EE 6 Book

In today’s business world, applications need to access data, apply business logic, add presentation layers, and communicate with external systems. That’s what companies are trying to achieve while minimizing costs, using standard and robust technologies that can handle heavy loads. If that’s your case, you have the right book in your hands.

Java Enterprise Edition appeared at the end of the 1990s and brought to the Java language a robust software platform for enterprise development. Challenged at each new version, badly understood or misused, overengineered, and competing with open source frameworks, J2EE was seen as a heavyweight technology. Java EE benefited from these criticisms to improve and is today focused on simplicity.

Continue reading Java EE 6 Book