You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(31) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(8) |
Feb
(27) |
Mar
(15) |
Apr
|
May
(2) |
Jun
(13) |
Jul
(59) |
Aug
(48) |
Sep
(9) |
Oct
(4) |
Nov
(24) |
Dec
|
| 2004 |
Jan
(24) |
Feb
(2) |
Mar
(12) |
Apr
(9) |
May
(4) |
Jun
(26) |
Jul
(20) |
Aug
(23) |
Sep
(13) |
Oct
(31) |
Nov
(23) |
Dec
(11) |
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
(19) |
May
(64) |
Jun
(7) |
Jul
(20) |
Aug
(1) |
Sep
(6) |
Oct
|
Nov
(3) |
Dec
|
| 2006 |
Jan
|
Feb
(69) |
Mar
(18) |
Apr
(1) |
May
(4) |
Jun
(3) |
Jul
(27) |
Aug
(19) |
Sep
(12) |
Oct
(3) |
Nov
(13) |
Dec
(6) |
| 2007 |
Jan
(20) |
Feb
(17) |
Mar
(1) |
Apr
(3) |
May
(4) |
Jun
(11) |
Jul
(10) |
Aug
(24) |
Sep
(19) |
Oct
(13) |
Nov
(8) |
Dec
(7) |
| 2008 |
Jan
(54) |
Feb
(24) |
Mar
(11) |
Apr
(35) |
May
(13) |
Jun
(10) |
Jul
(30) |
Aug
(18) |
Sep
(21) |
Oct
(18) |
Nov
(40) |
Dec
(76) |
| 2009 |
Jan
(64) |
Feb
(23) |
Mar
(15) |
Apr
(23) |
May
(46) |
Jun
(25) |
Jul
(31) |
Aug
(7) |
Sep
(7) |
Oct
(6) |
Nov
(15) |
Dec
(19) |
| 2010 |
Jan
(13) |
Feb
(8) |
Mar
(6) |
Apr
(4) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
(9) |
Sep
(6) |
Oct
(15) |
Nov
(3) |
Dec
(5) |
| 2011 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(2) |
Dec
(3) |
| 2012 |
Jan
(6) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
| 2013 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2015 |
Jan
|
Feb
(19) |
Mar
(115) |
Apr
(23) |
May
(41) |
Jun
(48) |
Jul
(59) |
Aug
(29) |
Sep
(40) |
Oct
(78) |
Nov
(58) |
Dec
(47) |
| 2016 |
Jan
(25) |
Feb
(30) |
Mar
(29) |
Apr
(10) |
May
(17) |
Jun
(1) |
Jul
(1) |
Aug
(6) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
| 2017 |
Jan
(5) |
Feb
(2) |
Mar
(7) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
(1) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
(29) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(3) |
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(7) |
Jul
(1) |
Aug
|
Sep
(6) |
Oct
(4) |
Nov
(1) |
Dec
(4) |
| 2024 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(8) |
Jun
(159) |
Jul
(90) |
Aug
(22) |
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(1) |
| 2025 |
Jan
(20) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(29) |
Jun
(63) |
Jul
(62) |
Aug
(70) |
Sep
(120) |
Oct
(46) |
Nov
(33) |
Dec
(25) |
| 2026 |
Jan
(37) |
Feb
(56) |
Mar
(62) |
Apr
(24) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Mike R. <mik...@th...> - 2004-06-22 15:56:51
|
The NMock Confluence site at http://confluence.public.thoughtworks.org/display/NMock is now viewable by anyone. Please contact this list if you would like 'write' privileges to the site. Maybe someone should setup nmock.sourceforge.net and nmock.truemesh.com to redirect to the confluence site? Mike Joe Walnes wrote: > Can we get Shen a sourceforge login and start writing content directly > to the NMock website - seems a more suitable place for this kind of > stuff to live, and it is more accessible to new users. > > Owen Rogers wrote: > >> shen tham has uploaded a new introduction to nmock guide to the >> confluence site: >> http://confluence.public.thoughtworks.org/display/NMock/Home >> if you have specific documentation requests, please let us know as we >> are now starting to work on improving the nmock docs. >> cheers, >> owen. > |
|
From: Jim A. <JA...@th...> - 2004-06-22 12:41:49
|
Predictably, there was a bug in the patch I posted yesterday (types were not reused if they had any unmockable methods). Updated MockTypeIdentifier.cs and tests attached. Jim (See attached file: MockTypeIdentifierTest.cs)(See attached file: ClassGeneratorTest.cs)(See attached file: MockTypeIdentifier.cs) |
|
From: Jim A. <JA...@th...> - 2004-06-21 15:22:08
|
One of NMock's more subtle 'features' is that every time you create a new DynamicMock instance, a brand new dynamic assembly is created containing the mock type. This assembly is not reused, and neither are the mock types, so the following: new DynamicMock(typeof(IThingy)); new DynamicMock(typeof(IThingy)); results in two new assemblies, each containing one identical class. The problem is that assemblies are never unloaded from a live AppDomain, so for long-lived domains (ie NUnit test runs), NMock keeps chewing up memory. I've attached a fix for this (source files only - you'll need to include the new files in the correct VS projects). It involves 1) making the assembly (the ModuleBuilder, to be specific) static, so we can reuse it throughout the entire test run, and 2) caching mock types, so we never create two identical mock types for the same parent type. Putting this fix in resulted in a ~50% reduction in memory and a ~10% increase in speed for us (that's for ~2000 tests). Jim (See attached file: MockTypeIdentifier.cs)(See attached file: ClassGenerator.cs)(See attached file: MockTypeIdentifierTest.cs)(See attached file: ClassGeneratorTest.cs) |
|
From: Owen R. <exo...@us...> - 2004-06-17 05:13:47
|
Update of /cvsroot/nmock/nmock/src/NMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8692/src/NMock/Dynamic Modified Files: ClassGenerator.cs Added Files: MSILStack.cs MethodImplementor.cs Log Message: adding jim arnold's refactoring and optimisation of IL generation code --- NEW FILE: MSILStack.cs --- using System; using System.Reflection; using System.Reflection.Emit; namespace NMock.Dynamic { public class MSILStack { private BoxingOpCodes boxingOpCodes = new BoxingOpCodes(); private ILGenerator il; public MSILStack(ILGenerator il) { this.il = il; } public void Call(ConstructorInfo constructor) { il.Emit(OpCodes.Call, constructor); } public void CallVirtual(MethodInfo method) { il.EmitCall(OpCodes.Callvirt, method, null); } public void Pop() { il.Emit(OpCodes.Pop); } public void Return() { il.Emit(OpCodes.Ret); } public void Cast(Type type) { il.Emit(OpCodes.Castclass, type); } public void Box(Type type) { il.Emit(OpCodes.Box, type); } public void Unbox(Type type) { il.Emit(OpCodes.Unbox, type); if (type.IsPrimitive) { if(type.IsEnum) { il.Emit(boxingOpCodes[Enum.GetUnderlyingType(type)]); } else { il.Emit(boxingOpCodes[type]); } } else { LoadObject(type); } } public void LoadString(string s) { il.Emit(OpCodes.Ldstr, s); } public void LoadField(FieldInfo field) { LoadThis(); il.Emit(OpCodes.Ldfld, field); } public void LoadObject(Type type) { il.Emit(OpCodes.Ldobj, type); } public void LoadThis() { il.Emit(OpCodes.Ldarg_0); } public void LoadArg(int index) { switch(index) { case 0: il.Emit(OpCodes.Ldarg_1); break; case 1: il.Emit(OpCodes.Ldarg_2); break; case 2: il.Emit(OpCodes.Ldarg_3); break; default: il.Emit(OpCodes.Ldarg_S, index + 1); break; } } public void LoadInt32(int value) { switch(value) { case 0: il.Emit(OpCodes.Ldc_I4_0); break; case 1: il.Emit(OpCodes.Ldc_I4_1); break; case 2: il.Emit(OpCodes.Ldc_I4_2); break; case 3: il.Emit(OpCodes.Ldc_I4_3); break; case 4: il.Emit(OpCodes.Ldc_I4_4); break; case 5: il.Emit(OpCodes.Ldc_I4_5); break; case 6: il.Emit(OpCodes.Ldc_I4_6); break; case 7: il.Emit(OpCodes.Ldc_I4_7); break; case 8: il.Emit(OpCodes.Ldc_I4_8); break; default: il.Emit(OpCodes.Ldc_I4_S, value); break; } } public void LoadLocal(int index) { switch(index) { case 0: il.Emit(OpCodes.Ldloc_0); break; case 1: il.Emit(OpCodes.Ldloc_1); break; case 2: il.Emit(OpCodes.Ldloc_2); break; case 3: il.Emit(OpCodes.Ldloc_3); break; default: il.Emit(OpCodes.Ldloc_S, index); break; } } public void StoreLocal(int index) { switch(index) { case 0: il.Emit(OpCodes.Stloc_0); break; case 1: il.Emit(OpCodes.Stloc_1); break; case 2: il.Emit(OpCodes.Stloc_2); break; case 3: il.Emit(OpCodes.Stloc_3); break; default: il.Emit(OpCodes.Stloc_S, index); break; } } public void DeclareLocal(Type type) { il.DeclareLocal(type); } public void DeclareArray(Type type, int length) { LoadInt32(length); il.Emit(OpCodes.Newarr, type); } public void PutParamInArray(int index, Type param) { LoadInt32(index); LoadArg(index); if (param.IsPrimitive || param.IsValueType) { Box(param); } il.Emit(OpCodes.Stelem_Ref); } } } Index: ClassGenerator.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/Dynamic/ClassGenerator.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ClassGenerator.cs 8 Apr 2004 03:47:40 -0000 1.20 --- ClassGenerator.cs 17 Jun 2004 05:13:38 -0000 1.21 *************** *** 99,224 **** public string ProxyClassName { get { return "Proxy" + type.Name; } } public Type ProxySuperClass { get { return type.IsInterface ? superclassIfTypeIsInterface : type; } } ! public Type[] ProxyInterfaces { get { return type.IsInterface ? new Type[] { type } : new Type[0]; } } ! } - public class MethodImplementor - { - private BoxingOpCodes boxingOpCodes = new BoxingOpCodes(); - private TypeBuilder typeBuilder; - private FieldBuilder handlerFieldBuilder; - - public MethodImplementor(TypeBuilder aTypeBuilder, FieldBuilder handlerFieldBuilder) - { - typeBuilder = aTypeBuilder; - this.handlerFieldBuilder = handlerFieldBuilder; - } - - public virtual void Implement(MethodInfo methodInfo) - { - Type returnType = methodInfo.ReturnType; - ParameterInfo[] parameterInfo = methodInfo.GetParameters(); - Type[] paramTypes = ExtractParameterTypes(parameterInfo); - ILGenerator il = CreateILGenerator(methodInfo, returnType, paramTypes); - - EmitMethodSignature(methodInfo, paramTypes, il); - EmitMethodCall(il); - EmitMethodReturn(returnType, il); - } - - private Type[] ExtractParameterTypes(ParameterInfo[] parameters) - { - Type[] paramTypes = new Type[parameters.Length]; - for (int i = 0; i < parameters.Length; ++i) - { - paramTypes[i] = parameters[i].ParameterType; - } - return paramTypes; - } - - private ILGenerator CreateILGenerator(MethodInfo methodInfo, Type returnType, Type[] paramTypes) - { - MethodBuilder methodBuilder = - typeBuilder.DefineMethod(methodInfo.Name, MethodAttributes.Public | MethodAttributes.Virtual, returnType, paramTypes); - - return methodBuilder.GetILGenerator(); - } - - private void EmitMethodSignature(MethodInfo methodInfo, Type[] paramTypes, ILGenerator il) - { - il.DeclareLocal( typeof(object) ); - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Ldfld, handlerFieldBuilder); - il.Emit(OpCodes.Ldstr, StripGetSetPrefix(methodInfo)); - il.Emit(OpCodes.Ldc_I4_S, paramTypes.Length); - il.Emit(OpCodes.Newarr, typeof(object)); - - if (paramTypes.Length > 0) - { - il.Emit(OpCodes.Stloc_0); - il.Emit(OpCodes.Ldloc_0); - - for(int i = 0; i < paramTypes.Length; i++) - { - il.Emit(OpCodes.Ldc_I4_S, i); - il.Emit(OpCodes.Ldarg_S, i + 1); - if (paramTypes[i].IsPrimitive || paramTypes[i].IsValueType) - { - il.Emit(OpCodes.Box, paramTypes[i]); - } - il.Emit(OpCodes.Stelem_Ref); - il.Emit(OpCodes.Ldloc_0); - } - } - } - - private void EmitMethodCall(ILGenerator il) - { - MethodInfo call = typeof(IInvocationHandler).GetMethod("Invoke"); - il.EmitCall(OpCodes.Callvirt, call, null); - } - - private void EmitMethodReturn(Type returnType, ILGenerator il) - { - if (returnType == typeof(void)) - { - il.Emit(OpCodes.Pop); - } - else - { - if (returnType.IsPrimitive || returnType.IsEnum) - { - il.Emit(OpCodes.Unbox, returnType); - il.Emit(boxingOpCodes[returnType]); - } - else if (returnType.IsValueType) - { - il.Emit(OpCodes.Unbox, returnType); - il.Emit(OpCodes.Ldobj, returnType); - } - - il.DeclareLocal(returnType); - il.Emit(OpCodes.Stloc_1); - Label l = il.DefineLabel(); - il.Emit(OpCodes.Br_S, l); - il.MarkLabel(l); - il.Emit(OpCodes.Ldloc_1); - } - il.Emit(OpCodes.Ret); - } - - private string StripGetSetPrefix(MethodInfo methodInfo) - { - string methodName; - methodName = methodInfo.Name; - if (methodName.StartsWith("get_") || methodName.StartsWith("set_")) - { - methodName = methodName.Substring(4); - } - return methodName; - } - - } - public class BoxingOpCodes { --- 99,105 ---- public string ProxyClassName { get { return "Proxy" + type.Name; } } public Type ProxySuperClass { get { return type.IsInterface ? superclassIfTypeIsInterface : type; } } ! public Type[] ProxyInterfaces { get { return type.IsInterface ? new Type[] { type } : new Type[0]; } } } public class BoxingOpCodes { --- NEW FILE: MethodImplementor.cs --- using System; using System.Reflection; using System.Reflection.Emit; namespace NMock.Dynamic { public class MethodImplementor { private TypeBuilder typeBuilder; private FieldInfo invocationHandler; public MethodImplementor(TypeBuilder typeBuilder, FieldInfo invocationHandler) { this.typeBuilder = typeBuilder; this.invocationHandler = invocationHandler; } public virtual void Implement(MethodInfo method) { Type[] parameters = ExtractParameterTypes(method); MethodBuilder methodBuilder = typeBuilder.DefineMethod(method.Name, MethodAttributes.Public | MethodAttributes.Virtual, method.ReturnType, parameters); MSILStack stack = new MSILStack(methodBuilder.GetILGenerator()); CallInvocationHandler(stack, parameters, StripGetSetPrefix(method.Name)); ReturnFromMethod(stack, method.ReturnType); } private void CallInvocationHandler(MSILStack stack, Type[] parameters, string methodName) { stack.DeclareLocal(typeof(object[])); stack.DeclareArray(typeof(object), parameters.Length); stack.StoreLocal(0); for(int i = 0; i < parameters.Length; i++) { stack.LoadLocal(0); stack.PutParamInArray(i, parameters[i]); } stack.LoadField(invocationHandler); stack.LoadString(methodName); stack.LoadLocal(0); stack.CallVirtual(typeof(IInvocationHandler).GetMethod("Invoke")); } private void ReturnFromMethod(MSILStack stack, Type returnType) { if (returnType == typeof(void)) { stack.Pop(); } else { if (returnType.IsValueType) { stack.Unbox(returnType); } else { stack.Cast(returnType); } } stack.Return(); } private string StripGetSetPrefix(string methodName) { if (methodName.StartsWith("get_") || methodName.StartsWith("set_")) { methodName = methodName.Substring(4); } return methodName; } private Type[] ExtractParameterTypes(MethodInfo method) { ParameterInfo[] parameters = method.GetParameters(); Type[] parameterTypes = new Type[parameters.Length]; for (int i = 0; i < parameters.Length; i++) { parameterTypes[i] = parameters[i].ParameterType; } return parameterTypes; } } } |
|
From: Owen R. <exo...@us...> - 2004-06-17 05:13:47
|
Update of /cvsroot/nmock/nmock/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8692/src Modified Files: src.csproj Log Message: adding jim arnold's refactoring and optimisation of IL generation code Index: src.csproj =================================================================== RCS file: /cvsroot/nmock/nmock/src/src.csproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** src.csproj 23 Mar 2004 06:20:17 -0000 1.9 --- src.csproj 17 Jun 2004 05:13:38 -0000 1.10 *************** *** 185,188 **** --- 185,198 ---- /> <File + RelPath = "NMock\Dynamic\MethodImplementor.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NMock\Dynamic\MSILStack.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NMock\Remoting\MockServer.cs" SubType = "Code" |
|
From: Owen R. <exo...@us...> - 2004-06-17 05:13:47
|
Update of /cvsroot/nmock/nmock/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8692/test Modified Files: test.csproj Log Message: adding jim arnold's refactoring and optimisation of IL generation code Index: test.csproj =================================================================== RCS file: /cvsroot/nmock/nmock/test/test.csproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test.csproj 23 Mar 2004 06:20:17 -0000 1.8 --- test.csproj 17 Jun 2004 05:13:38 -0000 1.9 *************** *** 5,11 **** SchemaVersion = "2.0" ProjectGuid = "{2735C01B-475D-4B75-AF30-C00D9A977E58}" - SccProjectName = "Perforce Project" - SccLocalPath = "." - SccProvider = "MSSCCI:Perforce SCM" > <Build> --- 5,8 ---- |
|
From: Owen R. <exo...@us...> - 2004-06-17 05:13:47
|
Update of /cvsroot/nmock/nmock/sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8692/sample Modified Files: sample.csproj Log Message: adding jim arnold's refactoring and optimisation of IL generation code Index: sample.csproj =================================================================== RCS file: /cvsroot/nmock/nmock/sample/sample.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sample.csproj 24 Jul 2003 23:08:25 -0000 1.1 --- sample.csproj 17 Jun 2004 05:13:37 -0000 1.2 *************** *** 5,11 **** SchemaVersion = "2.0" ProjectGuid = "{77AB0622-D9F4-4D60-9A13-73703FE41788}" - SccProjectName = "Perforce Project" - SccLocalPath = "." - SccProvider = "MSSCCI:Perforce SCM" > <Build> --- 5,8 ---- |
|
From: Owen R. <exo...@us...> - 2004-06-15 17:33:03
|
Update of /cvsroot/nmock/nmock/test/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24585/test/NMock Modified Files: DynamicMockTest.cs Log Message: added jim's fix for the finalization test Index: DynamicMockTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** DynamicMockTest.cs 15 Jun 2004 17:31:06 -0000 1.21 --- DynamicMockTest.cs 15 Jun 2004 17:32:53 -0000 1.22 *************** *** 87,92 **** public class DisposableThingy : Thingy { - public static int DestructorCallCount = 0; - ~DisposableThingy() { DestructorCallCount++; } } #endregion --- 87,90 ---- |
|
From: Owen R. <OR...@th...> - 2004-06-15 17:31:23
|
doh! burned by nondeterministic garbage collection ;) i think i almost understand it :) it's now committed. o. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. Jim Arnold 15/06/2004 18:21 To: Owen Rogers <OR...@th...>@THOUGHTWORKS_COM cc: nmo...@li..., nmo...@li... Subject: Re: [Nmock-general] nmock 1.1 is now released Nice one, although one of the tests is bogus :-) DynamicMockTest.VerifyThatFinalizeIsNotOverriddenInMockSubClass fails intermittently because GC.Collect does not guarantee that Finalize() will be called (and it runs on a different thread so is unlikely to finish before the assertion executes). A more correct test would be: [Test] public void VerifyThatFinalizeIsNotOverriddenInMockSubClass() { DisposableThingy thingy = CreateDisposableThingyMock(); MethodInfo finalizer = thingy.GetType().GetMethod("Finalize", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); AssertNull(finalizer); } (Which means you can lose the static DestructorCallCount field). Jim Owen Rogers <OR...@th...> Sent by: nmo...@li... 14/06/2004 17:48 To: nmo...@li... cc: Subject: [Nmock-general] nmock 1.1 is now released nmock 1.1 is (finally) released and available for download from sourceforge: - https://sourceforge.net/project/showfiles.php?group_id=66591&package_id=64549 this release is produced using automated build 11 from ccnetlive: - http://ccnetlive.thoughtworks.com/NMock-builds/ the release contains numerous incremental bug fixes from the 1.0 release. if you are experiencing any problems with the download from sourceforge, it may be due to sourceforge's mirroring process. if so, you can always retrieve the files from ccnetlive. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. |
|
From: Owen R. <exo...@us...> - 2004-06-15 17:31:16
|
Update of /cvsroot/nmock/nmock/test/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22990/test/NMock Modified Files: DynamicMockTest.cs Log Message: added jim's fix for the finalization test Index: DynamicMockTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/DynamicMockTest.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DynamicMockTest.cs 8 Apr 2004 03:47:41 -0000 1.20 --- DynamicMockTest.cs 15 Jun 2004 17:31:06 -0000 1.21 *************** *** 2,5 **** --- 2,6 ---- using System; using System.Collections; + using System.Reflection; using NMock.Constraints; *************** *** 373,388 **** [Test] public void VerifyThatFinalizeIsNotOverriddenInMockSubClass() { ! DisposableThingy.DestructorCallCount = 0; ! CreateDisposableThingyMock(); ! GC.Collect(); ! AssertEquals(1, DisposableThingy.DestructorCallCount); ! DisposableThingy.DestructorCallCount = 0; } ! private void CreateDisposableThingyMock() { IMock mock = new DynamicMock(typeof(DisposableThingy)); mock.Strict = true; ! DisposableThingy thingy = (DisposableThingy) mock.MockInstance; } } --- 374,387 ---- [Test] public void VerifyThatFinalizeIsNotOverriddenInMockSubClass() { ! DisposableThingy thingy = CreateDisposableThingyMock(); ! MethodInfo finalizer = thingy.GetType().GetMethod("Finalize", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); ! AssertNull(finalizer); } ! private DisposableThingy CreateDisposableThingyMock() { IMock mock = new DynamicMock(typeof(DisposableThingy)); mock.Strict = true; ! return (DisposableThingy) mock.MockInstance; } } |
|
From: Jim A. <JA...@th...> - 2004-06-15 12:51:22
|
Nice one, although one of the tests is bogus :-)
DynamicMockTest.VerifyThatFinalizeIsNotOverriddenInMockSubClass fails
intermittently because GC.Collect does not guarantee that Finalize() will
be called (and it runs on a different thread so is unlikely to finish
before the assertion executes). A more correct test would be:
[Test] public void VerifyThatFinalizeIsNotOverriddenInMockSubClass()
{
DisposableThingy thingy = CreateDisposableThingyMock();
MethodInfo finalizer =
thingy.GetType().GetMethod("Finalize", BindingFlags.DeclaredOnly |
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
AssertNull(finalizer);
}
(Which means you can lose the static DestructorCallCount field).
Jim
|---------+----------------------------------------->
| | Owen Rogers |
| | <OR...@th...> |
| | Sent by: |
| | nmo...@li...|
| | ceforge.net |
| | |
| | |
| | 14/06/2004 17:48 |
| | |
|---------+----------------------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
| |
| To: nmo...@li... |
| cc: |
| Subject: [Nmock-general] nmock 1.1 is now released |
>------------------------------------------------------------------------------------------------------------------------------|
nmock 1.1 is (finally) released and available for download from
sourceforge:
-
https://sourceforge.net/project/showfiles.php?group_id=66591&package_id=64549
this release is produced using automated build 11 from ccnetlive:
- http://ccnetlive.thoughtworks.com/NMock-builds/
the release contains numerous incremental bug fixes from the 1.0 release.
if you are experiencing any problems with the download from sourceforge, it
may be due to sourceforge's mirroring process. if so, you can always
retrieve the files from ccnetlive.
cheers,
owen.
---
R. Owen Rogers
ThoughtWorks Technologies (India) Pvt Ltd.
ThoughtWorks - Deliver with passion!
ThoughtWorks is always looking for talented people who are passionate about
technology. To find out more about a career at ThoughtWorks go to
http://www.thoughtworks.com/career/.
|
|
From: Joe W. <joe...@us...> - 2004-06-15 12:19:15
|
Update of /cvsroot/nmock/website/WEB-INF/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5902/WEB-INF/lib Modified Files: sitemesh.jar Log Message: fixed sitemesh Index: sitemesh.jar =================================================================== RCS file: /cvsroot/nmock/website/WEB-INF/lib/sitemesh.jar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsuf2zyu and /tmp/cvsq4S4Qi differ |
|
From: Joe W. <jo...@tr...> - 2004-06-15 10:10:45
|
Can we get Shen a sourceforge login and start writing content directly to the NMock website - seems a more suitable place for this kind of stuff to live, and it is more accessible to new users. cheers -joe Owen Rogers wrote: > > shen tham has uploaded a new introduction to nmock guide to the > confluence site: > http://confluence.public.thoughtworks.org/display/NMock/Home > if you have specific documentation requests, please let us know as we > are now starting to work on improving the nmock docs. > cheers, > owen. > > > --- > R. Owen Rogers > ThoughtWorks Technologies (India) Pvt Ltd. > > ThoughtWorks - Deliver with passion! > > ThoughtWorks is always looking for talented people who are passionate > about technology. To find out more about a career at ThoughtWorks go > to http://www.thoughtworks.com/career/. |
|
From: Owen R. <OR...@th...> - 2004-06-15 09:52:45
|
shen tham has uploaded a new introduction to nmock guide to the confluence site: http://confluence.public.thoughtworks.org/display/NMock/Home if you have specific documentation requests, please let us know as we are now starting to work on improving the nmock docs. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. |
|
From: Joe W. <jo...@tr...> - 2004-06-15 09:45:45
|
Awesome, great work everyone! -joe Owen Rogers wrote: > > nmock 1.1 is (finally) released and available for download from > sourceforge: > - > https://sourceforge.net/project/showfiles.php?group_id=66591&package_id=64549 > > > this release is produced using automated build 11 from ccnetlive: > - http://ccnetlive.thoughtworks.com/NMock-builds/ > > the release contains numerous incremental bug fixes from the 1.0 release. > > if you are experiencing any problems with the download from > sourceforge, it may be due to sourceforge's mirroring process. if so, > you can always retrieve the files from ccnetlive. > > cheers, > owen. > > --- > R. Owen Rogers > ThoughtWorks Technologies (India) Pvt Ltd. > > ThoughtWorks - Deliver with passion! > > ThoughtWorks is always looking for talented people who are passionate > about technology. To find out more about a career at ThoughtWorks go > to http://www.thoughtworks.com/career/. |
|
From: Owen R. <exo...@us...> - 2004-06-14 17:54:55
|
Update of /cvsroot/nmock/nmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16038 Modified Files: nmock.build Log Message: modified build file to zip and publish the source Index: nmock.build =================================================================== RCS file: /cvsroot/nmock/nmock/nmock.build,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** nmock.build 25 Mar 2004 13:36:15 -0000 1.8 --- nmock.build 14 Jun 2004 17:54:45 -0000 1.9 *************** *** 67,72 **** --- 67,92 ---- <property name="nunit.output" value="Xml"/> <call target="release"/> + <call target="dist.source"/> <call target="dist.publish"/> </target> + + <target name="dist.source"> + <zip zipfile="dist\nmock.source.zip"> + <fileset> + <includes name="**\*" /> + + <excludes name="build\**\*" /> + <excludes name="dist\**\*" /> + <excludes name="tools\**\*" /> + <excludes name="**\bin\**\*" /> + <excludes name="**\obj\**\*" /> + <excludes name="**\CVS\**\*" /> + <excludes name="*.suo" /> + <excludes name="*.resharper*" /> + <excludes name="**\*.csproj.user" /> + <excludes name="*.resharper*\**\*" /> + </fileset> + </zip> + </target> <target name="dist.publish"> *************** *** 84,87 **** </copy> </target> ! </project> \ No newline at end of file --- 104,107 ---- </copy> </target> ! </project> \ No newline at end of file |
|
From: Owen R. <OR...@th...> - 2004-06-14 17:43:08
|
nmock 1.1 is (finally) released and available for download from sourceforge: - https://sourceforge.net/project/showfiles.php?group_id=66591&package_id=64549 this release is produced using automated build 11 from ccnetlive: - http://ccnetlive.thoughtworks.com/NMock-builds/ the release contains numerous incremental bug fixes from the 1.0 release. if you are experiencing any problems with the download from sourceforge, it may be due to sourceforge's mirroring process. if so, you can always retrieve the files from ccnetlive. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. |
|
From: Joe W. <joe...@us...> - 2004-06-14 10:14:46
|
Update of /cvsroot/nmock/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23966 Modified Files: download.html Log Message: Test Index: download.html =================================================================== RCS file: /cvsroot/nmock/website/download.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** download.html 11 May 2003 15:52:22 -0000 1.2 --- download.html 14 Jun 2004 10:14:37 -0000 1.3 *************** *** 1,2 **** ! <p>The latest NMock binary can be downloaded from <a href="http://sourceforge.net/project/showfiles.php?group_id=66591">SourceForge</a>.</p> --- 1,2 ---- ! <p>The latest NMock binary can be downloaded from <a href="http://sourceforge.net/project/showfiles.php?group_id=66591">SourceForge</a>. </p> |
|
From: Steve F. <sm...@us...> - 2004-05-28 12:47:23
|
Update of /cvsroot/nmock/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12582 Modified Files: team.html Log Message: [sf] moved Nat and Steve to team members Index: team.html =================================================================== RCS file: /cvsroot/nmock/website/team.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** team.html 10 Nov 2002 16:56:18 -0000 1.2 --- team.html 28 May 2004 12:47:11 -0000 1.3 *************** *** 24,27 **** --- 24,37 ---- <td><a href="http://www.thoughtworks.com/">ThoughtWorks</a></td> </tr> + <tr class="a"> + <td>Nat Pryce</td> + <td></td> + <td><a href="http:www.thoughtworks.com/">ThoughtWorks</a></td> + </tr> + <tr class="a"> + <td>Steve Freeman</td> + <td></td> + <td><a href="http:www.thoughtworks.com/">ThoughtWorks</a></td> + </tr> </table> *************** *** 34,47 **** <th>Organization</th> </tr> - <tr class="a"> - <td>Nat Pryce</td> - <td></td> - <td><a href="http://www.b13media.com/">B13 Media</a></td> - </tr> - <tr class="b"> - <td>Steve Freeman</td> - <td></td> - <td></td> - </tr> </table> --- 44,47 ---- |
|
From: Xiaoqiao Li <xia...@ya...> - 2004-05-24 05:39:40
|
Cool. It works for me.
Thanks.
Xiaoqiao
Steve Freeman <st...@m3...> wrote:
Try using an IsArrayEqual constraint.
mock.Expect("Bar", new IsArrayEqual(expectedList));
or something like that.
S
Xiaoqiao Li wrote:
> Hi,
>
> How does Mock.Expect verify ArrayList parameters? ArrayList.Equals is
> inherited from Object and compares reference, not content. But my
> unit test needs to compare the content, similar to the behavoir in
> Java - first compare the list size, and then call equals on each
> element.
>
> IMock mock = new DynamicMock(typeof(IFoo); IFoo foo = (IFoo)
> mock.MockInstance;
>
> ArrayList expectedList = new ArrayList(); expectedList.Add(1);
> expectedList.Add(2); mock.Expect("Bar", expectedList );
>
> FooUser user = new FooUser(foo); user.DoSomething(); //
> foo.Bar(actualList) is called in user.DoSomething()
>
> mock.Verify();
>
> I'd like to have the above test pass. The actualList is generated
> inside user.DoSomething(), so I cannot set expectedList = actualList.
>
>
> The ArrayList parameter is not uncommon. I think there must be a way
> in nmock. Can someone shed light on this? Thanks.
>
> Xiaoqiao
>
> --------------------------------- Do you Yahoo!? Yahoo! Domains -
> Claim yours for only $14.70/year
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Nmock-general mailing list
Nmo...@li...
https://lists.sourceforge.net/lists/listinfo/nmock-general
---------------------------------
Do you Yahoo!?
Yahoo! Domains - Claim yours for only $14.70/year |
|
From: Steve F. <st...@m3...> - 2004-05-23 08:27:15
|
Try using an IsArrayEqual constraint.
mock.Expect("Bar", new IsArrayEqual(expectedList));
or something like that.
S
Xiaoqiao Li wrote:
> Hi,
>
> How does Mock.Expect verify ArrayList parameters? ArrayList.Equals is
> inherited from Object and compares reference, not content. But my
> unit test needs to compare the content, similar to the behavoir in
> Java - first compare the list size, and then call equals on each
> element.
>
> IMock mock = new DynamicMock(typeof(IFoo); IFoo foo = (IFoo)
> mock.MockInstance;
>
> ArrayList expectedList = new ArrayList(); expectedList.Add(1);
> expectedList.Add(2); mock.Expect("Bar", expectedList );
>
> FooUser user = new FooUser(foo); user.DoSomething(); //
> foo.Bar(actualList) is called in user.DoSomething()
>
> mock.Verify();
>
> I'd like to have the above test pass. The actualList is generated
> inside user.DoSomething(), so I cannot set expectedList = actualList.
>
>
> The ArrayList parameter is not uncommon. I think there must be a way
> in nmock. Can someone shed light on this? Thanks.
>
> Xiaoqiao
>
> --------------------------------- Do you Yahoo!? Yahoo! Domains -
> Claim yours for only $14.70/year
|
|
From: Xiaoqiao Li <xia...@ya...> - 2004-05-23 04:27:08
|
Hi,
How does Mock.Expect verify ArrayList parameters? ArrayList.Equals is inherited from Object and compares reference, not content. But my unit test needs to compare the content, similar to the behavoir in Java - first compare the list size, and then call equals on each element.
IMock mock = new DynamicMock(typeof(IFoo);
IFoo foo = (IFoo) mock.MockInstance;
ArrayList expectedList = new ArrayList();
expectedList.Add(1);
expectedList.Add(2);
mock.Expect("Bar", expectedList );
FooUser user = new FooUser(foo);
user.DoSomething();
// foo.Bar(actualList) is called in user.DoSomething()
mock.Verify();
I'd like to have the above test pass. The actualList is generated inside user.DoSomething(), so I cannot set expectedList = actualList.
The ArrayList parameter is not uncommon. I think there must be a way in nmock. Can someone shed light on this? Thanks.
Xiaoqiao
---------------------------------
Do you Yahoo!?
Yahoo! Domains - Claim yours for only $14.70/year |
|
From: Jim A. <JA...@th...> - 2004-04-27 17:04:58
|
I remember we had similar problems with DateTimes here (and value types in general) which we fixed. I thought we had sent the patch in for inclusion, but I'll double check that and get back to you. Jim ThoughtWorks |---------+-----------------------------------------> | | "Nick Robinson" | | | <nicholasrobinson@fromconcept.| | | co.uk> | | | Sent by: | | | nmo...@li...| | | ceforge.net | | | | | | | | | 26/04/2004 15:24 | | | | |---------+-----------------------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: nmo...@li... | | cc: | | Subject: [Nmock-general] Dates | >------------------------------------------------------------------------------------------------------------------------------| I have a colleague who has tried to Mock a DateTime field on an interface: IFoo { DateTime Date { get; set; } } When a mock of IFoo is passed into a client call, access of non-DateTime properties work, but an access to the Date property generates an error about the object reference being null. Is there a known issue with Dates? Nick. ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general |
|
From: Emerson C. <EC...@th...> - 2004-04-26 16:07:30
|
It woudln't surprise me, dates are handled specially by dot net, they are
a form of object in that they have implicit conversions (operator
overloads) not available for any other intrinsic types.
Could that effect the mock ?
Steve Freeman <st...@m3...>
Sent by: nmo...@li...
26/04/2004 15:29
To
nmo...@li...
cc
Subject
Re: [Nmock-general] Dates
Are you sure he's setting up the returned object?
S
Nick Robinson wrote:
> I have a colleague who has tried to Mock a DateTime field on an
> interface:
>
> IFoo { DateTime Date { get; set; } }
>
> When a mock of IFoo is passed into a client call, access of
> non-DateTime properties work, but an access to the Date property
> generates an error about the object reference being null. Is there a
> known issue with Dates?
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Nmock-general mailing list
Nmo...@li...
https://lists.sourceforge.net/lists/listinfo/nmock-general
|
|
From: Steve F. <st...@m3...> - 2004-04-26 14:29:44
|
Are you sure he's setting up the returned object?
S
Nick Robinson wrote:
> I have a colleague who has tried to Mock a DateTime field on an
> interface:
>
> IFoo { DateTime Date { get; set; } }
>
> When a mock of IFoo is passed into a client call, access of
> non-DateTime properties work, but an access to the Date property
> generates an error about the object reference being null. Is there a
> known issue with Dates?
|