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

Discussion in 'Java' started by raven, Apr 24, 2007.

  1. raven

    raven Guest

    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/ ?
     
    raven, Apr 24, 2007
    #1
    1. Advertising

  2. Re: testing a code that runs in multiple processess and communicatesvia network

    raven wrote:

    ....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
    > 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).
    >

    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.



    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
     
    Martin Gregorie, Apr 25, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Stark

    Re: runs vb program over network

    David Stark, May 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    383
    David Stark
    May 16, 2005
  2. =?UTF-8?B?UmFmYcWC?= Zawadzki

    Write by logging.FileHandler to one file by many processess

    =?UTF-8?B?UmFmYcWC?= Zawadzki, Oct 17, 2007, in forum: Python
    Replies:
    5
    Views:
    849
    Gabriel Genellina
    Oct 23, 2007
  3. Patrick Stinson

    migrating processess to avoid the GIL

    Patrick Stinson, Sep 20, 2008, in forum: Python
    Replies:
    1
    Views:
    246
    Aaron \Castironpi\ Brady
    Sep 20, 2008
  4. Dotnet developer

    How to communicates with another webservice with another webservice

    Dotnet developer, Apr 9, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    102
    Jan Tielens
    Apr 13, 2004
  5. Robert Everland III

    Question on how ASP communicates and general questions

    Robert Everland III, Dec 8, 2003, in forum: ASP General
    Replies:
    11
    Views:
    871
    Tim Slattery
    Dec 8, 2003
Loading...

Share This Page