Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

testing a code that runs in multiple processess and communicates via network

Thread view: 
raven - 24 Apr 2007 23:31 GMT
Hello

How to set-up automated test-bench of repeatable tests?
In the tests: process #1 talks to process#2 via TCP/IP ; and we need to
somehow check whether the communication is successful. By "successful" i
mean: process#2 understood correctly (this would mean that, most likely,
code for both sending and receiving is working OK).

Where by "process" i mean operating system's process (task).

------
Longer version of my question ( in case the above version is unclear or
didn't provide enough details ) :

What are the "best practices" and tools when it comes to testing Java
application/library that has to run in multiple processes and communicate
via TCP/IP?

I seek a way for setting it in an automatic (preconfigured) way ( "click",
wait, see results; as it is the case with JUnit ). I suspect, that JUnit
does not support multi-process testing.

The most frequent functionality that i would like to test: process #1
informs process #2 via TCP/IP about something; process #2 receives the
information and stores its interpretation of the (parsed) message; now we
have to check whether "process #2 received and interpreted the message
correctly" i.e the interpretation by process #2 is correct and contents of
sent message are correct (i.e. the protocol is working correctly at both
ends).

Is it possible to setup such an automated "test bench" ( or "test
harness" ? ) in, say, JUnit?
----- ( end of longer version :-) )

So far, after investigating for quite a long time, I've come across a
project named Pisces, which is described here :
http://www.onjava.com/pub/a/onjava/2005/07/13/pisces.html?page=3
Bu it seems far less popular and maintained and IDE-supported than, say,
JUnit ; so perhaps i am missing something more obvious/popular.
I've also found lots of EJB/HTTP/HTML/Mock testing tools but i doubt these
would be useful for the purpose that i've described.

Maybe some combination of Ant+JUnit+RMI+{maybe some
Eclipse/Netbeans/otherIde plugin} would be suitable?
I would be glad to see a more targeted "inspiration"/tutorial instead of
getting in the risk of "reinventing the wheel" as this testing scenario
seems not much unusual and I hope there are well-known solutions.

TIA

KarolRvn

PS
Is it ok to post the same question to http://forum.java.sun.com/  ?
Martin Gregorie - 25 Apr 2007 12:51 GMT
...snippage...

> The most frequent functionality that i would like to test: process #1
> informs process #2 via TCP/IP about something; process #2 receives the
[quoted text clipped - 3 lines]
> sent message are correct (i.e. the protocol is working correctly at both
> ends).

Not really answering your question, but....

From the sound of it, process 2 never acknowledges the messages it
receives. Unless process 1 is sending "fire and forget' datagrams and
has no interest in the fate of each datagram once its sent this is, IMO,
a really bad idea.

If you change your message handling protocol so that all messages are
acknowledged and make sure that the sending method(s) return success or
failure to the caller you'll end up with a much more robust message
transfer protocol as well as something that standard unit test methods
should be able to handle.

Correctly done, the overheads of message acknowledgment are minimal.

Signature

martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.