You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(151) |
Sep
(21) |
Oct
(6) |
Nov
(70) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(47) |
Feb
(66) |
Mar
(23) |
Apr
(115) |
May
(24) |
Jun
(53) |
Jul
(10) |
Aug
(279) |
Sep
(84) |
Oct
(149) |
Nov
(138) |
Dec
(52) |
2003 |
Jan
(22) |
Feb
(20) |
Mar
(29) |
Apr
(106) |
May
(170) |
Jun
(122) |
Jul
(70) |
Aug
(64) |
Sep
(27) |
Oct
(71) |
Nov
(49) |
Dec
(9) |
2004 |
Jan
(7) |
Feb
(38) |
Mar
(3) |
Apr
(9) |
May
(22) |
Jun
(4) |
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
|
Nov
(15) |
Dec
(2) |
2005 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(28) |
Jun
(3) |
Jul
(11) |
Aug
(5) |
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2006 |
Jan
(8) |
Feb
(3) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vincent M. <vm...@pi...> - 2003-05-14 16:10:08
|
Hi, There is an expect() method (replacing the old expectVoid()), but there is no match() method. Any reason? Thanks -Vincent |
From: Jeff M. <jef...@mk...> - 2003-05-14 15:56:14
|
On Wed, 2003-05-14 at 15:40, Vincent Massol wrote: > Hi all, >=20 > I'd like to do the release for MockObjects 0.08 ASAP (please tell me if > you'd rather do it! :-)). >=20 > Thus I need to know: >=20 > 1/ Do you agree to release? As good a time as any ;) +1 >=20 > 2/ Do you agree to let me perform the release (i.e. I would be the > release manager)? Fine by me +1 >=20 > 3/ Is anyone planning to add anything crucial for 0.08? If so now is the > time to stand up... :-) Just done it. >=20 > 4/ Can all the developers who have contributed code to 0.08 please > modify the changes.xml file to explain what changes they have brought > since version 0.07? >=20 I'll have to think about that. > I'm fixing some docs which haven't been touched for more than 2 years > for some of them... :-( Think they're mostly dead. >=20 > Thanks > -Vincent >=20 >=20 >=20 > ------------------------------------------------------- > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > The only event dedicated to issues related to Linux enterprise solutions > www.enterpriselinuxforum.com >=20 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev --=20 jeff martin information technologist mkodo limited mobile: 44 (0) 78 55 478 331 phone: 44 (0) 20 77 29 45 45 email: jef...@mk... www.mkodo.com 73 Leonard St, London, EC2A 4QS. U.K |
From: Jeff M. <cus...@us...> - 2003-05-14 15:18:00
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv28626a/src/j2ee/1.3/com/mockobjects/helpers Modified Files: ServletTestHelper.java Log Message: Added convinience methods for GET and POST Index: ServletTestHelper.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers/ServletTestHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ServletTestHelper.java 14 Oct 2002 22:58:28 -0000 1.1 +++ ServletTestHelper.java 14 May 2003 15:17:57 -0000 1.2 @@ -32,4 +32,14 @@ testSubject.service(request, response); } + public void testDoPost() throws ServletException, IOException { + request.setupGetMethod("POST"); + testServlet(); + } + + public void testDoGet() throws ServletException, IOException { + request.setupGetMethod("GET"); + testServlet(); + } + } |
From: Jeff M. <cus...@us...> - 2003-05-14 15:17:35
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv28363/src/j2ee/1.3/com/mockobjects/helpers Modified Files: AbstractServletTestHelper.java Log Message: Added request dispatcher Index: AbstractServletTestHelper.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers/AbstractServletTestHelper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AbstractServletTestHelper.java 31 Dec 2002 13:44:28 -0000 1.3 +++ AbstractServletTestHelper.java 14 May 2003 15:17:32 -0000 1.4 @@ -16,6 +16,7 @@ public AbstractServletTestHelper() { request.setSession(httpSession); servletContext.setupGetRequestDispatcher(requestDispatcher); + request.setupGetRequestDispatcher(requestDispatcher); httpSession.setupServletContext(servletContext); servletConfig.setServletContext(servletContext); } |
From: Vincent M. <vm...@pi...> - 2003-05-14 15:16:40
|
Hi, I've been trying the web site generation by going in doc/ and typing "ant -f site.xml site". However, I was surprised to find that the generated HTML in out/ does not come from the xdocs but from static HTML files in doc/html Could someone tell me what's the status and where the project is going for web site generation? Would you like to move to Maven for building the mockobjects project in the future? If so, I can very quickly migrate the doc generation to Maven and produce a site which looks like (http://maven.apache.org). Thanks -Vincent |
From: Vincent M. <vm...@us...> - 2003-05-14 15:15:36
|
Update of /cvsroot/mockobjects/mockobjects-java/doc In directory sc8-pr-cvs1:/tmp/cvs-serv26564/doc Modified Files: site.xml Log Message: Moved web site tar to out/ Index: site.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/site.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- site.xml 14 May 2003 15:13:24 -0000 1.8 +++ site.xml 14 May 2003 15:15:33 -0000 1.9 @@ -6,7 +6,7 @@ <property name="project.name" value="mockobjects"/> <property name="site.name" value="${project.name}-website"/> <property name="out.dir" value="out"/> - <property name="site.tar" value="${site.name}.${DSTAMP}.tar"/> + <property name="site.tar" value="${out.dir}/${site.name}.${DSTAMP}.tar"/> </target> <target name="copy-stylesheet"> @@ -49,7 +49,7 @@ <target name="site.tar" depends="project-properties, site"> <tar destfile="${site.tar}" - basedir="${out.dir}" /> + basedir="${out.dir}/html" /> </target> <target name="deploy-site" |
From: Jeff M. <cus...@us...> - 2003-05-14 15:15:16
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv26017/src/j2ee/1.3/com/mockobjects/helpers Modified Files: TagTestHelper.java Log Message: Added better error information Index: TagTestHelper.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers/TagTestHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagTestHelper.java 14 Oct 2002 22:58:28 -0000 1.1 +++ TagTestHelper.java 14 May 2003 15:15:11 -0000 1.2 @@ -86,7 +86,7 @@ * Invoke doInitBody on the test subject */ public void testDoInitBody() throws JspException { - Assert.assertTrue("Test subject not an instance of BodyTag", + Assert.assertTrue("doInitBody should not be called as test subject not an instance of BodyTag", testSubject instanceof BodyTag); ((BodyTag) testSubject).setBodyContent(bodyContent); @@ -98,7 +98,7 @@ * @param expectedValue value to check against doAfterBody */ public void assertDoAfterBody(int expectedValue) throws JspException { - Assert.assertTrue("Test subject not an instance of BodyTag", + Assert.assertTrue("doAfterTag should not be called as test subject not an instance of IterationTag", testSubject instanceof IterationTag); checkReturnValue("doAfterTag", expectedValue, ((IterationTag) testSubject).doAfterBody()); |
From: Jeff M. <cus...@us...> - 2003-05-14 15:14:15
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv19667/src/core/test/mockobjects Modified Files: TestExpectationSet.java Log Message: Added test for bug with changing hashes before verification Index: TestExpectationSet.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/TestExpectationSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestExpectationSet.java 24 Nov 2002 11:11:40 -0000 1.2 +++ TestExpectationSet.java 14 May 2003 15:05:50 -0000 1.3 @@ -1,9 +1,12 @@ package test.mockobjects; +import com.mockobjects.ExpectationSet; +import com.mockobjects.MapEntry; import junit.framework.Test; import junit.framework.TestSuite; -import com.mockobjects.ExpectationSet; +import java.util.ArrayList; +import java.util.Vector; public class TestExpectationSet extends TestExpectationCollection { private static final Class THIS = TestExpectationSet.class; @@ -28,6 +31,27 @@ myExpectation.addExpectedMany(new String[] { "A", "B" }); myExpectation.addActualMany(new String[] { "A", "B" }); + + myExpectation.verify(); + } + + public void testChangingHashcode() { + final Vector value = new Vector(); + + myExpectation.addExpected(new MapEntry("key", value)); + myExpectation.addActual(new MapEntry("key", value)); + + value.add(getName()); + + myExpectation.verify(); + } + + public void testChanginHashcodeImediateCheck() { + final Vector value = new Vector(); + + myExpectation.addExpected(new MapEntry("key", value)); + value.add(getName()); + myExpectation.addActual(new MapEntry("key", value)); myExpectation.verify(); } |
From: Vincent M. <vm...@us...> - 2003-05-14 15:13:28
|
Update of /cvsroot/mockobjects/mockobjects-java/doc In directory sc8-pr-cvs1:/tmp/cvs-serv24444/doc Modified Files: site.xml Added Files: .cvsignore Log Message: - Added cvs ignore file for the out/ dir - Compile the class file in out/ rather than in place (make it less ugly when doing a cvs update) --- NEW FILE: .cvsignore --- out Index: site.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/site.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- site.xml 14 Oct 2002 22:56:25 -0000 1.7 +++ site.xml 14 May 2003 15:13:24 -0000 1.8 @@ -10,30 +10,28 @@ </target> <target name="copy-stylesheet"> - <copy file="html/stylesheet.css" todir="out"/> + <copy file="html/stylesheet.css" todir="${out.dir}/html"/> </target> <target name="clean" depends="project-properties"> - <delete quiet="true"> - <fileset dir="${out.dir}"/> - <fileset includes="**/*.class"/> - </delete> + <delete dir="${out.dir}"/> </target> <target name="add-task"> - <javac srcdir="."/> + <mkdir dir="${out.dir}/classes"/> + <javac srcdir="." destdir="${out.dir}/classes"/> <taskdef name="template" classname="com.mockobjects.doc.SiteTemplate" - classpath="."/> + classpath="${out.dir}/classes"/> </target> <target name="site" depends="project-properties, add-task, copy-stylesheet" description="Create the output directory and copy templated files over."> - <mkdir dir="${out.dir}"/> + <mkdir dir="${out.dir}/html"/> <template templatefile="html/template.txt" - todir="${out.dir}" + todir="${out.dir}/html" dir="html" includes="*.html"/> </target> |
From: Jeff M. <cus...@us...> - 2003-05-14 15:09:44
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv21844/src/j2ee/common/com/mockobjects/servlet Modified Files: MockServletContext.java Log Message: Changed Attributes to use return object bag Index: MockServletContext.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/servlet/MockServletContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MockServletContext.java 19 Jun 2002 15:26:22 -0000 1.3 +++ MockServletContext.java 14 May 2003 15:09:42 -0000 1.4 @@ -1,13 +1,18 @@ package com.mockobjects.servlet; -import java.io.*; -import java.net.*; -import java.util.*; -import javax.servlet.*; import com.mockobjects.*; -public class MockServletContext extends MockObject implements ServletContext{ - private HashMap attributes = new HashMap(); +import javax.servlet.RequestDispatcher; +import javax.servlet.Servlet; +import javax.servlet.ServletContext; +import java.io.InputStream; +import java.net.URL; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Set; + +public class MockServletContext extends MockObject implements ServletContext { + private ReturnObjectBag returnAttributes = new ReturnObjectBag("attributes"); private Set resourcePaths; private ReturnObjectList realPaths = new ReturnObjectList("real path"); private URL resource; @@ -18,138 +23,147 @@ private ExpectationValue requestDispatcherURI = new ExpectationValue("RequestDispatcher URI"); private RequestDispatcher requestDispatcher; + private ExpectationSet attributes = new ExpectationSet("attributes"); - public Enumeration getServlets(){ + public Enumeration getServlets() { return null; } - public void log(String string){ + public void log(String string) { expectedLogValue.setActual(string); } - public void setExpectedLog(String string){ + public void setExpectedLog(String string) { expectedLogValue.setExpected(string); } - public void setupGetResource(URL resource){ + public void setupGetResource(URL resource) { this.resource = resource; } - public URL getResource(String string){ + public URL getResource(String string) { return resource; } - - public void setupGetResourcePaths(Set resourcePaths){ + + public void setupGetResourcePaths(Set resourcePaths) { this.resourcePaths = resourcePaths; } - public Set getResourcePaths(String string){ + public Set getResourcePaths(String string) { return resourcePaths; } - public ServletContext getContext(String string){ + public ServletContext getContext(String string) { return null; } - public int getMinorVersion(){ + public int getMinorVersion() { return -1; } - public void removeAttribute(String string){ + public void removeAttribute(String string) { } - - public void log(String string, Throwable t){ + + public void log(String string, Throwable t) { log(string); expectedLogThrowable.setActual(t); } - public void setExpectedLogThrowable(Throwable throwable){ + public void setExpectedLogThrowable(Throwable throwable) { expectedLogThrowable.setExpected(throwable); } - public void addRealPath(String realPath){ + public void addRealPath(String realPath) { this.realPaths.addObjectToReturn(realPath); } - public String getRealPath(String string){ + public String getRealPath(String string) { return realPaths.nextReturnObject().toString(); } - public Enumeration getServletNames(){ + public Enumeration getServletNames() { return null; } - public Servlet getServlet(String string){ + public Servlet getServlet(String string) { return null; } - public void log(Exception exception, String string){ + public void log(Exception exception, String string) { } - public String getServerInfo(){ + public String getServerInfo() { return null; } - public void setExpectedRequestDispatcherURI(String uri){ + public void setExpectedRequestDispatcherURI(String uri) { this.requestDispatcherURI.setExpected(uri); } public void setupGetRequestDispatcher( - RequestDispatcher requestDispatcher){ + RequestDispatcher requestDispatcher) { this.requestDispatcher = requestDispatcher; } - public RequestDispatcher getRequestDispatcher(String uri){ + public RequestDispatcher getRequestDispatcher(String uri) { requestDispatcherURI.setActual(uri); return requestDispatcher; } - - public int getMajorVersion(){ + + public int getMajorVersion() { return -1; } - public Set getResourcePaths(){ + public Set getResourcePaths() { return null; } - public void setAttribute(String string, Object object){ - attributes.put(string, object); + public void setupGetAttribute(String string, Object object) { + returnAttributes.putObjectToReturn(string, object); } - public String getMimeType(String string){ + public String getMimeType(String string) { return null; } - public RequestDispatcher getNamedDispatcher(String string){ + public RequestDispatcher getNamedDispatcher(String string) { return null; } - public String getInitParameter(String paramName){ - return (String)initParameters.get(paramName); + public String getInitParameter(String paramName) { + return (String) initParameters.get(paramName); } - public void setInitParameter(String paramName, String paramValue){ - initParameters.put(paramName,paramValue); + public void setInitParameter(String paramName, String paramValue) { + initParameters.put(paramName, paramValue); } - public Object getAttribute(String string){ - return attributes.get(string); + public Object getAttribute(String string) { + return returnAttributes.getNextReturnObject(string); } - public Enumeration getAttributeNames(){ + public Enumeration getAttributeNames() { return null; } public String getServletContextName() { return null; } - - public InputStream getResourceAsStream(String string){ + + public InputStream getResourceAsStream(String string) { return null; } - - public Enumeration getInitParameterNames(){ + + public Enumeration getInitParameterNames() { return null; + } + + public void addExpectedAttribute(String key, Object value) { + attributes.addExpected(new MapEntry(key, value)); + } + + public void setAttribute(String key, Object value) { + attributes.addActual(new MapEntry(key, value)); } } |
From: Barry K. <bk...@in...> - 2003-05-14 15:09:12
|
I had a need for a CallBag, except I do not want to limit the number of calls. Mainly to support getters. Below is what I did. Is there another way? If not, could this be incorporated into the dynamic package? Notice that I had to override the field 'numcalls'. This is smelly. But I could not see any other way. And I'm not too happy about the class name. Also, I noticed that the comments in CallBag that the class was temporary, and would be pushed-up into CallSequence. If that is the case, I would like to see the ability to support unspecified number of calls. (Isn't there other support for unspecified number of calls in the Mock class?) ---- package mockobjects; import com.mockobjects.dynamic.CallCollection; import com.mockobjects.dynamic.MockCall; public class CallSet extends CallCollection { private int numCalls = 0; public Object call(Object[] args) throws Throwable { numCalls++; int callIndex = findCallIndexAndCheckArguments(args, numCalls); MockCall call = (MockCall)_expected_calls.get(callIndex); _hasBeenCalled.add(callIndex, Boolean.TRUE); return call.call(args); } protected int findCallIndexAndCheckArguments( Object[] args, int callNumber) { for (int i = 0; i < _expected_constraints.size(); i++) { if (checkArguments(i, args)) { return i; } } fail(errorMessage(args)); return -1; } public void verify() { assertTrue(errorMessage( null), _expected_calls.size() <= numCalls); } } ---- |
From: Jeff M. <cus...@us...> - 2003-05-14 15:07:38
|
Update of /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/apache/commons/httpclient In directory sc8-pr-cvs1:/tmp/cvs-serv20576/src/extensions/com/mockobjects/apache/commons/httpclient Modified Files: MockGetMethod.java MockHttpMethod.java Added Files: MockMethodHelper.java Log Message: Added getResponseHeaders to both HttpMethod and GetMethod --- NEW FILE: MockMethodHelper.java --- package com.mockobjects.apache.commons.httpclient; import com.mockobjects.ReturnObjectBag; import com.mockobjects.MockObject; import org.apache.commons.httpclient.Header; /** * @version $Revision: 1.1 $ */ class MockMethodHelper extends MockObject{ private final ReturnObjectBag header = new ReturnObjectBag("response header"); public Header getResponseHeader(String key) { return (Header) header.getNextReturnObject(key); } public void addGetResponseHeader(String key, Header header) { this.header.putObjectToReturn(key, header); } } Index: MockGetMethod.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/apache/commons/httpclient/MockGetMethod.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockGetMethod.java 19 Jun 2002 15:26:16 -0000 1.2 +++ MockGetMethod.java 14 May 2003 15:07:35 -0000 1.3 @@ -1,18 +1,16 @@ package com.mockobjects.apache.commons.httpclient; -import org.apache.commons.httpclient.methods.GetMethod; +import com.mockobjects.*; +import com.mockobjects.util.AssertMo; +import com.mockobjects.util.Verifier; import org.apache.commons.httpclient.*; +import org.apache.commons.httpclient.methods.GetMethod; import java.io.File; -import java.io.InputStream; import java.io.IOException; -import java.io.OutputStream; - -import com.mockobjects.util.AssertMo; -import com.mockobjects.util.Verifier; -import com.mockobjects.*; +import java.io.InputStream; -public class MockGetMethod extends GetMethod implements Verifiable{ +public class MockGetMethod extends GetMethod implements Verifiable { private ExpectationValue myFollowRedirects; // lazy initialise because of super constructor private ExpectationValue myPath = new ExpectationValue("path"); @@ -20,8 +18,9 @@ private ReturnObjectList myStatusCodes = new ReturnObjectList("status code"); private String myResponseBody; private String myStatusText; + private final MockMethodHelper helper = new MockMethodHelper(); - public void setExpectedPath(String aPath){ + public void setExpectedPath(String aPath) { myPath.setExpected(aPath); } @@ -105,15 +104,15 @@ return null; } - public void setExpectedFollowRedirects(boolean aFollowRedirects){ - if(myFollowRedirects==null){ + public void setExpectedFollowRedirects(boolean aFollowRedirects) { + if (myFollowRedirects == null) { myFollowRedirects = new ExpectationValue("follow redirects"); } myFollowRedirects.setExpected(aFollowRedirects); } public void setFollowRedirects(boolean aFollowRedirects) { - if(myFollowRedirects==null){ + if (myFollowRedirects == null) { myFollowRedirects = new ExpectationValue("follow redirects"); } myFollowRedirects.setActual(aFollowRedirects); @@ -132,12 +131,12 @@ return null; } - public void addExpectedQueryString(NameValuePair aPair){ + public void addExpectedQueryString(NameValuePair aPair) { myPairs.addExpected(new MapEntry(aPair.getName(), aPair.getValue())); } public void setQueryString(NameValuePair[] aPairs) { - for(int i = 0; i < aPairs.length; i++ ){ + for (int i = 0; i < aPairs.length; i++) { myPairs.addActual(new MapEntry( aPairs[i].getName(), aPairs[i].getValue())); } @@ -162,7 +161,7 @@ return null; } - public void setupGetResponseBodyAsString(String aResponseBody){ + public void setupGetResponseBodyAsString(String aResponseBody) { myResponseBody = aResponseBody; } @@ -180,15 +179,15 @@ return null; } - public void addGetStatusCode(int aStatusCode){ + public void addGetStatusCode(int aStatusCode) { myStatusCodes.addObjectToReturn(new Integer(aStatusCode)); } public int getStatusCode() { - return ((Integer)myStatusCodes.nextReturnObject()).intValue(); + return ((Integer) myStatusCodes.nextReturnObject()).intValue(); } - public void setupGetStatusText(String aStatusText){ + public void setupGetStatusText(String aStatusText) { myStatusText = aStatusText; } @@ -201,9 +200,12 @@ return new Header[]{}; } - public Header getResponseHeader(String s) { - AssertMo.notImplemented(getClass().getName()); - return null; + public Header getResponseHeader(String key) { + return helper.getResponseHeader(key); + } + + public void addGetResponseHeader(String key, Header header) { + helper.addGetResponseHeader(key, header); } public boolean hasBeenUsed() { @@ -212,7 +214,7 @@ } public int execute(HttpState state, HttpConnection connection) - throws HttpException, IOException { + throws HttpException, IOException { AssertMo.notImplemented(getClass().getName()); return 0; } @@ -226,7 +228,7 @@ AssertMo.notImplemented(getClass().getName()); } - public void verify(){ + public void verify() { Verifier.verifyObject(this); } Index: MockHttpMethod.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/extensions/com/mockobjects/apache/commons/httpclient/MockHttpMethod.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockHttpMethod.java 19 Jun 2002 15:26:16 -0000 1.2 +++ MockHttpMethod.java 14 May 2003 15:07:35 -0000 1.3 @@ -1,12 +1,15 @@ package com.mockobjects.apache.commons.httpclient; import com.mockobjects.MockObject; +import com.mockobjects.ReturnObjectBag; import org.apache.commons.httpclient.*; -import java.io.InputStream; import java.io.IOException; +import java.io.InputStream; + +public class MockHttpMethod extends MockMethodHelper implements HttpMethod { + -public class MockHttpMethod extends MockObject implements HttpMethod { public String getName() { notImplemented(); @@ -100,11 +103,6 @@ } public Header getResponseHeaders()[] { - notImplemented(); - return null; - } - - public Header getResponseHeader(String name) { notImplemented(); return null; } |
From: Jeff M. <cus...@us...> - 2003-05-14 14:59:37
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv16139/src/core/com/mockobjects Modified Files: AbstractExpectationCollection.java ExpectationMap.java ExpectationSet.java MapEntry.java Log Message: Fixed problem with hashes changing between setting up a set and verifying it Index: AbstractExpectationCollection.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/AbstractExpectationCollection.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AbstractExpectationCollection.java 5 Nov 2002 16:02:36 -0000 1.5 +++ AbstractExpectationCollection.java 14 May 2003 14:59:34 -0000 1.6 @@ -3,6 +3,7 @@ import java.util.Collection; import java.util.Enumeration; import java.util.Iterator; +import java.util.HashSet; abstract public class AbstractExpectationCollection extends AbstractExpectation implements ExpectationCollection { @@ -91,7 +92,7 @@ public void verify() { assertEquals( "did not receive the expected collection items.", - getExpectedCollection(), - getActualCollection()); + new HashSet(getExpectedCollection()), + new HashSet(getActualCollection())); } } Index: ExpectationMap.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ExpectationMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ExpectationMap.java 29 Jul 2001 19:50:24 -0000 1.1 +++ ExpectationMap.java 14 May 2003 14:59:34 -0000 1.2 @@ -5,10 +5,8 @@ public class ExpectationMap implements Expectation, Verifiable { private HashMap myEntries; private ExpectationSet myKeys; - private String myName; public ExpectationMap(String name) { - myName = name; myEntries = new HashMap(); myKeys = new ExpectationSet(name + " keys"); } Index: ExpectationSet.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ExpectationSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ExpectationSet.java 30 Aug 2002 14:49:57 -0000 1.2 +++ ExpectationSet.java 14 May 2003 14:59:34 -0000 1.3 @@ -16,7 +16,7 @@ protected void checkImmediateValues(Object actualItem) { AssertMo.assertTrue( myName + " did not receive an expected item\nUnexpected:" + actualItem, - myExpectedItems.contains(actualItem)); + new HashSet(myExpectedItems).contains(actualItem)); } protected Collection getActualCollection() { Index: MapEntry.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/MapEntry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MapEntry.java 5 Sep 2002 08:39:22 -0000 1.2 +++ MapEntry.java 14 May 2003 14:59:34 -0000 1.3 @@ -15,7 +15,6 @@ private Object myValue; public MapEntry(Object aKey, Object aValue) { - super(); myKey = (aKey == null ? new Null() : aKey); myValue = (aValue == null ? new Null() : aValue); } |
From: Vincent M. <vm...@us...> - 2003-05-14 14:58:23
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv15996/doc/xdocs Modified Files: todo.xml Log Message: Removed old todos Index: todo.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/xdocs/todo.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- todo.xml 21 Aug 2001 14:47:02 -0000 1.6 +++ todo.xml 14 May 2003 14:58:19 -0000 1.7 @@ -24,39 +24,20 @@ </p> </s1> - <version title="Version 0.02"> + <version title="Future Versions"> <!-- In order to assign someone to a task, add the 'assigned-go' attribute to the action tag. Ex: action assigned-to="Vincent Massol, Steve Freeman" --> + <!-- Example of entry: <category title="Documentation"> <action assigned-to="Vincent Massol, Steve Freeman"> Write a page explaining the differences between Mock Objects and Stubs as it is largely misunderstood. </action> - <action> - Explain the code organisation in the src/ directory as wall as package - organisation. - </action> - <action> - Add a features page explaining current features of Mock Objects. - </action> - </category> - <category title="Code"> - <action assigned-to="everyone"> - Reformat all source code : Add javadoc to all code where needed + - add license + add version number + create packages.html and - overview.html + reformat according to coding conventions. We need to - do that ASAP. - </action> - </category> - <category title="Build"> - <action assigned-to="Vincent Massol"> - Finalise the build process (still need to finalise directory - structure + manage examples + manage extensions). - </action> </category> + --> </version> |
From: Vincent M. <vm...@us...> - 2003-05-14 14:58:01
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv15795/doc/xdocs Modified Files: release_process.xml Log Message: - Updated the release process to use tasks defined in the SourceForge trackers - Removed the reference to the features page which still does not exist. Users will have to "discover" the features from the changes.html file (completely empty since 0.01... :-(). Let's start to use it again please... Index: release_process.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/xdocs/release_process.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- release_process.xml 21 Aug 2001 11:41:27 -0000 1.1 +++ release_process.xml 14 May 2003 14:57:58 -0000 1.2 @@ -29,10 +29,10 @@ <p> Long before any release, we need to define what will go into that release, i.e. the list of tasks that need to be performed - <strong>prior</strong> to that release. These tasks will be listed on - the <link href="todo.html">Todo page</link>. Tasks can be proposed on - the <link href="http://sourceforge.net/mail/?group_id=18189">mailing - list</link>. + <strong>prior</strong> to that release. These tasks are listed + using the + <a href="http://sourceforge.net/tracker/?group_id=18189">SourceForge + trackers</a> ((bugs, requests, patches, RFE). </p> </s2> @@ -87,17 +87,14 @@ This is done by posting a mail on the list asking for a code freeze. </li> <li> - Verify that the <link href="todo.html">todo.xml</link> page is up to - date. + Verify that the no scheduled items from the + <a href="http://sourceforge.net/tracker/?group_id=18189">SourceForge + trackers</a> is still outstanding. If so decide whether to postpone + the release or move the task to the next release. </li> <li> Verify that the <link href="changes.html">changes.xml</link> page is up to date. - </li> - <li> - Verify that the <link href="features.html">features.xml</link> page is - up to date and includes all features available in all releases + the - new ones from this release. </li> <li> Verify that the news items on the |
From: Vincent M. <vm...@pi...> - 2003-05-14 14:56:43
|
Hi developers, - We have 6 open bugs reports: http://sourceforge.net/tracker/?atid=118189&group_id=18189&func=browse Can those who have been active on this project lately tell me what needs to be done. Maybe some have already been correct? If not, is there any that should go in 0.08 or can we postpone them all to 0.09? - There is one support request for DynaMock documentation (http://sourceforge.net/tracker/?atid=218189&group_id=18189&func=browse) and Steve is assigned to it. Steve, what's the status? Is that something you can commit now? If not, can it be pushed to 0.09? - There are 6 open patches (http://sourceforge.net/tracker/?atid=318189&group_id=18189&func=browse) . Again, are any important for 0.08? Is someone working on applying any? - There is one feature request (http://sourceforge.net/tracker/?atid=368189&group_id=18189&func=browse) about generating mocks dynamically with cglib. That's quite interesting and has been discussed a bit on the list. We don't need to address this item for 0.08. Thanks -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-14 14:44:43
|
Hi all, I'd like to do the release for MockObjects 0.08 ASAP (please tell me if you'd rather do it! :-)). Thus I need to know: 1/ Do you agree to release? 2/ Do you agree to let me perform the release (i.e. I would be the release manager)? 3/ Is anyone planning to add anything crucial for 0.08? If so now is the time to stand up... :-) 4/ Can all the developers who have contributed code to 0.08 please modify the changes.xml file to explain what changes they have brought since version 0.07? I'm fixing some docs which haven't been touched for more than 2 years for some of them... :-( Thanks -Vincent |
From: Vincent M. <vm...@us...> - 2003-05-14 14:40:27
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv5146/doc/xdocs Modified Files: changes.xml Log Message: Prepare area for the 0.08 changes Index: changes.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/xdocs/changes.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- changes.xml 15 Aug 2001 14:31:01 -0000 1.3 +++ changes.xml 14 May 2003 14:40:24 -0000 1.4 @@ -9,7 +9,11 @@ <person name="Steve Freeman" email="sm...@us..." id="SMGF"/> </devs> - <release version="0.01 (release on August 12 2001"> + <release version="0.08 (in CVS)"> + <!-- Please add stuff added in 0.08 that were not in 0.07 here --> + </release> + + <release version="0.01 (released on August 12 2001"> <action dev="SMGF" type="update"> The distribution zip now includes a zip of the sources. </action> |
From: Steve F. <st...@m3...> - 2003-05-14 13:46:58
|
Yes, this is a weakness of, essentially, slapping dynamic binding on top of static binding. In practice, it's usually manageable because: - each refactoring should be small - things tend to be very local when developing with MO - the good IDEs (Idea and Eclipse) will also do string replacement during a rename - if you get it wrong the tests will break so it's easy to find the references S. Barry Kaplan wrote: > What has been the experience (if any) of the use of refactoring tools > when using the dynamic.Mock class? Specifically, the use of strings for > specifying method names? With idea, I can ask to check for strings when > performing a refactoring, but finding usages is out. > > I can't think of any other alternative though, so I though I would ask > around. |
From: Barry K. <bk...@in...> - 2003-05-14 13:38:32
|
What has been the experience (if any) of the use of refactoring tools when using the dynamic.Mock class? Specifically, the use of strings for specifying method names? With idea, I can ask to check for strings when performing a refactoring, but finding usages is out. I can't think of any other alternative though, so I though I would ask around. |
From: Vincent M. <vm...@pi...> - 2003-05-14 11:41:23
|
Hi, With the old dyna mocks, I had: CallSequence sequence1 = new CallSequence(); sequence1.expectReturn(new Constraint[] {C.eq(1)}, "FIRSTNAME"); sequence1.expectReturn(new Constraint[] {C.eq(2)}, "LASTNAME"); mockResultSetMetaData.expect("getColumnName", sequence1); I guess, the new canonical way of writing this is simply: mockResultSetMetaData.expectAndReturn("getColumnName", C.eq(1), "FIRSTNAME"); mockResultSetMetaData.expectAndReturn("getColumnName", C.eq(2), "LASTNAME"); Is this correct? (It works here but I'd like to make sure I'm doing it correctly :-)). Thanks -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-14 07:50:14
|
> -----Original Message----- > From: Tim Mackinnon [mailto:tim...@po...] > Sent: 14 May 2003 02:18 > To: Vincent Massol; 'Mockobjects-Java-Dev' > Subject: RE: [MO-java-dev] First batch of questions on new Dynamic Mock > API > > [snip] > > > > - what is now replacing the setupDefaultResult() method? > > > > Ex: mockRequest.setupDefaultResult(String.class, null); > > > > Any answer for that? > > Yes: use matchAndReturn("methodName", C.isA(String.class), null) Does it mean the DynaMock API is not offering anymore default behaviors and that each and single method call has to be matched or expected? Not that I'm finding that bad, just asking... Thanks -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-14 07:46:18
|
> -----Original Message----- > From: Tim Mackinnon [mailto:tim...@po...] > Sent: 14 May 2003 02:18 > To: Vincent Massol; 'Mockobjects-Java-Dev' > Subject: RE: [MO-java-dev] First batch of questions on new Dynamic Mock > API > [snip] > > I think we finally got to the bottom of the stuff now - and I hope this > has > helped get a better description for your book. It has. Thanks a lot! I still maintain that the issue #1 with MockObjects.com is documentation... :-) Tim, I can assure you not everyone is used to reading the source code when using a third-party framework. I'm currently working on a project and the main issue to using MockObjects.com is documentation. I can't fire the 80+ developers telling them that they are not good enough... (Maybe 2 or 3 would be 1/ able to follow and understand the source code and 2/ willing to do so). Thus, the project manager has tasked me to write the missing MockObjects.com missing documentation for our project... *sigh* I have been postponing this as I also don't like to write doc and I have better things to do... This is just an example to show you that *from the outside* the MockObjects.com suffers from documentation. -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-14 07:35:44
|
> -----Original Message----- > From: Tim Mackinnon [mailto:tim...@po...] > Sent: 14 May 2003 01:49 > To: Vincent Massol; 'Steve Freeman' > Cc: 'Mockobjects-Java-Dev' > Subject: RE: [MO-java-dev] First batch of questions on new Dynamic Mock > API > > > > Ok thanks. Then I don't understand the difference between match*() and > > expectAndReturn(). > > > > This appears to be a stumbling block - its exactly what steve said.. but > to > repeat: > > expect means: "To consider obligatory; require: e.g. The school expects > its > pupils to be on time." > match means: "One that is like another in one or more specified qualities: > He is John's match for bravery." > > > Thus - expectAndReturn means that it is obligatory for a certain call to > happen. We specify that call (becuase java does method overloading). And > we > also specify the result of that call. > > matchAndReturn means that we just specify a value that is like what would > happen if the real call had taken place. Note that we DONT set any > expectation. If the call doesn't happen then no failure would happen. > > In other words, its a return without any expectation, however in Java you > cannot create a method called "return(String name, Object return value)" > as > return is a reserved word. > > I can't think of any clearer way of saying this - does it help? It does... It would have been faster for you to just say "yes" to my question... :-). For example: Vincent: "what's the difference between expect*() and match*()? It seems to me that the verify() will trigger a check to verify that the expect*() calls did actually happen whereas this would not be checked for the match*() ones? Is that correct?" Tim: "Yes, Vincent, that's correct" Thanks for your patience Tim! :-) -Vincent |
From: Tim M. <tim...@po...> - 2003-05-14 00:14:01
|
> -----Original Message----- > From: Vincent Massol [mailto:vm...@pi...] > > > - what is now replacing the setupDefaultResult() method? > > > Ex: mockRequest.setupDefaultResult(String.class, null); > > Any answer for that? Yes: use matchAndReturn("methodName", C.isA(String.class), null) > Does what? My questions is "simply what's the difference between > expect*() and match*()"... > > > There is a > > comment above these lines saying "// Set no expectations but answer a > > value > > for the specified method ". > > Yes, I have read this comment, hence my comment: " It seems to me that > the verify() will trigger a check to verify that the expect*() calls did > actually happen whereas this would not be checked for the match*() > ones". > > My English may seem good but I don't think in the same way as you do > guys so it may take me longer to understand something... please bear > with me ;-) This has been answered in a previous email which defines expect and match. > I'll complement my question: Is expect*() considered deprecated now? But > then, why is it in the example... expect is Not deprecated, see the previous email > ok, I think I get it now. A comment would be nice to explain this... Am > I allowed to comment it? I will admit that without more context it can be tricky - why not change the 1000 and 2000 numbers to constants that would express this without a comment? Go on - try doing something to the Test that would make you happy without a comment? > I had looked at the code. Here it is: > > public class OrderedMock extends Mock { > > public OrderedMock(Class mockedClass) { > this(mockedClass, mockNameFromClass(mockedClass)); > } > > public OrderedMock(Class mockedClass, String name) { > super(new DefaultCallFactory(), new > CallSequence(),mockedClass, name); > } > > } > > It doesn't tell anything to me.... and then if you have the time to > follow the code, it calls the following constructor from the Mock class: > > public Mock(CallFactory callFactory, CallableAddable > callableAddable, Class mockedClass, String name) { > this.name = name; > [...] > > Still without any comment! > > I would need to browse and scan the full code to understand what it > does... Come on Vincent - you are a better programmer than that - what do you think the method "mockNameFromClass(mockedClass)" does????? Especially when it calls a method which when I hover over in my idea pops up a window that says: "com....Mock(Class mockedClass, String name)" This doesn't need a comment!!!!! That took all of 15 seconds. In fact less as when choosing the constructor my IDE shows me the method signature for both. HOWEVER - having written this, I could improve the variable name, to nonDefaultName, which I have just done. > > > As the name of the Parameter, "name" implies, it gives the mock a non > > default name. > > I mean I can see that. My question wasn't that. It was: > > > > - What's the point of using the second parameter (i.e. "response") > in: > > > new OrderedMock(HttpServletResponse.class, "response"); > > I can't figure out why we need to use "response" in this test sample! It > doesn't seem to be used anywhere. I mean if we want to show how to use > the second parameter we should demonstrate an example where we need this > second parameter and explain why... Actually - I can improve that too, is "response that servlet writes to" a better example of something you might want to do so that you would get a better error description? Unfortunately its on the todo list to have a little App that generates all error messages to the console so that we can see them and understand the errors better. > Thus, if I understand correctly, there will be 2 solution for sequence > calls: > - use a OrderedMock but then all calls are supposed to be in the same > order as the order in which we define the match*() (or expect*()) calls. > - use expectBefore() when you simply need to order 2 calls > > Is that correct? Exactly! Others have proposed that with this primitive we can do some other stuff but thats later. I think we finally got to the bottom of the stuff now - and I hope this has helped get a better description for your book. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003 |