Return-Path: X-Original-To: apmail-river-dev-archive@www.apache.org Delivered-To: apmail-river-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D930310CC1 for ; Mon, 9 Feb 2015 20:51:35 +0000 (UTC) Received: (qmail 47842 invoked by uid 500); 9 Feb 2015 20:51:35 -0000 Delivered-To: apmail-river-dev-archive@river.apache.org Received: (qmail 47821 invoked by uid 500); 9 Feb 2015 20:51:35 -0000 Mailing-List: contact dev-help@river.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@river.apache.org Delivered-To: mailing list dev@river.apache.org Received: (qmail 47760 invoked by uid 99); 9 Feb 2015 20:51:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2015 20:51:35 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of pats@acm.org does not designate 74.124.218.126 as permitted sender) Received: from [74.124.218.126] (HELO biz75.inmotionhosting.com) (74.124.218.126) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2015 20:51:10 +0000 Received: from ip72-192-156-15.sd.sd.cox.net ([72.192.156.15]:52789 helo=[192.168.1.113]) by biz75.inmotionhosting.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.82) (envelope-from ) id 1YKvIH-0001yZ-1O for dev@river.apache.org; Mon, 09 Feb 2015 12:51:04 -0800 Message-ID: <54D91DAE.6070905@acm.org> Date: Mon, 09 Feb 2015 12:50:54 -0800 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: dev@river.apache.org Subject: Re: Please review the river-examples project References: <66437458-B991-4F6F-B5B8-09F6413C37EE@trasuk.com> <33E5CDDA-C2EE-4820-8DD7-87041A2D4227@stratuscom.com> <54D902AE.7090405@acm.org> <637ED993-80E1-42D0-AD41-636AC0945438@gmail.com> In-Reply-To: <637ED993-80E1-42D0-AD41-636AC0945438@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-2.7 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - biz75.inmotionhosting.com X-AntiAbuse: Original Domain - river.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - acm.org X-Get-Message-Sender-Via: biz75.inmotionhosting.com: authenticated_id: pats+patriciashanahan.com/only user confirmed/virtual account not confirmed X-Virus-Checked: Checked by ClamAV on apache.org I think "production" client and test both have value. As far as possible, the example should mimic the structure and layout of a complete project, but in miniature. On 2/9/2015 12:37 PM, Dennis Reedy wrote: > >> On Feb 9, 2015, at 155PM, Patricia Shanahan 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 >