The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

petar.tahchiev (11) [Avatar] Offline
#1
Hi everybody,

Welcome to the JUnit in Action 2nd Edition (JIA2) forum. Please use this forum to post your comments about the JIA2 code or text.

Petar
aldian (5) [Avatar] Offline
#2
Re: Welcome to the new edition of "JUnit in Action"
hi, I just bought the second edition e-book draft.
I hope this book will also cover EJB 3 testing.
Thank you.

Aldian
felipe.leme (18) [Avatar] Offline
#3
Re: Welcome to the new edition of "JUnit in Action"
Hi Aldian,

What kind of EJB3 testing are you interested in?

I mean, we will write about testing JPA entities and also on using Cactus for in-container testing, but nothing too specific for EJB 3. We will cover EJB 3 when appliablue, but I don't think the technology deserves a topic of its own - in fact, one of the great advantages of EJB 3 (compared to its predecessors) is that it's much easier to test them as POJOs.

But if you think we are missing something, please let us know.

Regards,

-- Felipe
aldian (5) [Avatar] Offline
#4
Re: Welcome to the new edition of "JUnit in Action"
I might have coded my EJB 3 methods wrongly.
I put JNDI lookups in my EJB 3, so it is difficult for me to test it as POJOs. How to test EJB 3 methods in such condition? should I mock the JNDI, or use cactus, or just fix my code?
thank you.

Aldian
aldian (5) [Avatar] Offline
#5
Re: Welcome to the new edition of "JUnit in Action"
My JNDI lookup is dynamic. It is based on the bean method string parameter, so I cannot change the lookup to annotation.

regards,

Aldian
petar.tahchiev (11) [Avatar] Offline
#6
Re: Welcome to the new edition of "JUnit in Action"
Hi Aldian,

as I see the situation you currently have two options - the first one is to simulate the JNDI lookup with Mock objects, and the second one is to write in-container tests with Cactus. We cover Mock objects in the whole second part of the book, and I am currently writing chapter 14 about in-container testing with Cactus (I have included a section on how to test EJBs). You are free to choose whichever method you want, and I think our book will cover it good.

Cheers, Petar.
aldian (5) [Avatar] Offline
#7
Re: Welcome to the new edition of "JUnit in Action"
great, thanks