The Artima Developer Community
Sponsored Link

Java Buzz Forum
Testability outside the EJB container (know your product,,,errr,,,what you're testing)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
scot mcphee

Posts: 75
Nickname: scotartt
Registered: Feb, 2004

Scot Mcphee is a Java/J2EE developer for Kaz Technology Services in Sydney, Australia.
Testability outside the EJB container (know your product,,,errr,,,what you're testing) Posted: Aug 6, 2004 8:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by scot mcphee.
Original Post: Testability outside the EJB container (know your product,,,errr,,,what you're testing)
Feed Title: SystemExxception()
Feed URL: http://www.autonomous.org/pebble/systemexxception/rss.xml?category=Java
Feed Description: java design and culture by scot mcphee
Latest Java Buzz Posts
Latest Java Buzz Posts by scot mcphee
Latest Posts From SystemExxception()

Advertisement

Testing outside the container? (see also here)

I think that it should be possible to test your business logic outside of any container but the jvm, yes. So all those big ugly session beans (now don't get me wrong, I like session beans, just not these ones) bloated with fat service logic and business methods ought be be testable without an EJB container. Or, in fact, the entire session bean. When I want to know when my company identity matching logic functions as specified, or credit approval heuristic on known inputs produces the right results, and so on, I don't want a big ugly chunk of infrastructure in my way.

Similarly if I'm using Hibernate for persistence I can also check persistence objects and mock objects to test the DAOs. Outside of having to start up a thing like a J2EE engine like Websphere or Weblogic and installing the beans into that. Much easier to use as little as possible to verify something with a paucity of extra engines. You have to start the JVM anyway, which is not optional in any other case, so they become JVM + Websphere + DB2 + Hibernate + and so on. Let's just stop at the JVM if we can possibly do it. Less interactions to pursue in case of nasty bug..err unintentional features!

I.e. unit tests. No test container please.

But when it comes time to try out if a remote client can invoke the logic behind a service delegate or session facade, that the container will handle the dependencies, that the transactional scope and contexts are correct and exceptions handled sensibly, etc, then sure, I want to test the whole container dodaddet whigjammery box and dice caboodle. Both in pieces and in a complete integration test.

In short, I think the answer is, know what it is your are trying to test at any point. Or at least that's the question if not the answer. I don't want to be testing if findMeASucker(whatsit, honeydew) logic works according to requirements. I want to test if findMeA* methods function in a sensible way to the way the client delegate or whathaveyou expects it to work. In normal situations and boundary conditions.

And then there is acceptance testing.

Read: Testability outside the EJB container (know your product,,,errr,,,what you're testing)

Topic: Project Looking Glass - Not Just 3D desktop Previous Topic   Next Topic Topic: Jython Inventor To Join Microsoft

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use