The Source for Java Technology Collaboration
User: Password:
Register | Login help    

Search

Online Books:
java.net on MarkMail:


Running on a Treadmill

Posted by editor on September 13, 2005 at 6:54 AM PDT

Unit testing and integration testing

One of the downsides of enterprise-class app servers, databases and such, is that it gets expensive to own more than one. It's really implausible to have one of everything for production, another for QA, and a third for developers' integration testing. All that times however many teams or projects you may have. Someone is going to have to without, which is fine, but then how do you test your stuff?

All too often, you don't, and QA becomes the integration test... or, worse yet, production does.

Assuming you'd like to avoid the almost certain disasters that ensue from those scenarios, what do you do? How about replacing the app server and database with mock objects, so you can still expose your business logic to rigorous testing on as many development systems as you'd like?

Bob McCune says Mockrunner may be the answer. In today's Feature Article, Container-free Testing with Mockrunner, he writes:

Mockrunner is a lightweight testing framework, built on JUnit, for testing J2EE applications. Its focus is on transparently simulating your application's runtime environment so you can easily create unit tests that run out-of-container and independently of deployment descriptors or other external artifacts.

The core distribution provides built-in support for testing the most commons J2EE component types including the Servlet APIs, JDBC, JMS, EJB, as well as Struts Actions. Its comprehensive API support makes Mockrunner a compelling tool as it provides a consistent framework for testing your applications from end to end.


Here's another perspective on unit testing, from Also in Java Today: "Teams that adopt agile practices often adopt Test Driven Development (TDD), which means, of course, that they end up writing a lot of tests. In general, that’s great but there is a failure case for teams that attempt to get test infected; you can end up writing very slow tests that take so long to run that they essentially start to feel like baggage even though they help you catch errors." In A Set of Unit Testing Rules, Michael Feathers argues for re-defining the concept of "unit test" to exclude tests that hit a database, make remote calls, or are in other ways incompatible with running quickly and concurrently alongside other tests.

"JavaServer Faces technology offers a rich set of components as well as a standard render kit to render these components to an HTML client. At the same time, the design of JavaServer Faces technology is flexible enough to allow component writers to create their own render kit in order to render components to non-HTML clients, whether these components are the standard ones that come with JavaServer Faces technology or if they are custom components that the component writers have created themselves." Creating and Using a Custom Render Kit describes how to create your own render kit and how to use a custom render kit in an application both by itself and with other render kits.


In today's Forums, jay_levitt is baffled by a CPU-gobbling Java process. In Re: How can javaw take over XP?, he writes: "Even if the Java threads have high priority, if javaw itself has normal priority (which it does), shouldn't they still end up getting shoved off the processor? I've never seen any other app exhibit this behavior; yes, threads can starve other threads, but I've never seen them starve other apps since 32-bit apps came about. Even the following C program: while (1) {;} maxes out the CPU at 85-95%; it can take a few seconds to pull up a task manager, but once it does come up, it updates every second like normal."

jwenting criticizes annotation-dependent tools in Re: annotating code: "If the tool forces the programmer to use specific constructs or the tool won't work the tool is limiting the programmer and therefore limiting what he can achieve using that tool. That makes the tool worse than useless."


In Projects and Communities, the Java Communications Community project zirc describes itself as "an irc client written in pure java. It supports multi-server connections, dcc file sharing, mirc-compatible text coloration, smilies, a simple, intuitive interface... It has everything you may need to make your irc experience easy and enjoyable."

The public review for JSR 253: Mobile Telephony API (MTA) closes on Monday (Sept. 19). This JSR defines a set of functions, suitable for Java applications written for J2ME devices, for controlling calls and using network services like conferences, scheduled calls, and voice services.


Richard P Gabriel is talking up the OOPSLA conference in today's Weblogs. In OOPSLA 2005, he writes: "OOPSLA is coming up soon. As the premier object conference, OOPSLA should be of interest to members of the java.net community. I'm the program chair and have been working on revising the conference to be of interest to the larger programming community. Here are some reasons why I think you should attend OOPSLA this year."

Gregg Sporar files a report from the road NetBeans Day China: "After the success of the NetBeans Day that we did back in June, it was decided that NetBeans should go on a world tour. In other words, take NetBeans Day on the road to the folks who didn't make it to JavaOne in San Francisco. The first stop on the tour was Beijing, China..."

Malcolm Davis says he's impressed with Eclipse 3.2M1: "If you are using Eclipse 3.1, you may want to review Eclipse 3.2 M1. Eclipse 3.1 looked rushed. [Possibly trying to get ready for JavaOne.] I read the bug fixes for Eclipse 3.2 M1, which seemed to contain a large number of fixes for an 'M' release."


In today's java.net News Headlines :

Registered users can submit news items for the java.net News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to thejava.net News RSS feed.


Current and upcoming Java Events :

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.



Unit testing and integration testing
Comments
Comments are listed in date ascending order (oldest first)