<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to feature-requests</title><link>https://sourceforge.net/p/mockobjects/feature-requests/</link><description>Recent changes to feature-requests</description><atom:link href="https://sourceforge.net/p/mockobjects/feature-requests/feed.rss" rel="self"/><language>en</language><lastBuildDate>Thu, 15 Jan 2004 11:15:41 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/mockobjects/feature-requests/feed.rss" rel="self" type="application/rss+xml"/><item><title>provide an expectMultiple() type method?</title><link>https://sourceforge.net/p/mockobjects/feature-requests/5/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;There are a number of times when we expect a method to &lt;br /&gt;
be called and we are not bothered what the arguments are. &lt;br /&gt;
In steps the .expect(object,C.ANY_ARGS) however, there are &lt;br /&gt;
also a number of occasions where we expect a method to be &lt;br /&gt;
called multiple times and we still dont care whats passed &lt;br /&gt;
nor do we actually know how many times its going to be &lt;br /&gt;
called. Ie when we mock the apache.commons.logger we &lt;br /&gt;
may not care what we log or how often. Is it possible to &lt;br /&gt;
create an expectMultiple(object,C.ANY_ARGS) type method? &lt;br /&gt;
You could, if you desired, count the number of calls and &lt;br /&gt;
verify this.&lt;/p&gt;
&lt;p&gt;This is not necessarily a problem in that you could created a &lt;br /&gt;
MockLogger() class instead of using the dynamic mock of the &lt;br /&gt;
Log interface and just implemented each method with stubs.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;br /&gt;
Keith&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Keith Quint</dc:creator><pubDate>Thu, 15 Jan 2004 11:15:41 -0000</pubDate><guid>https://sourceforge.net0ae174323db5e9497e1ab4564ed2699a667886ff</guid></item><item><title>Validation of Mock.expect*(..) arguments</title><link>https://sourceforge.net/p/mockobjects/feature-requests/4/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;A very common error in test setup is to define&lt;br /&gt;
expectations for which there never will be match. For&lt;br /&gt;
example, given:&lt;/p&gt;
&lt;p&gt;public interface Foo {&lt;br /&gt;
public void bar(Blob blob);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
// 1. no method tweetle on interface&lt;br /&gt;
mockFoo.expect(&amp;amp;quot;tweetle&amp;amp;quot;, aBlob);&lt;br /&gt;
// 2. no bar method that takes two arguments&lt;br /&gt;
mockFoo.expect(&amp;amp;quot;bar&amp;amp;quot;, C.args(C.eq(aBlob), C.eq(aTweetle)));&lt;br /&gt;
// 3. no bar method that returns a Tweetle&lt;br /&gt;
mockFoo.expectAndReturn(&amp;amp;quot;bar&amp;amp;quot;, aBlob, aTweetle);&lt;br /&gt;
// 4. no bar method that takes a Tweetle argument&lt;br /&gt;
mockFoo.expect(&amp;amp;quot;bar&amp;amp;quot;, C.eq(aTweetle)); &lt;/p&gt;
&lt;p&gt;1, 2, 3 /could/ be done with the current design. It&lt;br /&gt;
just isnt' resulting  strange test executions that&lt;br /&gt;
could have failed immediatly at setup time.&lt;/p&gt;
&lt;p&gt;4 would require some method of &amp;amp;quot;knowing&amp;amp;quot; a constraint's&lt;br /&gt;
type. That is the type of its argument. Of course this&lt;br /&gt;
may not always be possible, but when it is could be&lt;br /&gt;
used to help validate the expectations. &lt;/p&gt;
&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;Comment from Nat on this subject:&lt;/p&gt;
&lt;p&gt;Request 4 is impossible for most constraints (because a&lt;br /&gt;
Constraint has no concept of &amp;amp;quot;type&amp;amp;quot;) unless we extend&lt;br /&gt;
the  Constraint interface with methods that to perform&lt;br /&gt;
early checks.  However, I would rather keep the&lt;br /&gt;
Constraint interface as simple as possible to make it&lt;br /&gt;
trivially easy to write new Constraints.  That approach&lt;br /&gt;
has helped make the&lt;br /&gt;
Constraint concept very easy for new users to&lt;br /&gt;
understand and use, and also kept the Constraint&lt;br /&gt;
interface very stable (it hasn't changed since first&lt;br /&gt;
introduced).&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Barry Kaplan</dc:creator><pubDate>Fri, 22 Aug 2003 22:04:35 -0000</pubDate><guid>https://sourceforge.net4b4c6279f4890d3e8b0d94a112065e9ab12b0be9</guid></item><item><title>Add match() to new DynaMock API</title><link>https://sourceforge.net/p/mockobjects/feature-requests/3/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Here's the use case for a new match():&lt;/p&gt;
&lt;p&gt;I have in my code a call to queueConnection.close() &lt;br /&gt;
(for example). I use a Mock for QueueConnection. If I &lt;br /&gt;
*don't* define either an expect*() or a match*(), I get:&lt;/p&gt;
&lt;p&gt;junit.framework.AssertionFailedError: &lt;br /&gt;
mockQueueConnection: Unexpected call: close() &lt;br /&gt;
Expected no methods&lt;br /&gt;
at com.mockobjects.dynamic.Mock.invoke&lt;br /&gt;
(Mock.java:95)&lt;br /&gt;
[...]&lt;/p&gt;
&lt;p&gt;Which means to me that we have to define the &lt;br /&gt;
behaviour for any method called (and that there is no &lt;br /&gt;
default behaviour assumed). Fine with me. Then, I don't &lt;br /&gt;
want to set an expectation on close() because this &lt;br /&gt;
mock setup is part of a general setup that I want to &lt;br /&gt;
reuse across several tests and some tests do call close&lt;br /&gt;
(), some do not.&lt;/p&gt;
&lt;p&gt;But there is no match() method. &lt;/p&gt;
&lt;p&gt;Basically I'd like to simply tell DynaMock that I don't &lt;br /&gt;
care about this close() method. ATM, I've tricked it, by &lt;br /&gt;
using:&lt;/p&gt;
&lt;p&gt;mockQueueConnection.matchAndReturn(&amp;amp;quot;close&amp;amp;quot;, &lt;br /&gt;
null);&lt;/p&gt;
&lt;p&gt;But that seems like a hack (or even a DynaMock bug) &lt;br /&gt;
to me.&lt;/p&gt;
&lt;p&gt;Thanks&lt;br /&gt;
-Vincent&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vincent Massol</dc:creator><pubDate>Fri, 16 May 2003 07:22:31 -0000</pubDate><guid>https://sourceforge.net1f9154590bc63e8bc8ee6b7c086ef9102fd42c6d</guid></item><item><title>Make Dynamic Objects work with any class</title><link>https://sourceforge.net/p/mockobjects/feature-requests/2/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I didn't really want to subscribe to the dev list, and&lt;br /&gt;
you don't have any forums, so I hope you find my&lt;br /&gt;
message this way :-)&lt;/p&gt;
&lt;p&gt;I'm a developer with cglib.sf.net. It uses bcel to&lt;br /&gt;
dynamically create classes at runtime, for a variety of&lt;br /&gt;
use cases. If you switched your dynamic Mock class to&lt;br /&gt;
use cglib instead of java.lang.reflect.Proxy, you could:&lt;/p&gt;
&lt;p&gt;- be compatible with JDK 1.2&lt;br /&gt;
- mock almost any class (must have a non-private&lt;br /&gt;
constructor, and private or final methods cannot be mocked)&lt;br /&gt;
- perhaps realize a speed increase (creation of&lt;br /&gt;
object is slower, but method invocations are faster)&lt;/p&gt;
&lt;p&gt;I'll probably be using mock objects more soon, so I&lt;br /&gt;
might do this anyway, but if you are interested let me&lt;br /&gt;
know, I can point you in the right direction.&lt;/p&gt;
&lt;p&gt;chris at sixlegs dot com&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Nokleberg</dc:creator><pubDate>Thu, 08 May 2003 17:05:31 -0000</pubDate><guid>https://sourceforge.netcc2b0cdf0c94b0867626222554e88ad312b2eb43</guid></item><item><title>MockHttpSession and MockHttpServletRequest </title><link>https://sourceforge.net/p/mockobjects/feature-requests/1/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The MockHttpSession and MockHttpServletRequest &lt;br /&gt;
consists of many unimplemented method that throw &lt;br /&gt;
exception. This is make them not too useful. I would like &lt;br /&gt;
to request for:&lt;/p&gt;
&lt;p&gt;1. make them as abstract and make the unimplemented &lt;br /&gt;
methods as abstract methods, so I can extend the &lt;br /&gt;
class conveniently. (instead of checking for the list of &lt;br /&gt;
unimplemented methods in the source one by one), or&lt;/p&gt;
&lt;p&gt;2. best of all, implement them!&lt;/p&gt;
&lt;p&gt;regards,&lt;br /&gt;
mingfai&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mingfai</dc:creator><pubDate>Thu, 16 Jan 2003 02:17:32 -0000</pubDate><guid>https://sourceforge.net1f2a2396a9e41a186a92267cde7d63c160ef6e4e</guid></item></channel></rss>