> On Feb 9, 2015, at 155PM, Patricia Shanahan <[email protected]> wrote: > > The purpose of a test would be to demonstrate principles of writing tests for > River services and clients, rather than to actually test anything. > > For example, a test of the service could pick different "name" strings, feed > them to the service, and compare the returned string to an expected value. > > How should one test a River client? Replace the service with a stub class > implementing its interface???
You could mock out the service, a simple way to do that is Proxy.newProxyInstance(...). Another way to think about this is to not provide a client at all, because the service's test is actually a client that discovers and invokes methods on the service. The test client then becomes a reference on how to develop a client. Dennis
