Loading ...
Sorry, an error occurred while loading the content.

Re: [junit] unit testing clinet server applications?

Expand Messages
  • Nat Pryce
    When faced with this situation I ve created stub implementations of the third-party network service that I can start up in the same process as the test. The
    Message 1 of 6 , Jul 1, 2009
    • 0 Attachment
      When faced with this situation I've created stub implementations of
      the third-party network service that I can start up in the same
      process as the test. The system under test is then configured to
      connect back to the stub service in the test, and the test can prime
      it with responses to drive the test scenario.

      I usually write some builder classes to create those responses, to
      shield the tests from the on-the-wire format used by the third party
      service.

      But I also test against responses captured from the real service to
      make sure that the stub service and builders aren't giving me a false
      sense of security.

      Finally, I'll plan some integration testing against the service using
      an environment or account that is provided by the third party for
      testing. I try to get that integration testing started as early as
      possible (during development, not in a final testing phase) so that
      there's as much time as possible to deal with any misunderstandings
      and defects it raises.

      --Nat

      2009/6/29 angeshwar <angeshwar@...>:
      >
      >
      > Hi,
      >
      > I have a client server application. The client connects with a remote server
      > (3rd party) and sends/receives different kinds of messages.
      >
      > For my Junit test cases I am implementing my own server which simulates the
      > behavior of the 3rd party server.
      >
      > Whats the best approach to test this.
      >
      > - Where do I include the code that actually launches my local test server
      > (should this part of Junit test package)
      > - For each message type (exchanged b/w client and my test server) that I
      > will be testing, do I kick start / shut down the server (seperately for each
      > test case)
      >
      >



      --
      http://www.natpryce.com
    • Steve Freeman
      You might want to look at the early chapters in Part III of this: http://www.mockobjects.com/book S. ... Steve Freeman http://www.mockobjects.com Winner of the
      Message 2 of 6 , Jul 1, 2009
      • 0 Attachment
        You might want to look at the early chapters in Part III of this:

        http://www.mockobjects.com/book


        S.


        On 29 Jun 2009, at 10:19, angeshwar wrote:
        > I have a client server application. The client connects with a
        > remote server (3rd party) and sends/receives different kinds of
        > messages.
        >
        > For my Junit test cases I am implementing my own server which
        > simulates the behavior of the 3rd party server.
        >
        > Whats the best approach to test this.
        >
        > - Where do I include the code that actually launches my local test
        > server (should this part of Junit test package)
        > - For each message type (exchanged b/w client and my test server)
        > that I will be testing, do I kick start / shut down the server
        > (seperately for each test case)

        Steve Freeman
        http://www.mockobjects.com

        Winner of the Agile Alliance Gordon Pask award 2006
      Your message has been successfully submitted and would be delivered to recipients shortly.