river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Reedy <dennis.re...@gmail.com>
Subject Re: Please review the river-examples project
Date Mon, 09 Feb 2015 20:37:03 GMT

> On Feb 9, 2015, at 155PM, Patricia Shanahan <pats@acm.org> 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.


View raw message