title: HowTo Unit Test Client Server Code
body: <p>I'm currently writing a Java Client Server Application. So i want to implement two Libraries, one for the Client and one for the Server. The Client Server Communication has a very strict protocol, that I wan't to test with JUnit.</p>
  
  <p>As build tool im using Maven and a Husdon Server for continues Integration. </p>
  
  <p>Actually I do not have any good Idea how to test these Client / Server Libraries.</p>
  
  <p>I got following Approaches:</p>
  
  <ol>
  <li><p>Just write a Dummy Client for testing the server and write a Dummy Server to test the Client. 
  <b>Disadvantages:</b> Unfortunately this will result in many extra work. I could not be 100% sure that client and Server could work together, because I'm not sure that the Tests are completely identical.</p></li>
  <li><p>Write an separate Test Project that Tests the Client and the Server together.<br>
  <b>Disadvantages:</b> The Unit Tests does not belong to the Project it self, so Hudson will not run them automatically. Everyone who changes anything at one of these Libraries, will have to run the Tests manually to ensure, everything is correct. Also i will not receive any Code Coverage Report. </p></li>
  </ol>
  
  <p>Are there any better approaches to test codes like that? 
  Maybe test a Maven Multi Module Project, or something like that.</p>
  
  <p>I hope any one got a good solution for that Issue.</p>
  
  <p>Thanks.</p>