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: Tim M. <ma...@us...> - 2003-05-18 20:03:26
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv6600/core/com/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment Mock.java Log Message: Better named constructor variable name. Index: Mock.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Mock.java,v retrieving revision 1.16.2.14 retrieving revision 1.16.2.15 diff -u -r1.16.2.14 -r1.16.2.15 --- Mock.java 18 May 2003 10:26:26 -0000 1.16.2.14 +++ Mock.java 18 May 2003 20:03:23 -0000 1.16.2.15 @@ -22,16 +22,15 @@ this.proxy = Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { mockedClass }, this); } - public Mock(Class mockedClass, String name) { - this(new DefaultCallFactory(), new CallBag(), mockedClass, name); + public Mock(Class mockedClass, String nonDefaultName) { + this(new DefaultCallFactory(), new CallBag(), mockedClass, nonDefaultName); } public Mock(Class mockedClass) { this(mockedClass, mockNameFromClass(mockedClass)); } - public void reset() - { + public void reset() { this.callSequence.reset(); } |
From: <je...@mk...> - 2003-05-18 13:33:26
|
Quoting Vincent Massol <vm...@pi...>: > Hi, > > What do you think of > http://blogs.codehaus.org/people/vmassol/archives/000023.html ? > > Should it be something we would like to do to? > > Joe, how easy would it be? > > Thanks > -Vincent http://subwiki.tigris.org/ http://www.webdav.org/wiki/projects/SubWiki > > > > ------------------------------------------------------- > This SF.net email is sponsored by: If flattening out C++ or Java > code to make your application fit in a relational database is painful, > don't do it! Check out ObjectStore. Now part of Progress Software. > http://www.objectstore.net/sourceforge > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > |
From: Vincent M. <vm...@pi...> - 2003-05-18 12:35:58
|
> -----Original Message----- > From: Joe Walnes [mailto:jo...@tr...] > Sent: 18 May 2003 14:09 > To: Vincent Massol > Cc: 'Steve Freeman'; moc...@li... > Subject: Re: [MO-java-dev] Wiki -> CVS -> Mailing list? > > Moin stores all the content as readable flat files in a simple > directory. There's no reason why these can't be check in to CVS and a > hook attached to moin to commit on each edit. Although this isn't really > needed as moin supports it's own versioning system and the capabilities > to subscribe to page change notifications which will cause the diff > emails to be sent out. Yes but diff commits and versioning is not the reason I wanted to hook moinmoin to CVS. It was simply to store all our source files (be them java sources or doc sources) in a single place. Which also allows to package docs in releases, btw. > > I'm a great fan of wikis because of their accessibility. It's a PITA > having to check out from cvs, edit xdocs, build site, commit, upload, > etc. Yes, agreed. > My other preferred site maintenance tools are WebDav + SiteMesh > </plug> :). :-) What WebDav server? Slide? Apache mod_dav? What is SiteMesh used for? Rendering? I thought it was a presentation layout framework. Thanks Joe -Vincent > > -joe |
From: Joe W. <jo...@tr...> - 2003-05-18 12:09:17
|
Moin stores all the content as readable flat files in a simple directory. There's no reason why these can't be check in to CVS and a hook attached to moin to commit on each edit. Although this isn't really needed as moin supports it's own versioning system and the capabilities to subscribe to page change notifications which will cause the diff emails to be sent out. I'm a great fan of wikis because of their accessibility. It's a PITA having to check out from cvs, edit xdocs, build site, commit, upload, etc. My other preferred site maintenance tools are WebDav + SiteMesh </plug> :). -joe |
From: Vincent M. <vm...@us...> - 2003-05-18 10:26:29
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv5964/src/core/com/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment DefaultCallFactory.java ExpectedCall.java Mock.java Log Message: Removed superfluous comments Index: DefaultCallFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/DefaultCallFactory.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- DefaultCallFactory.java 5 May 2003 22:44:33 -0000 1.1.2.4 +++ DefaultCallFactory.java 18 May 2003 10:26:26 -0000 1.1.2.5 @@ -1,11 +1,5 @@ -/* - * Created on 07-Apr-2003 - */ package com.mockobjects.dynamic; -/** - * @author dev - */ public class DefaultCallFactory implements CallFactory { public Callable createReturnStub(Object result) { Index: ExpectedCall.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/ExpectedCall.java,v retrieving revision 1.2.2.7 retrieving revision 1.2.2.8 diff -u -r1.2.2.7 -r1.2.2.8 --- ExpectedCall.java 5 May 2003 22:44:33 -0000 1.2.2.7 +++ ExpectedCall.java 18 May 2003 10:26:26 -0000 1.2.2.8 @@ -1,13 +1,7 @@ -/* - * Created on 07-Apr-2003 - */ package com.mockobjects.dynamic; import junit.framework.*; -/** - * @author dev - */ //TODO rename to CallOnce public class ExpectedCall implements Callable { private Callable delegate; Index: Mock.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Mock.java,v retrieving revision 1.16.2.13 retrieving revision 1.16.2.14 diff -u -r1.16.2.13 -r1.16.2.14 --- Mock.java 17 May 2003 18:55:23 -0000 1.16.2.13 +++ Mock.java 18 May 2003 10:26:26 -0000 1.16.2.14 @@ -1,7 +1,3 @@ -/* - * Created on 04-Apr-2003 - * - */ package com.mockobjects.dynamic; import java.lang.reflect.InvocationHandler; @@ -36,7 +32,7 @@ public void reset() { - callSequence.reset(); + this.callSequence.reset(); } public static String mockNameFromClass(Class c) { @@ -71,15 +67,15 @@ } public String getMockName() { - return name; + return this.name; } public String toString() { - return name; + return this.name; } public Object proxy() { - return proxy; + return this.proxy; } public Object invoke(Object proxy, Method method, Object[] args) |
From: Vincent M. <vm...@us...> - 2003-05-18 10:25:11
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv5515/src/core/com/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment CallBag.java Log Message: use this. keyword for better readability Index: CallBag.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/CallBag.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- CallBag.java 18 May 2003 07:18:18 -0000 1.1.2.6 +++ CallBag.java 18 May 2003 10:25:07 -0000 1.1.2.7 @@ -16,16 +16,16 @@ } public void reset() { - expectedCalls.clear(); - expectedMatches.clear(); + this.expectedCalls.clear(); + this.expectedMatches.clear(); } public Object call(Mock mock, String methodName, Object[] args) throws Throwable { - Callable matchingCall = findMatchingCall(methodName, args, expectedCalls); + Callable matchingCall = findMatchingCall(methodName, args, this.expectedCalls); if(matchingCall == null) { - matchingCall = findMatchingCall(methodName, args, expectedMatches); + matchingCall = findMatchingCall(methodName, args, this.expectedMatches); } if(matchingCall == null) { throw createUnexpectedCallError(methodName, args); @@ -48,14 +48,14 @@ } public String getDescription() { - if (expectedCalls.isEmpty()) { + if (this.expectedCalls.isEmpty()) { return "no methods"; } else { StringBuffer buf = new StringBuffer(); buf.append("one of:\n"); - for (Iterator i = expectedCalls.iterator(); i.hasNext();) { + for (Iterator i = this.expectedCalls.iterator(); i.hasNext();) { buf.append(((Callable) i.next()).getDescription()); buf.append("\n"); } @@ -69,17 +69,17 @@ } public void verify() { - for (Iterator call = expectedCalls.iterator(); call.hasNext();) { + for (Iterator call = this.expectedCalls.iterator(); call.hasNext();) { Callable element = (Callable) call.next(); element.verify(); } } public void addExpect(Callable call) { - expectedCalls.add(call); + this.expectedCalls.add(call); } public void addMatch(Callable call) { - expectedMatches.add(call); + this.expectedMatches.add(call); } } |
From: Vincent M. <vm...@pi...> - 2003-05-18 10:18:04
|
Ok, I've found the error. For those interested it has to do with unit testing EJB code. Very often the EJB Homes are cached in static variables. As I was mocking the EJB Home using the DynaMock this dyna mock instance was saved as a static variable and thus the same expectations were carried across different tests making the test fail for some tests.... Statics are evil! :-) -Vincent > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On Behalf Of > Vincent Massol > Sent: 18 May 2003 09:37 > To: 'Mockobjects-Java-Dev' > Subject: RE: [MO-java-dev] [DynaMock] Very difficult to factorize > matches... > > After looking at the source code, it seems the behavior is correctly > implemented. There must be some other error in my test... debugging > now... > > Thanks and sorry for the false alarm :-) > -Vincent > > > -----Original Message----- > > From: moc...@li... > > [mailto:moc...@li...] On Behalf Of > > Vincent Massol > > Sent: 18 May 2003 08:59 > > To: 'Mockobjects-Java-Dev' > > Subject: [MO-java-dev] [DynaMock] Very difficult to factorize > matches... > > > > Hi, > > > > It is currently very difficult to write common setUp using the new > Dyna > > Mock API (it was easy with the previous DynaMock API). The main reason > > is that you cannot write something like that: > > > > public void setUp() > > { > > mock.matchAndReturn("create", C.ANY_ARGS, whatever); > > } > > > > public void test1() > > { > > [...] > > } > > > > public void test2() > > { > > [...] > > } > > > > public void testException() > > { > > mock.expectAndThrow("create", C.ANY_ARGS, > > new CreateException("error")); > > [...] > > } > > > > The testException() test will fail with: > > > > junit.framework.AssertionFailedError: mockOrderLocalHome: > create(<ANY>) > > was expected but not called > > > > I think that it would be a normal behavior that expectations override > > matches. > > > > What do you think? > > > > Thanks > > -Vincent > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: If flattening out C++ or Java > > code to make your application fit in a relational database is painful, > > don't do it! Check out ObjectStore. Now part of Progress Software. > > http://www.objectstore.net/sourceforge > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > > ------------------------------------------------------- > This SF.net email is sponsored by: If flattening out C++ or Java > code to make your application fit in a relational database is painful, > don't do it! Check out ObjectStore. Now part of Progress Software. > http://www.objectstore.net/sourceforge > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Vincent M. <vm...@pi...> - 2003-05-18 08:21:06
|
After looking at the source code, it seems the behavior is correctly implemented. There must be some other error in my test... debugging now... Thanks and sorry for the false alarm :-) -Vincent > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On Behalf Of > Vincent Massol > Sent: 18 May 2003 08:59 > To: 'Mockobjects-Java-Dev' > Subject: [MO-java-dev] [DynaMock] Very difficult to factorize matches... > > Hi, > > It is currently very difficult to write common setUp using the new Dyna > Mock API (it was easy with the previous DynaMock API). The main reason > is that you cannot write something like that: > > public void setUp() > { > mock.matchAndReturn("create", C.ANY_ARGS, whatever); > } > > public void test1() > { > [...] > } > > public void test2() > { > [...] > } > > public void testException() > { > mock.expectAndThrow("create", C.ANY_ARGS, > new CreateException("error")); > [...] > } > > The testException() test will fail with: > > junit.framework.AssertionFailedError: mockOrderLocalHome: create(<ANY>) > was expected but not called > > I think that it would be a normal behavior that expectations override > matches. > > What do you think? > > Thanks > -Vincent > > > > ------------------------------------------------------- > This SF.net email is sponsored by: If flattening out C++ or Java > code to make your application fit in a relational database is painful, > don't do it! Check out ObjectStore. Now part of Progress Software. > http://www.objectstore.net/sourceforge > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv16193/src/core/com/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment CallBag.java CallMatch.java CallSequence.java Callable.java CallableAddable.java Log Message: - Moved reset() from Callable to CallableAddable as it was an error to put it in Callable - Removed superfluous comments - Fixed rest of classes to work with new reset() Index: CallBag.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/CallBag.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- CallBag.java 17 May 2003 18:55:23 -0000 1.1.2.5 +++ CallBag.java 18 May 2003 07:18:18 -0000 1.1.2.6 @@ -15,8 +15,7 @@ public CallBag() { } - public void reset() - { + public void reset() { expectedCalls.clear(); expectedMatches.clear(); } Index: CallMatch.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/CallMatch.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- CallMatch.java 5 May 2003 22:44:33 -0000 1.1.2.6 +++ CallMatch.java 18 May 2003 07:18:18 -0000 1.1.2.7 @@ -1,6 +1,3 @@ -/* - * Created on 04-Apr-2003 - */ package com.mockobjects.dynamic; import junit.framework.Assert; Index: CallSequence.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/CallSequence.java,v retrieving revision 1.4.2.7 retrieving revision 1.4.2.8 diff -u -r1.4.2.7 -r1.4.2.8 --- CallSequence.java 17 Apr 2003 16:17:30 -0000 1.4.2.7 +++ CallSequence.java 18 May 2003 07:18:18 -0000 1.4.2.8 @@ -1,6 +1,3 @@ -/* - * Created on 14-Apr-2003 - */ package com.mockobjects.dynamic; import java.util.ArrayList; @@ -14,10 +11,12 @@ private CallBag matchedCalls = new CallBag(); int callIndex = 0; - public CallSequence() { - - } - + public void reset() + { + this.expectedCalls.clear(); + this.matchedCalls.reset(); + } + public Object call(Mock mock, String methodName, Object[] args) throws Throwable { if (expectedCalls.size() == 0) throw new AssertionFailedError("no methods defined on mock, received: " + DynamicUtil.methodToString(methodName, args)); if (callIndex == expectedCalls.size()) throw new AssertionFailedError("mock called too many times, received: " + DynamicUtil.methodToString(methodName, args)); Index: Callable.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/Callable.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- Callable.java 17 May 2003 18:55:23 -0000 1.1.2.3 +++ Callable.java 18 May 2003 07:18:18 -0000 1.1.2.4 @@ -6,9 +6,4 @@ String getDescription(); Object call( Mock mock, String methodName, Object[] args ) throws Throwable; boolean matches(String methodName, Object[] args); - - /** - * Resets all expected calls and expected matches. - */ - void reset(); } Index: CallableAddable.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/CallableAddable.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- CallableAddable.java 17 Apr 2003 16:17:27 -0000 1.1.2.2 +++ CallableAddable.java 18 May 2003 07:18:18 -0000 1.1.2.3 @@ -1,9 +1,11 @@ -/* - * Created on 14-Apr-2003 - */ package com.mockobjects.dynamic; public interface CallableAddable extends Callable { void addExpect(Callable call); void addMatch(Callable call); + + /** + * Resets all expected calls and expected matches. + */ + void reset(); } |
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv16193/src/core/test/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment CallBagTest.java CallMatchTest.java ConstraintMatcherTest.java MockCallableAddable.java Log Message: - Moved reset() from Callable to CallableAddable as it was an error to put it in Callable - Removed superfluous comments - Fixed rest of classes to work with new reset() Index: CallBagTest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/Attic/CallBagTest.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- CallBagTest.java 5 May 2003 22:47:09 -0000 1.1.2.3 +++ CallBagTest.java 18 May 2003 07:18:19 -0000 1.1.2.4 @@ -1,6 +1,3 @@ -/* - * Created on 04-Apr-2003 - */ package test.mockobjects.dynamic; import com.mockobjects.dynamic.*; @@ -8,10 +5,6 @@ import junit.framework.*; - -/** - * @author dev - */ public class CallBagTest extends TestCase { final String METHOD_A_NAME = "methodA"; final String METHOD_A_RESULT = "resultA"; Index: CallMatchTest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/Attic/CallMatchTest.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- CallMatchTest.java 5 May 2003 22:47:09 -0000 1.1.2.6 +++ CallMatchTest.java 18 May 2003 07:18:19 -0000 1.1.2.7 @@ -65,8 +65,6 @@ } public void testCallDoesNotMatchWhenWrongName() throws Throwable { - CallMatch call = new CallMatch(METHOD_NAME, C.ANY_ARGS, mockCallable); - assertFalse("call does not match", callMatch.matches("anotherName", IGNORED_ARGS)); mockCallable.verifyExpectations(); } Index: ConstraintMatcherTest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/Attic/ConstraintMatcherTest.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- ConstraintMatcherTest.java 5 May 2003 22:47:10 -0000 1.1.2.1 +++ ConstraintMatcherTest.java 18 May 2003 07:18:19 -0000 1.1.2.2 @@ -1,6 +1,3 @@ -/* - * Created on 20-Apr-03 - */ package test.mockobjects.dynamic; import com.mockobjects.dynamic.*; @@ -8,9 +5,7 @@ import junit.framework.TestCase; - public class ConstraintMatcherTest extends TestCase { - private final String METHOD_NAME = "methodA"; public ConstraintMatcherTest(String name) { super(name); Index: MockCallableAddable.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/Attic/MockCallableAddable.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- MockCallableAddable.java 17 Apr 2003 16:17:26 -0000 1.1.2.2 +++ MockCallableAddable.java 18 May 2003 07:18:19 -0000 1.1.2.3 @@ -5,6 +5,7 @@ import com.mockobjects.dynamic.Callable; import com.mockobjects.dynamic.CallableAddable; import com.mockobjects.dynamic.Mock; +import com.mockobjects.util.NotImplementedException; //Mock modified for []args public class MockCallableAddable extends MockObject implements CallableAddable { @@ -25,6 +26,10 @@ private ExpectationList myCallParameter2Values = new ExpectationList("com.mockobjects.dynamic.CallableAddable CallParameter2Values"); private ExpectationCounter myVerifyCalls = new ExpectationCounter("com.mockobjects.dynamic.CallableAddable VerifyCalls"); + public void reset() { + throw new NotImplementedException(); + } + public void setExpectedAddMatchCalls(int calls) { myAddMatchCalls.setExpected(calls); } |
From: Vincent M. <vm...@pi...> - 2003-05-18 06:59:11
|
Hi, It is currently very difficult to write common setUp using the new Dyna Mock API (it was easy with the previous DynaMock API). The main reason is that you cannot write something like that: public void setUp() { mock.matchAndReturn("create", C.ANY_ARGS, whatever); } public void test1() { [...] } public void test2() { [...] } public void testException() { mock.expectAndThrow("create", C.ANY_ARGS, new CreateException("error")); [...] } The testException() test will fail with: junit.framework.AssertionFailedError: mockOrderLocalHome: create(<ANY>) was expected but not called I think that it would be a normal behavior that expectations override matches. What do you think? Thanks -Vincent |
From: Vincent M. <vm...@us...> - 2003-05-17 18:55:26
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv10983/src/core/com/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment CallBag.java Callable.java Mock.java Log Message: Added support for resetting mocks (i.e. resetting expected calls and expected matches). Index: CallBag.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/CallBag.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- CallBag.java 17 Apr 2003 16:17:30 -0000 1.1.2.4 +++ CallBag.java 17 May 2003 18:55:23 -0000 1.1.2.5 @@ -15,6 +15,12 @@ public CallBag() { } + public void reset() + { + expectedCalls.clear(); + expectedMatches.clear(); + } + public Object call(Mock mock, String methodName, Object[] args) throws Throwable { Index: Callable.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/Callable.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- Callable.java 14 Apr 2003 08:46:27 -0000 1.1.2.2 +++ Callable.java 17 May 2003 18:55:23 -0000 1.1.2.3 @@ -1,14 +1,14 @@ -/* - * Created on 04-Apr-2003 - */ package com.mockobjects.dynamic; import com.mockobjects.*; - public interface Callable extends Verifiable { String getDescription(); Object call( Mock mock, String methodName, Object[] args ) throws Throwable; - boolean matches(String methodName, Object[] args); + + /** + * Resets all expected calls and expected matches. + */ + void reset(); } Index: Mock.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Mock.java,v retrieving revision 1.16.2.12 retrieving revision 1.16.2.13 diff -u -r1.16.2.12 -r1.16.2.13 --- Mock.java 5 May 2003 22:44:33 -0000 1.16.2.12 +++ Mock.java 17 May 2003 18:55:23 -0000 1.16.2.13 @@ -13,9 +13,6 @@ import com.mockobjects.Verifiable; import com.mockobjects.constraint.Constraint; -/** - * @author dev - */ public class Mock implements InvocationHandler,Verifiable { private String name; private Object proxy; @@ -37,6 +34,11 @@ this(mockedClass, mockNameFromClass(mockedClass)); } + public void reset() + { + callSequence.reset(); + } + public static String mockNameFromClass(Class c) { return "mock" + className(c); } |
From: Vincent M. <vm...@pi...> - 2003-05-17 18:54:50
|
Hi, I have a requirement for introducing a reset on dyna mocks so that they can be reused. Here's the use case: I am setting up a Mock InitialContext factory with: NamingManager.setInitialContextFactoryBuilder( new InitialContextFactoryBuilder() { public InitialContextFactory createInitialContextFactory( Hashtable environment) throws NamingException { return new InitialContextFactory() { public Context getInitialContext(Hashtable env) throws NamingException { // Return the mock context here return context; } }; } }); The setInitialContextFactoryBuilder() is a static method and can only be called *ONCE* in the lifetime of the JVM. Which means that it will be shared between testXXX() tests. Thus the InitialContext mock (in "return context") also has to be static. The second step is to define expectations on the context mock lookup() method so that we can return mocks. By doing this we are tying the static context mock with the other per-testXXX() mocks... ... which means that if we have 2 test methods setting expectations on lookup() with the same lookup name, the second test fails.... I believe this is a valid use case and that in order to support this use case, we need to introduce a reset() method in the dynamock Mock class to rest all expectations. I've just committed the patch to support this reset method. If you think we should not have a reset() method, I can always remove it. Thanks -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-17 15:23:44
|
I have to apologize for all my out-of-sync emails. It's independent of my goodwill... It seems my provider has had some huge outage during the past 2 days and the emails I sent yesterday are only sent today.... Sorry about that... Thanks -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-17 15:01:38
|
Changelog can be found on http://wiki.truemesh.com/mockobjects/ReleaseChanges Thanks -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-17 14:52:10
|
> -----Original Message----- > From: Steve Freeman [mailto:st...@m3...] > Sent: 17 May 2003 16:34 > To: Vincent Massol > Cc: 'Mockobjects-Java-Dev' > Subject: Re: [MO-java-dev] Wiki -> CVS -> Mailing list? > > That's a cute idea. > It has the nice advantage of overcoming the only drawback that I was seeing with the wiki, i.e. that the project could not easily package its documentation in the release and that the doc was not part of the project. > what's this codehaus thing? Check www.codehaus.org. Bob McWhirter whom I know from Maven has kindly provided a blog for me. Thanks -Vincent > > S. > > Vincent Massol wrote: > > Hi, > > > > What do you think of > > http://blogs.codehaus.org/people/vmassol/archives/000023.html ? > > > > Should it be something we would like to do to? > > > > Joe, how easy would it be? > > > > Thanks > > -Vincent > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: If flattening out C++ or Java > > code to make your application fit in a relational database is painful, > > don't do it! Check out ObjectStore. Now part of Progress Software. > > http://www.objectstore.net/sourceforge > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > -- > "A LISP programmer knows the value of everything but the cost of nothing. > A C programmer knows the cost of everything but the value of nothing." > (Todd Proebsting) > |
From: Steve F. <st...@m3...> - 2003-05-17 14:32:55
|
That's a cute idea. what's this codehaus thing? S. Vincent Massol wrote: > Hi, > > What do you think of > http://blogs.codehaus.org/people/vmassol/archives/000023.html ? > > Should it be something we would like to do to? > > Joe, how easy would it be? > > Thanks > -Vincent > > > > ------------------------------------------------------- > This SF.net email is sponsored by: If flattening out C++ or Java > code to make your application fit in a relational database is painful, > don't do it! Check out ObjectStore. Now part of Progress Software. > http://www.objectstore.net/sourceforge > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- "A LISP programmer knows the value of everything but the cost of nothing. A C programmer knows the cost of everything but the value of nothing." (Todd Proebsting) |
From: Vincent M. <vm...@pi...> - 2003-05-17 14:27:20
|
Hi guys, It's all yours... :-) -Vincent |
From: Vincent M. <vm...@pi...> - 2003-05-17 13:52:50
|
Tim, See Joe's answer on the mockobjects-java-dev mailing list Thanks -Vincent > -----Original Message----- > From: Tim Mackinnon [mailto:tim...@po...] > Sent: 17 May 2003 15:31 > To: Vincent Massol > Subject: RE: [MO-java-dev] [New DynaMock] expectNotCalled deprecated, why? > > So you would like it availabe as a null operation? (i.e. its an empty > method > that does nothing). > > I suppose we could consider this - although it seems a bit strange. My > worry > would be that it could cause people to have a false view of what the > library > does - e.g. you will get an exception if something is called that you > don't > explicity set an expectation for... So other calls that you forget to say > "expectNothing" will fail anyway. > > I could be convinced otherwise though. > > Tim > > p.s. I am bit busy this weekend to look at your example sorry. > > > -----Original Message----- > > From: moc...@li... > > [mailto:moc...@li...]On Behalf Of > > Vincent Massol > > Sent: 16 May 2003 08:49 > > To: 'Mockobjects-Java-Dev' > > Subject: RE: [MO-java-dev] [New DynaMock] expectNotCalled deprecated, > > why? > > > > > > Actually, I've understood the comment now but I still think this method > > should not be deprecated as it explains what the test is trying to do. > > With no method, you'll need to either document the test or hope that the > > reader will understand it... > > > > What do you think? > > > > Thanks > > -Vincent > > > > > -----Original Message----- > > > From: moc...@li... > > > [mailto:moc...@li...] On Behalf Of > > > Vincent Massol > > > Sent: 16 May 2003 09:30 > > > To: 'Mockobjects-Java-Dev' > > > Subject: [MO-java-dev] [New DynaMock] expectNotCalled deprecated, why? > > > > > > Hi, > > > > > > I've just noticed expectNotCalled() has been deprecated in the new > > > DynaMock API. I am wondering why as I've found it quite useful. The > > > javadoc says that "Not required, as if methodName is called, you will > > > get a an exception". I think an example in the javadoc would have been > > > more powerful an explanation. I'm not sure I understand... Here's the > > > current test I am migrating: > > > > > > public void testGetOrderHomeFromCache() throws Exception > > > { > > > // First call to ensure the home is in the cache > > > OrderUtil.getOrderHome(); > > > > > > // Make sure the lookup method is NOT called thus proving the > > > object > > > // is served from the cache > > > jndiTestSetup.getMockContext().expectNotCalled("lookup"); > > > OrderUtil.getOrderHome(); > > > } > > > > > > What should it be now? > > > > > > I liked the expectNotCalled as it expressed very nicely what it means > > > and what the test means. Handling this with an exception seems like a > > > hack to me (and not conveying the test message at all), but I'd like > > to > > > be proved wrong! :-) > > > > > > Thanks > > > -Vincent > > > > > > > > > > > > ------------------------------------------------------- > > > 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 > > > > > > _______________________________________________ > > > Mockobjects-java-dev mailing list > > > Moc...@li... > > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > > > > > > ------------------------------------------------------- > > 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 > > > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > > --- > > Incoming 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 > > > --- > 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 |
From: Steve F. <st...@m3...> - 2003-05-17 12:54:54
|
DynamicMockExperiment Barry Kaplan wrote: > I see a few, so I'm not sure which to get. > > > > ------------------------------------------------------- > 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 > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Vincent M. <vm...@pi...> - 2003-05-17 12:47:08
|
Hi, What do you think of http://blogs.codehaus.org/people/vmassol/archives/000023.html ? Should it be something we would like to do to? Joe, how easy would it be? Thanks -Vincent |
From: Vincent M. <vm...@us...> - 2003-05-16 19:31:43
|
Update of /cvsroot/mockobjects/mockobjects-java In directory sc8-pr-cvs1:/tmp/cvs-serv25095 Modified Files: build.xml Log Message: Increased version number for next version Index: build.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/build.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- build.xml 16 May 2003 19:03:33 -0000 1.34 +++ build.xml 16 May 2003 19:31:39 -0000 1.35 @@ -20,7 +20,7 @@ <target name="project-properties"> <property name="project.fullname" value="Mock Objects" /> - <property name="project.version" value="0.08" /> + <property name="project.version" value="0.09dev" /> <property name="year" value="2002" /> <property name="debug" value="on" /> <property name="optimize" value="off" /> |
From: Vincent M. <vm...@us...> - 2003-05-16 19:03:37
|
Update of /cvsroot/mockobjects/mockobjects-java In directory sc8-pr-cvs1:/tmp/cvs-serv15453 Modified Files: build.xml Log Message: - Removed targets used to generate the web site - Prepare for release by moving the version to 0.08 Index: build.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- build.xml 13 May 2003 08:59:12 -0000 1.33 +++ build.xml 16 May 2003 19:03:33 -0000 1.34 @@ -3,6 +3,7 @@ <property file="${user.home}/build.properties" /> <property file="build.properties" /> + <property name="out.dir" value="out" /> <property name="out.doc.dir" value="${out.dir}/doc" /> <property name="out.javadoc.dir" value="${out.doc.dir}/javadoc" /> @@ -19,7 +20,7 @@ <target name="project-properties"> <property name="project.fullname" value="Mock Objects" /> - <property name="project.version" value="0.08dev" /> + <property name="project.version" value="0.08" /> <property name="year" value="2002" /> <property name="debug" value="on" /> <property name="optimize" value="off" /> @@ -40,8 +41,7 @@ <property name="j2ee.lib" value="lib/j2ee.jar" /> </target> - <target name="deliverable-names" - depends="project-properties"> + <target name="deliverable-names" depends="project-properties"> <property name="dist.dir" value="dist" /> <property name="jar.base.name" value="${ant.project.name}-${project.version}" /> <property name="alt.jar.base.name" value="alt-${project.version}" /> @@ -57,8 +57,8 @@ </patternset> </target> - <target name="check-availabilities" - depends="source-locations"> + <target name="check-availabilities" depends="source-locations"> + <path id="lib.classpath"> <fileset dir="${lib.dir}"> <include name="*.jar" /> @@ -107,42 +107,31 @@ <filter token="today" value="${TODAY}" /> </target> - <target name="_flush-dir"> - <!-- requires flush.dir --> - <delete dir="${flush.dir}" quiet="yes" /> - - <mkdir dir="${flush.dir}" /> - </target> - - <target name="compile-core" - depends="call-me-first" + <target name="compile-core" depends="call-me-first" description="Compile mock objects core"> - <mkdir dir="${core.classes}" /> + <mkdir dir="${core.classes}" /> <javac destdir="${core.classes}" debug="${debug}" verbose="false" optimize="${optimize}" - srcdir="${src.core.dir}"> - + srcdir="${src.core.dir}"> <classpath> <path refid="lib.classpath" /> <pathelement path="${java.class.path}" /> </classpath> </javac> + </target> - <target name="compile-jdk" - depends="compile-core" + <target name="compile-jdk" depends="compile-core" description="Compile all the java files for included libraries"> - <mkdir dir="${jdk.classes}" /> - <javac destdir="${jdk.classes}" debug="${debug}" - verbose="false" + <mkdir dir="${jdk.classes}" /> + <javac destdir="${jdk.classes}" debug="${debug}" verbose="false" optimize="${optimize}"> <src path="${src.jdk.dir}/${jdk.version}" /> <src path="${src.jdk.dir}/common" /> - <classpath> <path refid="lib.classpath" /> <pathelement path="${java.class.path}" /> @@ -355,122 +344,6 @@ </javadoc> </target> - <target name="_prepare-xdoc"> - <!-- requires prepare.xdoc.dir, book.xml.file --> - <mkdir dir="${prepare.xdoc.dir}" /> - - <!-- Copy doc-book.xml to book.xml for defining the local - documentation web site and replacing token filters (year) --> - <copy file="${xdoc.dir}/${book.xml.file}" filtering="on" - tofile="${prepare.xdoc.dir}/book.xml" /> - - <!-- Copy all remaining files from ${xdoc.dir} to - ${out.xdoc.doc.dir} --> - <copy todir="${prepare.xdoc.dir}" filtering="on"> - <fileset dir="${xdoc.dir}"> - <exclude name="*-book.xml" /> - </fileset> - </copy> - </target> - - <target name="prepare-doc" depends="javadoc"> - <mkdir dir="${out.doc.dir}" /> - - <mkdir dir="${out.doc.dir}/images" /> - - <antcall target="_prepare-xdoc"> - <param name="prepare.xdoc.dir" value="${out.xdoc.doc.dir}" /> - <param name="book.xml.file" value="doc-book.xml" /> - </antcall> - -<!-- Copy the images --> - <copy todir="${out.doc.dir}/images"> - <fileset dir="${xdoc.dir}/images" /> - </copy> - -<!-- Copy other files (non XML) --> - <copy todir="${out.doc.dir}"> - <fileset dir="${xdoc.dir}"> - <include name="misc/*.pdf" /> - - <include name="papers/**" /> - </fileset> - </copy> - - <uptodate property="stylebook.doc.notrequired" - targetfile="${out.doc.dir}/index.html"> - <srcfiles dir="${out.xdoc.doc.dir}" includes="**/*.*" /> - - <srcfiles dir="${skin.dir}" includes="**/*.*" /> - </uptodate> - </target> - - <target name="doc" depends="prepare-doc" - unless="stylebook.doc.notrequired" - description="Generate the documentation website"> - </target> - - <!-- - ======================================================================== - Generate the web site - Note that we do not copy the javadoc to the web site. This is - because the web site need to evolve independently of the javadoc - for a given version of the project. In other words, the javadoc on - the web site must not change until a new release is out. - ======================================================================== - --> - <!-- - <target name="prepare-site" - depends="deliverable-names, call-me-first"> - <mkdir dir="${out.site.dir}" /> - - <antcall target="_prepare-xdoc"> - <param name="prepare.xdoc.dir" value="${out.xdoc.site.dir}" /> - <param name="book.xml.file" value="site-book.xml" /> - </antcall> - - <mkdir dir="${out.site.dir}/images" /> - <copy todir="${out.site.dir}/images"> - <fileset dir="${xdoc.dir}/images" /> - </copy> - - <copy todir="${out.site.dir}/papers"> - <fileset dir="${xdoc.dir}/papers" /> - </copy> - - <copy todir="${out.site.dir}"> - <fileset dir="${xdoc.dir}"> - <include name="misc/*.pdf" /> - </fileset> - </copy> - - <uptodate property="stylebook.site.notrequired" - targetfile="${out.site.dir}/index.html"> - <srcfiles dir="${out.xdoc.site.dir}" includes="**/*.*" /> - <srcfiles dir="${skin.dir}" includes="**/*.*" /> - </uptodate> - - </target> - - <target name="site" - description="Generate the web site" - depends="deliverable-names, prepare-site" - unless="stylebook.site.notrequired"> - - <stylebook book="${out.xdoc.site.dir}/book.xml" - skinDirectory="${skin.dir}/jakarta.apache.org" - targetDirectory="${out.site.dir}"> - <classpath> - <pathelement path="${java.class.path}" /> - </classpath> - </stylebook> - - <tar tarfile="${out.dir}/${site.name}.tar" basedir="${out.site.dir}" /> - <gzip zipfile="${out.dir}/${site.name}.tar.gz" src="${out.dir}/${site.name}.tar" /> - <delete file="${out.dir}/${site.name}.tar" /> - </target> - --> - <target name="clean-compiled" description="Clean up compiled class files" depends="call-me-first" > @@ -499,7 +372,7 @@ </target> <target name="prepare-dist" - depends="jar,doc"> + depends="jar,javadoc"> <mkdir dir="${dist.dir}" /> </target> @@ -516,8 +389,6 @@ <include name="*.jar" /> </zipfileset> - <zipfileset dir="${out.doc.dir}" prefix="doc" /> - <zipfileset dir="${out.dir}" prefix="src"> <include name="${ant.project.name}-${project.version}-src.zip" /> </zipfileset> @@ -530,43 +401,9 @@ ======================================================================== --> <target name="all" - depends="clean, junit, jar, doc, dist" - description="do it all (clean, jar, doc, junit, dist)"> + depends="clean, junit, jar, javadoc, dist" + description="do it all (clean, jar, javadoc, junit, dist)"> </target> - -<!-- - ======================================================================== - Deploy the web site to SourceForge, using the 'scp' - and 'ssh' commands. The variable "username" need to be passed to Ant - when calling this target and represent your username on SourceForge. - - Ex: ant -Dusername=vmassol deploy-site - - ======================================================================== - --> -<!-- - <target name="deploy-site" depends="clean, site" if="username" - description="Deploy the web site to SourceForge (see target for details)"> - - <property name="deploy.homepage" - value="/home/groups/m/mo/mockobjects/htdocs" /> - - <property name="deploy.host" - value="mockobjects.sourceforge.net" /> - - <exec dir="." executable="scp"> - <arg value="${out.dir}/${site.name}.tar.gz" /> - - <arg value="${username}@${deploy.host}:${deploy.homepage}" /> - </exec> - - <exec dir="." executable="ssh"> - <arg - line="-l ${username} ${deploy.host} 'cd ${deploy.homepage};gunzip ${site.name}.tar.gz;tar xvf ${site.name}.tar;rm ${site.name}.tar'" /> - </exec> - </target> ---> - <target name="src" depends="clean,prepare-dist"> <property name="dist.name" |
From: Barry K. <bk...@in...> - 2003-05-16 18:48:25
|
I see a few, so I'm not sure which to get. |
From: Vincent M. <vm...@us...> - 2003-05-16 18:27:27
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs/papers In directory sc8-pr-cvs1:/tmp/cvs-serv31171/doc/xdocs/papers Removed Files: how_mocks_happened.html Log Message: Moved content to the new wiki: http://wiki.truemesh.com/mockobjects/FrontPage. --- how_mocks_happened.html DELETED --- |