springnet-commits Mailing List for Spring Framework .NET (Page 54)
Brought to you by:
aseovic,
markpollack
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(33) |
Aug
(163) |
Sep
(491) |
Oct
(289) |
Nov
(336) |
Dec
(84) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(227) |
Feb
(413) |
Mar
(128) |
Apr
(232) |
May
(92) |
Jun
(299) |
Jul
(386) |
Aug
(228) |
Sep
(237) |
Oct
(426) |
Nov
(325) |
Dec
(405) |
2006 |
Jan
(315) |
Feb
(311) |
Mar
(152) |
Apr
(177) |
May
(443) |
Jun
(92) |
Jul
(88) |
Aug
(80) |
Sep
(288) |
Oct
(515) |
Nov
(1049) |
Dec
(440) |
2007 |
Jan
(179) |
Feb
(406) |
Mar
(294) |
Apr
(80) |
May
(432) |
Jun
(242) |
Jul
(452) |
Aug
(710) |
Sep
(206) |
Oct
(240) |
Nov
(65) |
Dec
(227) |
2008 |
Jan
(80) |
Feb
(90) |
Mar
(98) |
Apr
(136) |
May
(101) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Erich E. <oak...@us...> - 2007-08-26 11:43:57
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28244 Modified Files: MethodNode.cs Log Message: additional fix for SPRNET-499 (enable static inherited method calls) Index: MethodNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/MethodNode.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MethodNode.cs 8 Aug 2007 04:00:15 -0000 1.17 --- MethodNode.cs 26 Aug 2007 01:59:49 -0000 1.18 *************** *** 136,140 **** MethodInfo mi = GetBestMethod(contextType, methodName, BINDING_FLAGS, argValues); ! // if not found, probe the Type type if (mi == null) { --- 136,140 ---- MethodInfo mi = GetBestMethod(contextType, methodName, BINDING_FLAGS, argValues); ! // if not found, probe the Type's type if (mi == null) { *************** *** 172,176 **** try { ! mi = type.GetMethod(methodName, bindingFlags); } catch (AmbiguousMatchException) --- 172,176 ---- try { ! mi = type.GetMethod(methodName, bindingFlags|BindingFlags.FlattenHierarchy); } catch (AmbiguousMatchException) *************** *** 190,194 **** private static MethodInfo[] GetCandidateMethods(Type type, string methodName, BindingFlags bindingFlags, int argCount) { ! MethodInfo[] methods = type.GetMethods(bindingFlags); ArrayList matches = new ArrayList(); --- 190,194 ---- private static MethodInfo[] GetCandidateMethods(Type type, string methodName, BindingFlags bindingFlags, int argCount) { ! MethodInfo[] methods = type.GetMethods(bindingFlags|BindingFlags.FlattenHierarchy); ArrayList matches = new ArrayList(); |
From: Erich E. <oak...@us...> - 2007-08-26 11:43:56
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Core/TypeConversion In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27221 Modified Files: ResourceManagerTests.cs Log Message: fixed SPRNET-679 Index: ResourceManagerTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Core/TypeConversion/ResourceManagerTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResourceManagerTests.cs 31 Jul 2007 18:21:01 -0000 1.1 --- ResourceManagerTests.cs 25 Aug 2007 10:53:42 -0000 1.2 *************** *** 125,129 **** object foo = cvt.ConvertFrom ("Spring.TestResource.txt, FooAssembly"); } ! } } --- 125,136 ---- object foo = cvt.ConvertFrom ("Spring.TestResource.txt, FooAssembly"); } ! ! [Test] ! [ExpectedException(typeof(ArgumentException))] ! public void ConvertFromBad_App_GlobalResources() ! { ! ResourceManagerConverter cvt = new ResourceManagerConverter(); ! object foo = cvt.ConvertFrom("Spring.TestResource.txt, "+ResourceManagerConverter.APP_GLOBALRESOURCES_ASSEMBLYNAME); ! } } } |
From: Erich E. <oak...@us...> - 2007-08-26 11:43:52
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14644 Modified Files: AspNetCache.cs Log Message: added test for AbstractCache and AspNetCache Index: AspNetCache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Caching/AspNetCache.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AspNetCache.cs 24 Aug 2007 22:44:16 -0000 1.4 --- AspNetCache.cs 25 Aug 2007 10:21:38 -0000 1.5 *************** *** 28,38 **** { /// <summary> ! /// An <see cref="ICache"/> implementation backed by ASP.NET Cache. /// </summary> /// <remarks> /// Because ASP.NET Cache uses strings as cache keys, you need to ensure /// that the key object type has properly implemented <b>ToString</b> method. /// </remarks> /// <author>Aleksandar Seovic</author> /// <version>$Id$</version> public class AspNetCache : AbstractCache --- 28,45 ---- { /// <summary> ! /// An <see cref="ICache"/> implementation backed by ASP.NET Cache (see <see cref="HttpRuntime.Cache"/>). /// </summary> /// <remarks> + /// <para> /// Because ASP.NET Cache uses strings as cache keys, you need to ensure /// that the key object type has properly implemented <b>ToString</b> method. + /// </para> + /// <para> + /// Despite the shared underlying <see cref="HttpRuntime.Cache"/>, it is possible to use more than + /// one instance of <see cref="AspNetCache"/> without interfering each other. + /// </para> /// </remarks> /// <author>Aleksandar Seovic</author> + /// <author>Erich Eichinger</author> /// <version>$Id$</version> public class AspNetCache : AbstractCache *************** *** 292,296 **** public string GenerateKey( object key ) { ! return _cacheName + key.ToString(); } } --- 299,303 ---- public string GenerateKey( object key ) { ! return _cacheName + key; } } |
From: Mark P. <mar...@us...> - 2007-08-26 11:43:20
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Data/Spring/Objects/Factory/Xml In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18608 Added Files: locale.xml Log Message: SPRNET-453 - ConversionUtils should use ConvertFromInvariantString if failed to convert string value. --- NEW FILE: locale.xml --- (This appears to be a binary file; contents omitted.) |
From: Erich E. <oak...@us...> - 2007-08-24 22:50:04
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6781/Spring.Core.Tests Modified Files: Spring.Core.Tests.2003.csproj Log Message: fixed 2003 solution SPRNET-687 Index: Spring.Core.Tests.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2003.csproj,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Spring.Core.Tests.2003.csproj 22 Aug 2007 20:17:04 -0000 1.34 --- Spring.Core.Tests.2003.csproj 24 Aug 2007 22:48:59 -0000 1.35 *************** *** 118,121 **** --- 118,126 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "Rhino.Mocks" + AssemblyName = "Rhino.Mocks" + HintPath = "..\..\..\lib\Net\1.1\Rhino.Mocks.dll" + /> </References> </Build> |
From: Erich E. <oak...@us...> - 2007-08-24 22:49:11
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6781/Spring.Web.Tests Modified Files: Spring.Web.Tests.2003.csproj Log Message: fixed 2003 solution SPRNET-687 Index: Spring.Web.Tests.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Spring.Web.Tests.2003.csproj,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Spring.Web.Tests.2003.csproj 9 Aug 2007 14:23:42 -0000 1.29 --- Spring.Web.Tests.2003.csproj 24 Aug 2007 22:48:59 -0000 1.30 *************** *** 134,137 **** --- 134,142 ---- /> <File + RelPath = "Caching\AspNetCacheTests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Context\Support\HttpApplicationConfigurerTests.cs" SubType = "Code" |
From: Erich E. <oak...@us...> - 2007-08-24 22:48:57
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6767 Modified Files: Spring.Core.2003.csproj Log Message: fixed 2003 solution SPRNET-687 Index: Spring.Core.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.2003.csproj,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Spring.Core.2003.csproj 22 Aug 2007 20:16:10 -0000 1.45 --- Spring.Core.2003.csproj 24 Aug 2007 22:48:49 -0000 1.46 *************** *** 134,142 **** /> <File - RelPath = "Caching\CachePriority.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Caching\CacheResultAttribute.cs" SubType = "Code" --- 134,137 ---- |
From: Erich E. <oak...@us...> - 2007-08-24 22:44:38
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5222 Modified Files: Spring.Web.Tests.2005.csproj Log Message: SPRNET-683, SPRNET-712 Index: Spring.Web.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Spring.Web.Tests.2005.csproj,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Spring.Web.Tests.2005.csproj 8 Aug 2007 17:49:38 -0000 1.17 --- Spring.Web.Tests.2005.csproj 24 Aug 2007 22:44:35 -0000 1.18 *************** *** 87,90 **** --- 87,94 ---- <HintPath>..\..\..\lib\Net\1.1\nunit.framework.dll</HintPath> </Reference> + <Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath> + </Reference> <Reference Include="System"> <Name>System</Name> *************** *** 107,110 **** --- 111,115 ---- <SubType>Code</SubType> </Compile> + <Compile Include="Caching\AspNetCacheTests.cs" /> <Compile Include="Context\Support\HttpApplicationConfigurerTests.cs" /> <Compile Include="Core\IO\WebResourceTests.cs" /> |
From: Erich E. <oak...@us...> - 2007-08-24 22:44:38
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5222/Caching Added Files: AspNetCacheTests.cs Log Message: SPRNET-683, SPRNET-712 --- NEW FILE: AspNetCacheTests.cs --- (This appears to be a binary file; contents omitted.) |
From: Erich E. <oak...@us...> - 2007-08-24 22:44:29
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5209 Modified Files: ExpressionEvaluatorTests.cs Log Message: SPRNET-683, SPRNET-712 Index: ExpressionEvaluatorTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** ExpressionEvaluatorTests.cs 23 Aug 2007 23:31:06 -0000 1.65 --- ExpressionEvaluatorTests.cs 24 Aug 2007 22:44:26 -0000 1.66 *************** *** 2248,2252 **** // case #root != #this in Projection - ToString() will be applied to #this ! exp = Expression.Parse("(#noop ={|val| $val}; !{#noop(ToString()) } )"); result = exp.GetValue(new int[] { 100, 200 }, new Hashtable()); Assert.AreEqual(new string[] { "100", "200" }, result); --- 2248,2252 ---- // case #root != #this in Projection - ToString() will be applied to #this ! exp = Expression.Parse("(ToString(); #noop ={|val| $val}; !{#noop(ToString()) } )"); result = exp.GetValue(new int[] { 100, 200 }, new Hashtable()); Assert.AreEqual(new string[] { "100", "200" }, result); |
From: Erich E. <oak...@us...> - 2007-08-24 22:44:19
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5195 Modified Files: AspNetCache.cs Log Message: SPRNET-683, SPRNET-712 Index: AspNetCache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Caching/AspNetCache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AspNetCache.cs 3 Aug 2007 06:08:59 -0000 1.3 --- AspNetCache.cs 24 Aug 2007 22:44:16 -0000 1.4 *************** *** 38,41 **** --- 38,154 ---- public class AspNetCache : AbstractCache { + #region Internal Abstractions + + /// <summary> + /// Abstracts the underlying runtime cache + /// </summary> + public interface IRuntimeCache : IEnumerable + { + /// <summary> + /// Insert an item into the cache. + /// </summary> + void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, + TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback); + + /// <summary> + /// Removes an item from the cache. + /// </summary> + /// <param name="key">The key of the item to remove</param> + /// <returns>The object that has been removed from the cache</returns> + object Remove(string key); + + /// <summary> + /// Retrieve an item with the specified key from the cache. + /// </summary> + /// <param name="key">The key of the item to be retrieved</param> + /// <returns>The item, if found. <value>null</value> otherwise</returns> + object Get(string key); + } + + /// <summary> + /// Actually delegates all calls to the underlying <see cref="HttpRuntime.Cache"/> + /// </summary> + private class RuntimeCache : IRuntimeCache + { + private readonly Cache _runtimeCache = HttpRuntime.Cache; + + public object Remove(string key) + { + return _runtimeCache.Remove(key); + } + + public void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback ) + { + _runtimeCache.Insert(key, value, dependencies, absoluteExpiration, slidingExpiration, priority, onRemoveCallback); + } + + public object Get(string key) + { + return _runtimeCache.Get(key); + } + + public IEnumerator GetEnumerator() + { + return _runtimeCache.GetEnumerator(); + } + } + + #endregion + + #region Fields + + // the concrete cache implementation + private readonly IRuntimeCache _cache; + // the (unique!) name of this particular cache instance. + private readonly string _cacheName; + + // hold default values for this cache instance. + private CacheItemPriority _priority = CacheItemPriority.Default; + private bool _slidingExpiration = false; + + #endregion + + /// <summary> + /// Initializes a new instance of <see cref="AspNetCache"/> + /// </summary> + public AspNetCache() + :this(new RuntimeCache()) + { + } + + /// <summary> + /// Initializes a new instance of <see cref="AspNetCache"/> + /// with the specified <see cref="IRuntimeCache"/> implementation. + /// </summary> + /// <param name="runtimeCache"></param> + public AspNetCache(IRuntimeCache runtimeCache) + { + _cache = runtimeCache; + // noop + _cacheName = typeof(AspNetCache).FullName + "[" + this.GetHashCode() + "]."; + } + + #region Configurable Properties + + /// <summary> + /// Gets/Sets a flag, whether to use sliding expiration policy. + /// </summary> + public bool SlidingExpiration + { + get { return _slidingExpiration; } + set { _slidingExpiration = value; } + } + + /// <summary> + /// Gets/Sets a default priority to be applied to all items inserted into this cache. + /// </summary> + public CacheItemPriority Priority + { + get { return _priority; } + set { _priority = value; } + } + + #endregion + /// <summary> /// Gets a collection of all cache item keys. *************** *** 45,57 **** get { - Cache cache = HttpRuntime.Cache; ArrayList keys = new ArrayList(); ! foreach (DictionaryEntry entry in cache) { ! keys.Add(entry.Key); } ! return (string[]) keys.ToArray(typeof(string)); } } --- 158,173 ---- get { ArrayList keys = new ArrayList(); ! foreach (DictionaryEntry entry in _cache) { ! string key = (string) entry.Key; ! if (key.StartsWith(_cacheName)) ! { ! keys.Add(key.Substring(_cacheName.Length)); ! } } ! return keys; } } *************** *** 68,72 **** public override object Get(object key) { ! return key == null ? null : HttpRuntime.Cache.Get(key.ToString()); } --- 184,188 ---- public override object Get(object key) { ! return key == null ? null : _cache.Get(GenerateKey(key)); } *************** *** 81,85 **** if (key != null) { ! HttpRuntime.Cache.Remove(key.ToString()); } } --- 197,201 ---- if (key != null) { ! _cache.Remove(GenerateKey(key)); } } *************** *** 88,91 **** --- 204,210 ---- /// Inserts an item into the cache. /// </summary> + /// <remarks> + /// Items inserted using this method have default <see cref="Priority"/> and default <see cref="SlidingExpiration"/> + /// </remarks> /// <param name="key"> /// Item key. *************** *** 95,99 **** /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live (TTL) in milliseconds. /// </param> /// <param name="slidingExpiration"> --- 214,235 ---- /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live (TTL). ! /// </param> ! protected override void DoInsert(object key, object value, TimeSpan timeToLive) ! { ! this.Insert( key, value, timeToLive, _slidingExpiration, _priority ); ! } ! ! /// <summary> ! /// Inserts an item into the cache. ! /// </summary> ! /// <param name="key"> ! /// Item key. ! /// </param> ! /// <param name="value"> ! /// Item value. ! /// </param> ! /// <param name="timeToLive"> ! /// Item's time-to-live. /// </param> /// <param name="slidingExpiration"> *************** *** 101,137 **** /// when the item is accessed. /// </param> ! /// <param name="priority"> /// Item priority. /// </param> ! public override void Insert(object key, object value, int timeToLive, bool slidingExpiration, CachePriority priority) { AssertUtils.ArgumentNotNull(key, "key"); ! CacheItemPriority itemPriority = (CacheItemPriority) Enum.Parse(typeof(CacheItemPriority), priority.ToString()); ! if (timeToLive > 0) { if (slidingExpiration) { ! TimeSpan slidingExpirationSpan = new TimeSpan(0, 0, timeToLive); ! HttpRuntime.Cache.Insert(key.ToString(), value, null, Cache.NoAbsoluteExpiration, slidingExpirationSpan, itemPriority, null); } else { ! DateTime absoluteExpiration = DateTime.Now.AddSeconds(timeToLive); ! HttpRuntime.Cache.Insert(key.ToString(), value, null, absoluteExpiration, Cache.NoSlidingExpiration, itemPriority, null); } } else { ! HttpRuntime.Cache.Insert(key.ToString(), value, null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, itemPriority, null); } } /// <summary> ! /// Gets the number of items in the cache. /// </summary> ! public override int Count { ! get { return HttpRuntime.Cache.Count; } } } --- 237,296 ---- /// when the item is accessed. /// </param> ! public void Insert(object key, object value, TimeSpan timeToLive, bool slidingExpiration) ! { ! this.Insert(key, value, timeToLive, slidingExpiration, _priority); ! } ! ! /// <summary> ! /// Inserts an item into the cache. ! /// </summary> ! /// <param name="key"> ! /// Item key. ! /// </param> ! /// <param name="value"> ! /// Item value. ! /// </param> ! /// <param name="timeToLive"> ! /// Item's time-to-live. ! /// </param> ! /// <param name="slidingExpiration"> ! /// Flag specifying whether the item's time-to-live should be reset ! /// when the item is accessed. ! /// </param> ! /// <param name="itemPriority"> /// Item priority. /// </param> ! public void Insert(object key, object value, TimeSpan timeToLive, bool slidingExpiration, CacheItemPriority itemPriority) { AssertUtils.ArgumentNotNull(key, "key"); + AssertUtils.State( TimeSpan.Zero <= timeToLive, "timeToLive" ); ! if (TimeSpan.Zero < timeToLive) { if (slidingExpiration) { ! TimeSpan slidingExpirationSpan = timeToLive; ! _cache.Insert(GenerateKey(key), value, null, Cache.NoAbsoluteExpiration, slidingExpirationSpan, itemPriority, null); } else { ! DateTime absoluteExpiration = DateTime.Now.Add(timeToLive); ! _cache.Insert(GenerateKey(key), value, null, absoluteExpiration, Cache.NoSlidingExpiration, itemPriority, null); } } else { ! _cache.Insert(GenerateKey(key), value, null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, itemPriority, null); } } /// <summary> ! /// Generate a key to be used for the underlying <see cref="Cache"/> implementation. /// </summary> ! /// <param name="key"></param> ! /// <returns></returns> ! public string GenerateKey( object key ) { ! return _cacheName + key.ToString(); } } |
From: Erich E. <oak...@us...> - 2007-08-24 22:43:59
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4807/Caching Modified Files: AbstractCache.cs BaseCacheAttribute.cs ICache.cs NonExpiringCache.cs Removed Files: CachePriority.cs Log Message: SPRNET-683, SPRNET-712 Index: AbstractCache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/AbstractCache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractCache.cs 16 Feb 2007 01:59:31 -0000 1.3 --- AbstractCache.cs 24 Aug 2007 22:43:55 -0000 1.4 *************** *** 32,39 **** public abstract class AbstractCache : ICache { /// <summary> /// Gets the number of items in the cache. /// </summary> ! public abstract int Count { get; } /// <summary> --- 32,72 ---- public abstract class AbstractCache : ICache { + private bool _enforceTimeToLive = false; + private TimeSpan _timeToLive = TimeSpan.Zero; + + /// <summary> + /// Gets/Set the Default time-to-live (TTL) for items inserted into this cache. + /// Used by <see cref="Insert(object,object)"/> + /// </summary> + public TimeSpan TimeToLive + { + get { return _timeToLive; } + set { _timeToLive = value; } + } + + /// <summary> + /// Gets/Sets a value, whether the this cache instance's <see cref="TimeToLive"/> + /// shall be applied to all items, regardless of their individual TTL + /// when <see cref="Insert(object,object,TimeSpan"/> is called. + /// </summary> + public bool EnforceTimeToLive + { + get { return _enforceTimeToLive; } + set { _enforceTimeToLive = value; } + } + /// <summary> /// Gets the number of items in the cache. /// </summary> ! /// <remarks> ! /// May be overridden by subclasses for cache-specific efficient implementation. ! /// </remarks> ! public virtual int Count ! { ! get ! { ! return Keys.Count; ! } ! } /// <summary> *************** *** 90,95 **** /// </summary> /// <remarks> ! /// Items inserted using this method have no expiration time ! /// and default cache priority. /// </remarks> /// <param name="key"> --- 123,127 ---- /// </summary> /// <remarks> ! /// Items inserted using this method use the default /// </remarks> /// <param name="key"> *************** *** 101,105 **** public virtual void Insert(object key, object value) { ! Insert(key, value, 0, false, CachePriority.Default); } --- 133,137 ---- public virtual void Insert(object key, object value) { ! Insert(key, value, TimeToLive); } *************** *** 108,112 **** /// </summary> /// <remarks> ! /// Items inserted using this method have default cache priority. /// </remarks> /// <param name="key"> --- 140,146 ---- /// </summary> /// <remarks> ! /// If <paramref name="timeToLive"/> equals <see cref="TimeSpan.MinValue"/>, ! /// or <see cref="EnforceTimeToLive"/> is <value>true</value>, this cache ! /// instance's <see cref="TimeToLive"/> value will be applied. /// </remarks> /// <param name="key"> *************** *** 117,134 **** /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live (TTL) in milliseconds. ! /// </param> ! /// <param name="slidingExpiration"> ! /// Flag specifying whether the item's time-to-live should be reset ! /// when the item is accessed. /// </param> ! public virtual void Insert(object key, object value, int timeToLive, bool slidingExpiration) { ! Insert(key, value, timeToLive, slidingExpiration, CachePriority.Default); } /// <summary> ! /// Inserts an item into the cache. /// </summary> /// <param name="key"> /// Item key. --- 151,171 ---- /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live (TTL). /// </param> ! public virtual void Insert(object key, object value, TimeSpan timeToLive) { ! if (TimeSpan.MinValue.Equals(timeToLive) || _enforceTimeToLive) ! { ! timeToLive = _timeToLive; ! } ! DoInsert(key, value, timeToLive); } /// <summary> ! /// Actually does the cache implementation specific insert operation into the cache. /// </summary> + /// <remarks> + /// Items inserted using this method have default cache priority. + /// </remarks> /// <param name="key"> /// Item key. *************** *** 138,153 **** /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live (TTL) in milliseconds. ! /// </param> ! /// <param name="slidingExpiration"> ! /// Flag specifying whether the item's time-to-live should be reset ! /// when the item is accessed. ! /// </param> ! /// <param name="priority"> ! /// Item priority. /// </param> ! public abstract void Insert(object key, object value, int timeToLive, bool slidingExpiration, ! CachePriority priority); ! } } \ No newline at end of file --- 175,181 ---- /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live (TTL). /// </param> ! protected abstract void DoInsert(object key, object value, TimeSpan timeToLive); } } \ No newline at end of file --- CachePriority.cs DELETED --- Index: NonExpiringCache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/NonExpiringCache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NonExpiringCache.cs 16 Feb 2007 01:59:31 -0000 1.3 --- NonExpiringCache.cs 24 Aug 2007 22:43:55 -0000 1.4 *************** *** 19,22 **** --- 19,23 ---- #endregion + using System; using System.Collections; *************** *** 31,35 **** public class NonExpiringCache : AbstractCache { ! private IDictionary itemStore = new Hashtable(); /// <summary> --- 32,36 ---- public class NonExpiringCache : AbstractCache { ! private readonly IDictionary itemStore = new Hashtable(); /// <summary> *************** *** 132,144 **** /// Item's time-to-live (TTL) in milliseconds. /// </param> ! /// <param name="slidingExpiration"> ! /// Flag specifying whether the item's time-to-live should be reset ! /// when the item is accessed. ! /// </param> ! /// <param name="priority"> ! /// Item priority. ! /// </param> ! public override void Insert(object key, object value, int timeToLive, bool slidingExpiration, ! CachePriority priority) { lock (itemStore.SyncRoot) --- 133,137 ---- /// Item's time-to-live (TTL) in milliseconds. /// </param> ! protected override void DoInsert(object key, object value, TimeSpan timeToLive) { lock (itemStore.SyncRoot) Index: ICache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/ICache.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ICache.cs 9 Feb 2007 07:12:23 -0000 1.2 --- ICache.cs 24 Aug 2007 22:43:55 -0000 1.3 *************** *** 19,22 **** --- 19,23 ---- #endregion + using System; using System.Collections; *************** *** 100,122 **** /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live (TTL) in milliseconds. ! /// </param> ! /// <param name="slidingExpiration"> ! /// Flag specifying whether the item's time-to-live should be reset ! /// when the item is accessed. ! /// </param> ! void Insert(object key, object value, int timeToLive, bool slidingExpiration); ! ! /// <summary> ! /// Inserts an item into the cache. ! /// </summary> ! /// <param name="key"> ! /// Item key. ! /// </param> ! /// <param name="value"> ! /// Item value. ! /// </param> ! /// <param name="timeToLive"> ! /// Item's time-to-live (TTL) in milliseconds. /// </param> /// <param name="slidingExpiration"> --- 101,105 ---- /// </param> /// <param name="timeToLive"> ! /// Item's time-to-live. /// </param> /// <param name="slidingExpiration"> *************** *** 124,131 **** /// when the item is accessed. /// </param> ! /// <param name="priority"> ! /// Item priority. ! /// </param> ! void Insert(object key, object value, int timeToLive, bool slidingExpiration, CachePriority priority); } } \ No newline at end of file --- 107,111 ---- /// when the item is accessed. /// </param> ! void Insert(object key, object value, TimeSpan timeToLive); } } \ No newline at end of file Index: BaseCacheAttribute.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/BaseCacheAttribute.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BaseCacheAttribute.cs 1 Apr 2007 15:04:39 -0000 1.3 --- BaseCacheAttribute.cs 24 Aug 2007 22:43:55 -0000 1.4 *************** *** 19,25 **** private string condition; private IExpression conditionExpression; ! private int timeToLive = 0; ! private bool slidingExpiration = false; ! private CachePriority priority = CachePriority.Default; #endregion --- 19,24 ---- private string condition; private IExpression conditionExpression; ! private string timeToLive = null; ! private TimeSpan timeToLiveTimeSpan = TimeSpan.MinValue; #endregion *************** *** 129,178 **** /// <summary> ! /// The amount of time an object should remain in the cache (in seconds). /// </summary> /// <remarks> ! /// <p> ! /// The default time is 0, which means that an object will never expire. ! /// </p> /// </remarks> /// <value> ! /// The amount of time object should remain in the cache (in seconds). /// </value> ! public int TimeToLive { get { return timeToLive; } ! set { timeToLive = value; } } /// <summary> ! /// Is a sliding expiration cache strategy to be used? /// </summary> /// <remarks> ! /// <p> ! /// If this property value is set to <see lang="true"/>, every time the ! /// marked object is accessed it's ! /// <see cref="TimeToLive"/> property ! /// value must be reset to it's original value. ! /// </p> /// </remarks> /// <value> ! /// <see lang="true"/> if sliding expiration is to be used. ! /// </value> ! public bool SlidingExpiration ! { ! get { return slidingExpiration; } ! set { slidingExpiration = value; } ! } ! ! /// <summary> ! /// The cache priority for the item. ! /// </summary> ! /// <value> ! /// One of the <see cref="CachePriority"/> enumeration values. /// </value> ! public CachePriority Priority { ! get { return priority; } ! set { priority = value; } } --- 128,165 ---- /// <summary> ! /// The amount of time an object should remain in the cache. /// </summary> /// <remarks> ! /// If no TTL is specified, the default TTL defined by the ! /// cache's policy will be applied. /// </remarks> /// <value> ! /// The amount of time object should remain in the cache ! /// formatted to be recognizable by <see cref="TimeSpan.Parse(string)"/>. /// </value> ! public string TimeToLive { get { return timeToLive; } ! set ! { ! timeToLive = value; ! timeToLiveTimeSpan = (timeToLive == null) ? TimeSpan.MinValue : TimeSpan.Parse(timeToLive); ! } } + /// <summary> ! /// The amount of time an object should remain in the cache (in seconds). /// </summary> /// <remarks> ! /// If no TTL is specified, the default TTL defined by the ! /// cache's policy will be applied. /// </remarks> /// <value> ! /// The amount of time object should remain in the cache (in seconds). /// </value> ! public TimeSpan TimeToLiveTimeSpan { ! get { return timeToLiveTimeSpan; } } |
From: Erich E. <oak...@us...> - 2007-08-24 22:43:58
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4807 Modified Files: Spring.Core.2005.csproj Log Message: SPRNET-683, SPRNET-712 Index: Spring.Core.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.2005.csproj,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** Spring.Core.2005.csproj 22 Aug 2007 20:16:10 -0000 1.103 --- Spring.Core.2005.csproj 24 Aug 2007 22:43:55 -0000 1.104 *************** *** 103,107 **** </Compile> <Compile Include="Caching\BaseCacheAttribute.cs" /> - <Compile Include="Caching\CachePriority.cs" /> <Compile Include="Caching\AbstractCache.cs" /> <Compile Include="Caching\CacheResultAttribute.cs" /> --- 103,106 ---- |
From: Erich E. <oak...@us...> - 2007-08-24 22:43:51
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Cache In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4793 Modified Files: CacheParameterAdvice.cs CacheResultAdvice.cs Log Message: SPRNET-683, SPRNET-712 Index: CacheParameterAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Cache/CacheParameterAdvice.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CacheParameterAdvice.cs 1 Apr 2007 15:04:04 -0000 1.5 --- CacheParameterAdvice.cs 24 Aug 2007 22:43:46 -0000 1.6 *************** *** 96,101 **** object key = paramInfo.KeyExpression.GetValue(arguments[i]); ! cache.Insert(key, arguments[i], paramInfo.TimeToLive, ! paramInfo.SlidingExpiration, paramInfo.Priority); } } --- 96,100 ---- object key = paramInfo.KeyExpression.GetValue(arguments[i]); ! cache.Insert(key, arguments[i], paramInfo.TimeToLiveTimeSpan); } } Index: CacheResultAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Cache/CacheResultAdvice.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CacheResultAdvice.cs 22 Aug 2007 20:15:58 -0000 1.4 --- CacheResultAdvice.cs 24 Aug 2007 22:43:46 -0000 1.5 *************** *** 152,157 **** if (EvalCondition(resultInfo.Condition, resultInfo.ConditionExpression, returnValue, vars)) { ! cache.Insert(resultKey, (returnValue==null)?NullValue:returnValue, resultInfo.TimeToLive, ! resultInfo.SlidingExpiration, resultInfo.Priority); } } --- 152,156 ---- if (EvalCondition(resultInfo.Condition, resultInfo.ConditionExpression, returnValue, vars)) { ! cache.Insert(resultKey, (returnValue==null)?NullValue:returnValue, resultInfo.TimeToLiveTimeSpan); } } *************** *** 198,203 **** { object itemKey = itemInfo.KeyExpression.GetValue(item); ! cache.Insert(itemKey, (item==null?NullValue:item), itemInfo.TimeToLive, ! itemInfo.SlidingExpiration, itemInfo.Priority); } } --- 197,201 ---- { object itemKey = itemInfo.KeyExpression.GetValue(item); ! cache.Insert(itemKey, (item==null?NullValue:item), itemInfo.TimeToLiveTimeSpan); } } |
From: Erich E. <oak...@us...> - 2007-08-24 22:41:42
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4008/Caching Log Message: Directory /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Caching added to the repository |
From: Erich E. <oak...@us...> - 2007-08-23 23:31:42
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19112 Modified Files: ExpressionEvaluatorTests.cs Log Message: fixed SPRNET-709 Index: ExpressionEvaluatorTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ExpressionEvaluatorTests.cs 23 Aug 2007 14:31:18 -0000 1.64 --- ExpressionEvaluatorTests.cs 23 Aug 2007 23:31:06 -0000 1.65 *************** *** 32,35 **** --- 32,36 ---- using System.Threading; using System.Web.Services; + using antlr.collections; using NUnit.Framework; using Spring.Collections; *************** *** 1529,1536 **** // function invoked within projection expression ! IList upperNames = ! (IList) ! ExpressionEvaluator.GetValue(ieee.Members, "(#upper = {|txt| $txt.ToUpper() }; !{ #upper(#this.Name) })", ! new Hashtable()); Assert.AreEqual("NIKOLA TESLA", upperNames[0]); Assert.AreEqual("MIHAJLO PUPIN", upperNames[1]); --- 1530,1535 ---- // function invoked within projection expression ! string expr = "(#upper = {|txt| $txt.ToUpper() }; !{ #upper(Name) })"; ! IList upperNames = (IList)ExpressionEvaluator.GetValue(ieee.Members, expr, new Hashtable()); Assert.AreEqual("NIKOLA TESLA", upperNames[0]); Assert.AreEqual("MIHAJLO PUPIN", upperNames[1]); *************** *** 1540,1544 **** Expression.RegisterFunction("sqrt", "{|n| Math.Sqrt($n)}", vars); Expression.RegisterFunction("fact", "{|n| $n <= 1 ? 1 : $n * #fact($n-1)}", vars); ! string expr = @"( #delegate = {|f,n| $f($n) }; --- 1539,1543 ---- Expression.RegisterFunction("sqrt", "{|n| Math.Sqrt($n)}", vars); Expression.RegisterFunction("fact", "{|n| $n <= 1 ? 1 : $n * #fact($n-1)}", vars); ! string expr2 = @"( #delegate = {|f,n| $f($n) }; *************** *** 1547,1551 **** #result = { #delegate(#sqrt, 4), #d(#fact, 5), #delegate({|n| $n ^ 2 }, 5) } )"; ! IList results = (IList) ExpressionEvaluator.GetValue(null, expr, vars); Assert.AreEqual(2, results[0]); Assert.AreEqual(120, results[1]); --- 1546,1550 ---- #result = { #delegate(#sqrt, 4), #d(#fact, 5), #delegate({|n| $n ^ 2 }, 5) } )"; ! IList results = (IList) ExpressionEvaluator.GetValue(null, expr2, vars); Assert.AreEqual(2, results[0]); Assert.AreEqual(120, results[1]); *************** *** 2238,2265 **** } ! #region TestSPRNET709 Classes ! ! private class TestSPRNET709Class { ! public string SelectedValue = "100"; ! } ! ! #endregion ! [Test] ! [Ignore("to clarify, recorded as SPRNET-709")] ! public void TestSPRNET709() ! { ! // this line fails with ! // Spring.Core.InvalidPropertyException : ! // 'roomtype_dropdownlist' node cannot be resolved for the specified context [System.Int64]. ! IExpression exp = Expression.Parse("long.Parse(SelectedValue)"); ! // this line works: ! // IExpression exp = Expression.Parse("long.Parse(#root.SelectedValue))"); ! TestSPRNET709Class root = new TestSPRNET709Class(); ! object result = exp.GetValue(root); ! Assert.AreSame( (long)100, result ); } --- 2237,2261 ---- } ! [Test] ! public void TestMethodArgumentNodesResolveAgainstThisContext() { ! IExpression exp; ! // case #root == #this - ToString() will be applied to #this ! exp = Expression.Parse("long.Parse(ToString())"); ! object result = exp.GetValue(100); ! Assert.AreEqual((long)100, result); ! // case #root != #this in Projection - ToString() will be applied to #this ! exp = Expression.Parse("(#noop ={|val| $val}; !{#noop(ToString()) } )"); ! result = exp.GetValue(new int[] { 100, 200 }, new Hashtable()); ! Assert.AreEqual(new string[] { "100", "200" }, result); ! // case #root != #this in Selection - ToString() will be applied to #this ! exp = Expression.Parse("(#noop ={|val| $val}; ?{#noop(ToString()=='100')} )"); ! result = exp.GetValue(new int[] { 100, 200 }, new Hashtable()); ! IList list = new ArrayList(); ! list.Add(100); ! Assert.AreEqual(list, result); } *************** *** 2555,2558 **** --- 2551,2569 ---- #endregion + private static void DumpNode(AST rootNode, int level) + { + Trace.WriteLine(new string(' ', level) + rootNode.ToString()); + + int numberOfChildren = rootNode.getNumberOfChildren(); + if (numberOfChildren > 0) + { + AST node = rootNode.getFirstChild(); + while (node != null) + { + DumpNode(node, level + 2); + node = node.getNextSibling(); + } + } + } } |
From: Erich E. <oak...@us...> - 2007-08-23 23:31:33
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19074 Modified Files: BaseNode.cs LambdaExpressionNode.cs LocalFunctionNode.cs NodeWithArguments.cs ProjectionNode.cs SelectionFirstNode.cs SelectionLastNode.cs SelectionNode.cs VariableNode.cs Log Message: fixed SPRNET-709 Index: LambdaExpressionNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/LambdaExpressionNode.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LambdaExpressionNode.cs 16 May 2007 15:09:41 -0000 1.6 --- LambdaExpressionNode.cs 23 Aug 2007 23:30:52 -0000 1.7 *************** *** 100,108 **** public object GetValueInternal(object context, EvaluationContext evalContext, IDictionary arguments) { ! IDictionary savedLocalVariables = evalContext.LocalVariables; ! evalContext.LocalVariables = arguments; ! object result = base.GetValueInternal(context, evalContext); ! evalContext.LocalVariables = savedLocalVariables; ! return result; } --- 100,108 ---- public object GetValueInternal(object context, EvaluationContext evalContext, IDictionary arguments) { ! using (evalContext.SwitchLocalVariables(arguments)) ! { ! object result = base.GetValueInternal(context, evalContext); ! return result; ! } } Index: VariableNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/VariableNode.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** VariableNode.cs 16 May 2007 15:09:41 -0000 1.6 --- VariableNode.cs 23 Aug 2007 23:30:53 -0000 1.7 *************** *** 58,62 **** if (varName == "this") { ! return evalContext.CurrentContext; } else if (varName == "root") --- 58,62 ---- if (varName == "this") { ! return evalContext.ThisContext; } else if (varName == "root") Index: SelectionFirstNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/SelectionFirstNode.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SelectionFirstNode.cs 16 May 2007 15:09:41 -0000 1.3 --- SelectionFirstNode.cs 23 Aug 2007 23:30:53 -0000 1.4 *************** *** 64,73 **** BaseNode expression = (BaseNode) this.getFirstChild(); ! foreach (object o in enumerable) { ! bool isMatch = (bool) expression.GetValueInternal(o, evalContext); ! if (isMatch) { ! return o; } } --- 64,77 ---- BaseNode expression = (BaseNode) this.getFirstChild(); ! using (evalContext.SwitchThisContext()) { ! foreach (object o in enumerable) { ! evalContext.ThisContext = o; ! bool isMatch = (bool) expression.GetValueInternal(o, evalContext); ! if (isMatch) ! { ! return o; ! } } } Index: BaseNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/BaseNode.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** BaseNode.cs 22 Aug 2007 20:16:20 -0000 1.22 --- BaseNode.cs 23 Aug 2007 23:30:52 -0000 1.23 *************** *** 33,36 **** --- 33,38 ---- public abstract class BaseNode : SpringAST, IExpression { + #region EvaluationContext class + /// <summary> /// Holds the state during evaluating an expression. *************** *** 38,42 **** protected internal class EvaluationContext { ! /// <summary> /// Gets/Sets the root context of the current evaluation /// </summary> --- 40,83 ---- protected internal class EvaluationContext { ! #region Holder classes ! ! private class ThisContextHolder : IDisposable ! { ! private readonly EvaluationContext owner; ! private readonly object savedThisContext; ! ! public ThisContextHolder(EvaluationContext owner) ! { ! this.owner = owner; ! this.savedThisContext = owner.ThisContext; ! } ! ! public void Dispose() ! { ! owner.ThisContext = savedThisContext; ! } ! } ! ! private class LocalVariablesHolder : IDisposable ! { ! private readonly EvaluationContext owner; ! private readonly IDictionary savedLocalVariables; ! ! public LocalVariablesHolder(EvaluationContext owner, IDictionary newLocalVariables) ! { ! this.owner = owner; ! this.savedLocalVariables = owner.LocalVariables; ! owner.LocalVariables = newLocalVariables; ! } ! ! public void Dispose() ! { ! owner.LocalVariables = savedLocalVariables; ! } ! } ! ! #endregion ! ! /// <summary> /// Gets/Sets the root context of the current evaluation /// </summary> *************** *** 49,53 **** /// Gets/Sets the current context of the current evaluation /// </summary> ! public object CurrentContext; /// <summary> /// Gets/Sets global variables of the current evaluation --- 90,94 ---- /// Gets/Sets the current context of the current evaluation /// </summary> ! public object ThisContext; /// <summary> /// Gets/Sets global variables of the current evaluation *************** *** 59,70 **** public IDictionary LocalVariables; ! public EvaluationContext(object rootContext, IDictionary variables) { this.RootContext = rootContext; ! this.CurrentContext = rootContext; ! this.Variables = variables; } } /// <summary> /// Create a new instance --- 100,134 ---- public IDictionary LocalVariables; ! /// <summary> ! /// Initializes a new EvaluationContext instance. ! /// </summary> ! /// <param name="rootContext">The root context for this evaluation</param> ! /// <param name="globalVariables">dictionary of global variables used during this evaluation</param> ! public EvaluationContext(object rootContext, IDictionary globalVariables) { this.RootContext = rootContext; ! this.ThisContext = rootContext; ! this.Variables = globalVariables; ! } ! ! /// <summary> ! /// Switches current ThisContext. ! /// </summary> ! public IDisposable SwitchThisContext() ! { ! return new ThisContextHolder(this); ! } ! ! /// <summary> ! /// Switches current LocalVariables. ! /// </summary> ! public IDisposable SwitchLocalVariables(IDictionary newLocalVariables) ! { ! return new LocalVariablesHolder(this, newLocalVariables); } } + #endregion + /// <summary> /// Create a new instance *************** *** 128,132 **** protected internal object GetValueInternal(object context, EvaluationContext evalContext) { - evalContext.CurrentContext = context; return Get(context, evalContext); } --- 192,195 ---- *************** *** 173,177 **** protected internal void SetValueInternal(object context, EvaluationContext evalContext, object newValue) { - evalContext.CurrentContext = context; Set(context, evalContext, newValue); } --- 236,239 ---- Index: SelectionNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/SelectionNode.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SelectionNode.cs 16 May 2007 15:09:41 -0000 1.3 --- SelectionNode.cs 23 Aug 2007 23:30:53 -0000 1.4 *************** *** 66,75 **** BaseNode expression = (BaseNode) this.getFirstChild(); IList selectionList = new ArrayList(); ! foreach (object o in enumerable) { ! bool isMatch = (bool) expression.GetValueInternal(o, evalContext); ! if (isMatch) { ! selectionList.Add(o); } } --- 66,79 ---- BaseNode expression = (BaseNode) this.getFirstChild(); IList selectionList = new ArrayList(); ! using (evalContext.SwitchThisContext()) { ! foreach (object o in enumerable) { ! evalContext.ThisContext = o; ! bool isMatch = (bool) expression.GetValueInternal(o, evalContext); ! if (isMatch) ! { ! selectionList.Add(o); ! } } } Index: LocalFunctionNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/LocalFunctionNode.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LocalFunctionNode.cs 16 May 2007 15:09:41 -0000 1.5 --- LocalFunctionNode.cs 23 Aug 2007 23:30:52 -0000 1.6 *************** *** 57,61 **** { string name = this.getText(); ! IDictionary locals = evalContext.LocalVariables; //(IDictionary) variables[LocalVariableNode.LOCAL_VARIABLES]; LambdaExpressionNode lambda = locals[name] as LambdaExpressionNode; --- 57,61 ---- { string name = this.getText(); ! IDictionary locals = evalContext.LocalVariables; LambdaExpressionNode lambda = locals[name] as LambdaExpressionNode; Index: ProjectionNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/ProjectionNode.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ProjectionNode.cs 16 May 2007 15:09:41 -0000 1.6 --- ProjectionNode.cs 23 Aug 2007 23:30:53 -0000 1.7 *************** *** 66,72 **** BaseNode expression = (BaseNode) this.getFirstChild(); IList projectedList = new ArrayList(); ! foreach(object o in enumerable) { ! projectedList.Add(expression.GetValueInternal(o, evalContext)); } return projectedList; --- 66,76 ---- BaseNode expression = (BaseNode) this.getFirstChild(); IList projectedList = new ArrayList(); ! using (evalContext.SwitchThisContext()) { ! foreach(object o in enumerable) ! { ! evalContext.ThisContext = o; ! projectedList.Add(expression.GetValueInternal(o, evalContext)); ! } } return projectedList; Index: NodeWithArguments.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/NodeWithArguments.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NodeWithArguments.cs 31 Jul 2007 08:18:20 -0000 1.13 --- NodeWithArguments.cs 23 Aug 2007 23:30:52 -0000 1.14 *************** *** 158,162 **** else { ! return ((BaseNode)args[position]).GetValueInternal(evalContext.CurrentContext, evalContext); } } --- 158,162 ---- else { ! return ((BaseNode)args[position]).GetValueInternal(evalContext.ThisContext, evalContext); } } *************** *** 170,174 **** private object ResolveNamedArgument(string name, EvaluationContext evalContext) { ! return ((BaseNode)namedArgs[name]).GetValueInternal(evalContext.CurrentContext, evalContext); } --- 170,174 ---- private object ResolveNamedArgument(string name, EvaluationContext evalContext) { ! return ((BaseNode)namedArgs[name]).GetValueInternal(evalContext.ThisContext, evalContext); } Index: SelectionLastNode.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/SelectionLastNode.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SelectionLastNode.cs 16 May 2007 15:09:41 -0000 1.3 --- SelectionLastNode.cs 23 Aug 2007 23:30:53 -0000 1.4 *************** *** 64,75 **** } ! BaseNode expression = (BaseNode) this.getFirstChild(); ! for (int i = list.Count - 1; i >= 0; i--) { ! object listItem = list[i]; ! bool isMatch = (bool)expression.GetValueInternal( listItem, evalContext ); ! if (isMatch) { ! return listItem; } } --- 64,79 ---- } ! using (evalContext.SwitchThisContext()) { ! BaseNode expression = (BaseNode) this.getFirstChild(); ! for (int i = list.Count - 1; i >= 0; i--) { ! object listItem = list[i]; ! evalContext.ThisContext = listItem; ! bool isMatch = (bool)expression.GetValueInternal( listItem, evalContext ); ! if (isMatch) ! { ! return listItem; ! } } } |
From: Erich E. <oak...@us...> - 2007-08-23 14:31:25
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Context/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3851/Context/Support Modified Files: AbstractMessageSourceTests.cs MessageSourceAccessorTests.cs Log Message: added Test for SPRNET-709 fix SPRNET-710 (moved MessageSourceAccessorTests to use Rhino instead DotNetMock) set pessimistic default expectations on DotNetMock based MockMessageSource to catch missing expectations Index: AbstractMessageSourceTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractMessageSourceTests.cs 2 Jul 2007 21:24:48 -0000 1.5 --- AbstractMessageSourceTests.cs 23 Aug 2007 14:31:18 -0000 1.6 *************** *** 19,29 **** #endregion using System; using System.Globalization; using NUnit.Framework; namespace Spring.Context.Support { ! [TestFixture] public sealed class AbstractMessageSourceTests : AbstractMessageSource { --- 19,35 ---- #endregion + #region Imports + using System; using System.Globalization; using NUnit.Framework; + #endregion + namespace Spring.Context.Support { ! /// <author></author> ! /// <version>$Id$</version> ! [TestFixture] public sealed class AbstractMessageSourceTests : AbstractMessageSource { *************** *** 47,57 **** public void GetResolvableDefaultsToParentMessageSource() { MockMessageSource parentSource = new MockMessageSource(); parentSource.SetExpectedGetMessageCalls(1); parentSource.SetExpectedGetMessageReturn("MockMessageSource"); ParentMessageSource = parentSource; ! MockMessageResolvable res = new MockMessageResolvable(); ! res.SetExpectedCodesCalls(1); ! res.SetCode("nullCode"); Assert.AreEqual("MockMessageSource", GetMessage(res, CultureInfo.CurrentCulture), "My Message"); parentSource.Verify(); --- 53,72 ---- public void GetResolvableDefaultsToParentMessageSource() { + string MSGCODE = "nullCode"; + object[] MSGARGS = new object[] { "arg1", "arg2" }; + + MockMessageResolvable res = new MockMessageResolvable(); + res.SetExpectedCodesCalls(1); + res.SetArguments(MSGARGS); + res.SetCode(MSGCODE); + MockMessageSource parentSource = new MockMessageSource(); parentSource.SetExpectedGetMessageCalls(1); + parentSource.SetExpectedGetMessageCode(MSGCODE); + parentSource.SetExpectedGetMessageDefaultMessage(null); + parentSource.SetExpectedGetMessageArguments(res.GetArguments()); parentSource.SetExpectedGetMessageReturn("MockMessageSource"); ParentMessageSource = parentSource; ! Assert.AreEqual("MockMessageSource", GetMessage(res, CultureInfo.CurrentCulture), "My Message"); parentSource.Verify(); *************** *** 62,70 **** public void GetMessageParentMessageSource() { MockMessageSource parentSource = new MockMessageSource(); parentSource.SetExpectedGetMessageCalls(1); parentSource.SetExpectedGetMessageReturn("my parent message"); ParentMessageSource = parentSource; ! Assert.AreEqual("my parent message", GetMessage("null", CultureInfo.CurrentCulture, new object[] {"arguments"}), "message"); parentSource.Verify(); } --- 77,89 ---- public void GetMessageParentMessageSource() { + object[] args = new object[] {"arguments"}; MockMessageSource parentSource = new MockMessageSource(); parentSource.SetExpectedGetMessageCalls(1); + parentSource.SetExpectedGetMessageCode("null"); + parentSource.SetExpectedGetMessageDefaultMessage(null); + parentSource.SetExpectedGetMessageArguments(args); parentSource.SetExpectedGetMessageReturn("my parent message"); ParentMessageSource = parentSource; ! Assert.AreEqual("my parent message", GetMessage("null", "message", CultureInfo.CurrentCulture, args[0])); parentSource.Verify(); } Index: MessageSourceAccessorTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Context/Support/MessageSourceAccessorTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MessageSourceAccessorTests.cs 24 Jul 2007 17:26:40 -0000 1.5 --- MessageSourceAccessorTests.cs 23 Aug 2007 14:31:18 -0000 1.6 *************** *** 22,25 **** --- 22,26 ---- using NUnit.Framework; + using Rhino.Mocks; using Spring.Globalization; *************** *** 41,55 **** } [Test] ! public void DefaultsToCurrentUICulture() { ! MockMessageSource mockMsgSource = new MockMessageSource(); ! mockMsgSource.SetExpectedGetMessageCalls(1); ! mockMsgSource.SetExpectedGetMessageCode("code1"); ! mockMsgSource.SetExpectedGetMessageReturn("my message"); ! mockMsgSource.SetExpectedGetMessageArguments(new object[] { "argument1" }); MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); ! Assert.AreEqual("my message", msgSourceAccessor.GetMessage("code1", CultureInfo.CurrentUICulture, new object[] { "argument1" })); ! mockMsgSource.Verify(); } --- 42,77 ---- } + private readonly string MSGCODE = "code1"; + private readonly CultureInfo MSGCULTURE = new CultureInfo("fr"); + private readonly object[] MSGARGS = new object[] { "argument1" }; + private readonly string MSGRESULT = "my message"; + + + private MockRepository mocks; + private IMessageSource mockMsgSource; + private IMessageSourceResolvable mockMsgSourceResolvable; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + mockMsgSource = (IMessageSource) mocks.CreateMock(typeof(IMessageSource)); + mockMsgSourceResolvable = (IMessageSourceResolvable) mocks.CreateMock(typeof(IMessageSourceResolvable)); + } + + [TearDown] + public void TearDown() + { + mocks.VerifyAll(); + } + [Test] ! public void GetMessageCodeCultureArgs() { ! Expect.Call(mockMsgSource.GetMessage(MSGCODE, MSGCULTURE, MSGARGS)).Return(MSGRESULT); ! mocks.ReplayAll(); ! MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); ! Assert.AreEqual(MSGRESULT, msgSourceAccessor.GetMessage(MSGCODE, MSGCULTURE, MSGARGS)); } *************** *** 57,93 **** public void GetMessageCodeArgs() { ! MockMessageSource mockMsgSource = new MockMessageSource(); ! mockMsgSource.SetExpectedGetMessageCalls(1); ! mockMsgSource.SetExpectedGetMessageCode("code1"); ! mockMsgSource.SetExpectedGetMessageReturn("my message"); ! mockMsgSource.SetExpectedGetMessageArguments(new object[] {"argument1"}); ! MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource, CultureInfo.CurrentUICulture); ! Assert.AreEqual("my message", msgSourceAccessor.GetMessage("code1", new object[] {"argument1"})); ! mockMsgSource.Verify(); } [Test] ! public void GetMessageCode() { ! MockMessageSource mockMsgSource = new MockMessageSource(); ! mockMsgSource.SetExpectedGetMessageCalls(1); ! mockMsgSource.SetExpectedGetMessageCode("code1"); ! mockMsgSource.SetExpectedGetMessageReturn("my message"); ! mockMsgSource.SetExpectedGetMessageArguments(null); MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); ! Assert.AreEqual("my message", msgSourceAccessor.GetMessage("code1")); ! mockMsgSource.Verify(); } [Test] ! public void GetMessageResolvable() { ! MockMessageSource mockMsgSource = new MockMessageSource(); ! mockMsgSource.SetExpectedGetMessageCalls(1); ! mockMsgSource.SetExpectedGetMessageReturn("my message"); MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); ! Assert.AreEqual("my message", msgSourceAccessor.GetMessage(new MockMessageResolvable())); ! mockMsgSource.Verify(); } } --- 79,137 ---- public void GetMessageCodeArgs() { ! Expect.Call(mockMsgSource.GetMessage(MSGCODE, MSGCULTURE, MSGARGS)).Return(MSGRESULT); ! mocks.ReplayAll(); ! ! MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource, MSGCULTURE); ! Assert.AreEqual(MSGRESULT, msgSourceAccessor.GetMessage(MSGCODE, MSGARGS)); } [Test] ! public void GetMessageCodeArgsDefaultsToCurrentUICulture() { ! Expect.Call(mockMsgSource.GetMessage(MSGCODE, CultureInfo.CurrentUICulture, MSGARGS)).Return(MSGRESULT); ! mocks.ReplayAll(); ! MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); ! Assert.AreEqual(MSGRESULT, msgSourceAccessor.GetMessage(MSGCODE, MSGARGS)); } [Test] ! public void GetMessageCodeCulture() { ! Expect.Call(mockMsgSource.GetMessage(MSGCODE, MSGCULTURE)).Return(MSGRESULT); ! mocks.ReplayAll(); ! MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); ! Assert.AreEqual(MSGRESULT, msgSourceAccessor.GetMessage(MSGCODE, MSGCULTURE)); ! } ! ! [Test] ! public void GetMessageCodeDefaultsToCurrentUICulture() ! { ! Expect.Call(mockMsgSource.GetMessage(MSGCODE, CultureInfo.CurrentUICulture)).Return(MSGRESULT); ! mocks.ReplayAll(); ! ! MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); ! Assert.AreEqual(MSGRESULT, msgSourceAccessor.GetMessage(MSGCODE)); ! } ! ! [Test] ! public void GetMessageResolvableCulture() ! { ! Expect.Call(mockMsgSource.GetMessage(mockMsgSourceResolvable, MSGCULTURE)).Return(MSGRESULT); ! mocks.ReplayAll(); + MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); + Assert.AreEqual(MSGRESULT, msgSourceAccessor.GetMessage(mockMsgSourceResolvable, MSGCULTURE)); + } + + [Test] + public void GetMessageResolvableDefaultsToCurrentUICulture() + { + Expect.Call(mockMsgSource.GetMessage(mockMsgSourceResolvable, CultureInfo.CurrentUICulture)).Return(MSGRESULT); + mocks.ReplayAll(); + + MessageSourceAccessor msgSourceAccessor = new MessageSourceAccessor(mockMsgSource); + Assert.AreEqual(MSGRESULT, msgSourceAccessor.GetMessage(mockMsgSourceResolvable)); } } |
From: Erich E. <oak...@us...> - 2007-08-23 14:31:25
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3851/Expressions Modified Files: ExpressionEvaluatorTests.cs Log Message: added Test for SPRNET-709 fix SPRNET-710 (moved MessageSourceAccessorTests to use Rhino instead DotNetMock) set pessimistic default expectations on DotNetMock based MockMessageSource to catch missing expectations Index: ExpressionEvaluatorTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** ExpressionEvaluatorTests.cs 8 Aug 2007 11:19:28 -0000 1.63 --- ExpressionEvaluatorTests.cs 23 Aug 2007 14:31:18 -0000 1.64 *************** *** 2238,2241 **** --- 2238,2267 ---- } + #region TestSPRNET709 Classes + + private class TestSPRNET709Class + { + public string SelectedValue = "100"; + } + + #endregion + + [Test] + [Ignore("to clarify, recorded as SPRNET-709")] + public void TestSPRNET709() + { + // this line fails with + // Spring.Core.InvalidPropertyException : + // 'roomtype_dropdownlist' node cannot be resolved for the specified context [System.Int64]. + IExpression exp = Expression.Parse("long.Parse(SelectedValue)"); + + // this line works: + // IExpression exp = Expression.Parse("long.Parse(#root.SelectedValue))"); + + TestSPRNET709Class root = new TestSPRNET709Class(); + object result = exp.GetValue(root); + Assert.AreSame( (long)100, result ); + } + [Test] public void TestAccessVisibility() *************** *** 2271,2274 **** --- 2297,2302 ---- } + #region TestAccessVisibility Classes + internal class AccessVisibilityCases { *************** *** 2299,2302 **** --- 2327,2332 ---- } + #endregion + #region Set operations tests |
From: Erich E. <oak...@us...> - 2007-08-23 14:31:24
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Context In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3851/Context Modified Files: CommonTypes.cs Log Message: added Test for SPRNET-709 fix SPRNET-710 (moved MessageSourceAccessorTests to use Rhino instead DotNetMock) set pessimistic default expectations on DotNetMock based MockMessageSource to catch missing expectations Index: CommonTypes.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Context/CommonTypes.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CommonTypes.cs 8 Aug 2007 17:48:45 -0000 1.20 --- CommonTypes.cs 23 Aug 2007 14:31:18 -0000 1.21 *************** *** 44,56 **** private ExpectationCounter _getMessageCalls = new ExpectationCounter("MockMessageSource.GetMessageCounter"); private ExpectationString _getMessageCode = new ExpectationString("MockMessageSource.GetMessageCode"); private ExpectationArray _getMessageArguments = new ExpectationArray("MockMessageSource.GetMessageArguments"); private string _getMessageReturn = null; ! public void SetExpectedGetMessageCalls(int calls) { _getMessageCalls.Expected = calls; } public void SetExpectedGetMessageArguments(object[] arguments) { --- 44,72 ---- private ExpectationCounter _getMessageCalls = new ExpectationCounter("MockMessageSource.GetMessageCounter"); private ExpectationString _getMessageCode = new ExpectationString("MockMessageSource.GetMessageCode"); + private ExpectationString _getMessageDefaultMessage = new ExpectationString("MockMessageSource.GetMessageDefaultMessage"); private ExpectationArray _getMessageArguments = new ExpectationArray("MockMessageSource.GetMessageArguments"); private string _getMessageReturn = null; ! ! public MockMessageSource() ! { ! // this is to ensure, that no expectations may be violated ! _getMessageCalls.Expected = -1; ! _getMessageCode.Expected = "something very, very unlikely " + Guid.NewGuid(); ! _getMessageDefaultMessage.Expected = "something very, very unlikely " + Guid.NewGuid(); ! _getMessageArguments.Expected = new object[] { "something very, very unlikely " + Guid.NewGuid() }; ! } ! ! public void SetExpectedGetMessageCalls(int calls) { _getMessageCalls.Expected = calls; } + public void SetExpectedGetMessageDefaultMessage(string defaultMessage) + { + _getMessageDefaultMessage.Expected = defaultMessage; + } + public void SetExpectedGetMessageArguments(object[] arguments) { *************** *** 104,107 **** --- 120,124 ---- _getMessageCalls.Inc(); _getMessageCode.Actual = name; + _getMessageDefaultMessage.Actual = defaultMessage; _getMessageArguments.Actual = arguments; return _getMessageReturn; |
From: Erich E. <oak...@us...> - 2007-08-23 14:31:21
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3436 Modified Files: MessageSourceAccessor.cs Log Message: added Test for SPRNET-709 fix SPRNET-710 (moved MessageSourceAccessorTests to use Rhino instead DotNetMock) set pessimistic default expectations on DotNetMock based MockMessageSource to catch missing expectations Index: MessageSourceAccessor.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/MessageSourceAccessor.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MessageSourceAccessor.cs 9 Apr 2006 07:18:38 -0000 1.7 --- MessageSourceAccessor.cs 23 Aug 2007 14:30:50 -0000 1.8 *************** *** 91,95 **** public string GetMessage(string code) { ! return _messageSource.GetMessage(code, _defaultCultureInfo, null); } --- 91,95 ---- public string GetMessage(string code) { ! return _messageSource.GetMessage(code, _defaultCultureInfo); } *************** *** 106,110 **** public string GetMessage(string code, CultureInfo cultureInfo) { ! return _messageSource.GetMessage(code, cultureInfo, null); } --- 106,110 ---- public string GetMessage(string code, CultureInfo cultureInfo) { ! return _messageSource.GetMessage(code, cultureInfo); } |
From: Erich E. <oak...@us...> - 2007-08-23 10:38:17
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12421/Web/UI Modified Files: Page.cs Log Message: improved WebQuickStart examples fixed SPRNET-344 fixed SPRNET-696 fixed SPRNET-706 Index: Page.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Page.cs,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Page.cs 23 Aug 2007 08:27:08 -0000 1.82 --- Page.cs 23 Aug 2007 10:38:12 -0000 1.83 *************** *** 1249,1254 **** BindingManager.BindTargetToSource(this, Controller, ValidationErrors); - OnDataBound(EventArgs.Empty); } } --- 1249,1254 ---- BindingManager.BindTargetToSource(this, Controller, ValidationErrors); } + OnDataBound(EventArgs.Empty); } *************** *** 1263,1268 **** BindingManager.BindSourceToTarget(this, Controller, ValidationErrors); - OnDataUnbound(EventArgs.Empty); } } --- 1263,1268 ---- BindingManager.BindSourceToTarget(this, Controller, ValidationErrors); } + OnDataUnbound(EventArgs.Empty); } |
From: Erich E. <oak...@us...> - 2007-08-23 10:38:05
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12395 Modified Files: AbstractMessageSource.cs Log Message: improved WebQuickStart examples fixed SPRNET-344 fixed SPRNET-696 fixed SPRNET-706 Index: AbstractMessageSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/AbstractMessageSource.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AbstractMessageSource.cs 22 Aug 2007 20:16:10 -0000 1.20 --- AbstractMessageSource.cs 23 Aug 2007 10:38:02 -0000 1.21 *************** *** 433,437 **** { // Check parent MessageSource, returning null if not found there. ! return ParentMessageSource.GetMessage(code, args, null, culture); } } --- 433,437 ---- { // Check parent MessageSource, returning null if not found there. ! return ParentMessageSource.GetMessage(code, null, culture, args); } } |
From: Erich E. <oak...@us...> - 2007-08-23 10:37:57
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.WebQuickStart/src/Spring.WebQuickStart.2005/DataBinding/RobustEmployeeInfo In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12346/RobustEmployeeInfo Modified Files: Default.aspx Log Message: improved WebQuickStart examples fixed SPRNET-344 fixed SPRNET-696 fixed SPRNET-706 Index: Default.aspx =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.WebQuickStart/src/Spring.WebQuickStart.2005/DataBinding/RobustEmployeeInfo/Default.aspx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Default.aspx 4 Dec 2006 00:08:36 -0000 1.1 --- Default.aspx 23 Aug 2007 10:37:53 -0000 1.2 *************** *** 9,14 **** --- 9,17 ---- </head> <body> + <h2><a href="../../Default.aspx">Welcome to Spring.NET Web Framework Quick Start Guide</a></h2> + <h2><a href="../Default.aspx">Bi-directional DataBinding</a></h2> <form id="form1" runat="server"> <div> + <h2>Robust Employee Info example</h2> <p> Now that we have basic data binding rules configured, let's make it more robust. |
From: Erich E. <oak...@us...> - 2007-08-23 10:37:57
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.WebQuickStart/src/Spring.WebQuickStart.2005/DataBinding In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12346 Added Files: Default.aspx Default.aspx.cs Log Message: improved WebQuickStart examples fixed SPRNET-344 fixed SPRNET-696 fixed SPRNET-706 --- NEW FILE: Default.aspx.cs --- using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class DataBinding_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } --- NEW FILE: Default.aspx --- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="DataBinding_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Spring.NET Web Framework Quick Start Guide - Bi-directional DataBinding</title> </head> <body> <h2><a href="../Default.aspx">Welcome to Spring.NET Web Framework Quick Start Guide</a></h2> <div> <h2>Bi-directional DataBinding</h2> <p> Samples in this section demonstrate Spring.NET's capabilities of bi-directional binding data between your model and form. </p> <h3><a href="HelloWorld/Default.aspx">Hello World</a></h3> <p> This very simple web form demonstrates basic bi-directional data binding. </p> <h3><a href="EventHandling/Default.aspx">Event Handling</a></h3> <p> This example builds on the previous one by adding postback event handler that will convert the name to uppercase. </p> <h3><a href="Collections/Default.aspx">HttpRequestListBindingContainer</a></h3> <p> This example demonstrates unbinding data from request into a list using a HttpRequestListBindingContainer. </p> <h3><a href="EmployeeInfo/Default.aspx">Employee Info</a></h3> <p> Shows basics of bi-directional databinding with simple webcontrols (TextBox etc.) </p> <h3><a href="RobustEmployeeInfo/Default.aspx">Robust Employee Info</a></h3> <p> Demonstrates basic model validation capabilities </p> <h3><a href="Lists/Default.aspx">Lists</a></h3> <p> Demonstrates bi-directional binding of multi-selection listboxes </p> </div> </body> </html> |