adapdev-commits Mailing List for Adapdev.NET (Page 3)
Status: Beta
Brought to you by:
intesar66
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(26) |
Apr
(59) |
May
(37) |
Jun
(53) |
Jul
(13) |
Aug
(7) |
Sep
(5) |
Oct
(74) |
Nov
(404) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(10) |
Feb
(26) |
Mar
(64) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sean M. <int...@us...> - 2006-03-03 05:22:58
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3653/src/Adapdev.CodeGen Modified Files: NVelocityTableCodeTemplate.cs Log Message: Index: NVelocityTableCodeTemplate.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen/NVelocityTableCodeTemplate.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NVelocityTableCodeTemplate.cs 9 Dec 2005 05:30:30 -0000 1.13 --- NVelocityTableCodeTemplate.cs 3 Mar 2006 05:22:54 -0000 1.14 *************** *** 421,424 **** --- 421,446 ---- } + public string GetJoinStatement(object id, ForeignKeyAssociation assoc, DbType dbType) + { + string text = String.Empty; + + if(assoc.AssociationType == AssociationType.OneToOne || + assoc.AssociationType == AssociationType.OneToMany) + { + ISelectQuery query = QueryFactory.CreateSelectQuery(dbType); + query.SetTable(assoc.SecondForeignTableName); + query.AddAll(); + query.AddJoin(assoc.TableName, assoc.ColumnName, assoc.SecondForeignColumnName, JoinType.INNER); + + ICriteria criteria = query.CreateCriteria(); + criteria.AddEqualTo(assoc.Table.GetPrimaryKey(0).Name, id); + query.SetCriteria(criteria); + + text = query.GetText(); + } + + return text; + } + } } \ No newline at end of file |
From: Sean M. <int...@us...> - 2006-03-03 05:22:58
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3653/src/Adapdev.Tests Modified Files: ObjectComparerTest.cs Log Message: Index: ObjectComparerTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/ObjectComparerTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ObjectComparerTest.cs 21 Feb 2006 04:31:17 -0000 1.7 --- ObjectComparerTest.cs 3 Mar 2006 05:22:54 -0000 1.8 *************** *** 81,85 **** Assert.IsTrue(ObjectComparer.AreFieldsEqual(e1, e2), "Objects should be equal."); ! ClassAccessor c = ClassAccessorCache.Get(e2); c.SetValue(e2, "_Created", DateTime.Now.AddHours(1)); --- 81,85 ---- Assert.IsTrue(ObjectComparer.AreFieldsEqual(e1, e2), "Objects should be equal."); ! IClassAccessor c = ClassAccessorCache.Get(e2); c.SetValue(e2, "_Created", DateTime.Now.AddHours(1)); |
From: Sean M. <int...@us...> - 2006-03-03 05:22:58
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3653/src/Adapdev.Data Modified Files: DbProviderFactory.cs Log Message: Index: DbProviderFactory.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbProviderFactory.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DbProviderFactory.cs 23 Nov 2005 03:00:41 -0000 1.8 --- DbProviderFactory.cs 3 Mar 2006 05:22:54 -0000 1.9 *************** *** 146,149 **** --- 146,158 ---- #region DataSet + public static DataSet CreateDataSet(string connectionString, string command, DbProviderType DbProviderType) + { + IDbConnection connection = DbProviderFactory.CreateConnection(DbProviderType); + connection.ConnectionString = connectionString; + IDbCommand cmd = CreateCommand(DbProviderType); + cmd.CommandText = command; + return CreateDataSet(connection, cmd, DbProviderType); + } + public static DataSet CreateDataSet(string connectionString, IDbCommand command, DbProviderType DbProviderType) { |
From: Sean M. <int...@us...> - 2006-03-01 01:38:59
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Cache Modified Files: AbstractCache.cs CacheItem.cs CacheManager.cs CacheStats.cs CacheUtil.cs FileCache.cs ICache.cs ImmutableInMemoryCache.cs MutableInMemoryCache.cs Log Message: Index: AbstractCache.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/AbstractCache.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractCache.cs 16 Nov 2005 07:01:47 -0000 1.7 --- AbstractCache.cs 1 Mar 2006 01:38:50 -0000 1.8 *************** *** 33,37 **** } ! public CacheItem GetCacheItem(Type t, int key) { return this.GetCacheItem(t, key.ToString()); --- 33,37 ---- } ! public ICacheItem GetCacheItem(Type t, int key) { return this.GetCacheItem(t, key.ToString()); *************** *** 57,63 **** public abstract bool Contains(Type t, string key); public abstract int Count{get;} ! public abstract CacheItem[] Entries{get;} public abstract object Get(Type t, string key); ! public abstract CacheItem GetCacheItem(Type t, string key); public abstract void Populate(); public abstract void Remove(Type t, string key); --- 57,63 ---- public abstract bool Contains(Type t, string key); public abstract int Count{get;} ! public abstract ICacheItem[] Entries{get;} public abstract object Get(Type t, string key); ! public abstract ICacheItem GetCacheItem(Type t, string key); public abstract void Populate(); public abstract void Remove(Type t, string key); Index: CacheItem.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/CacheItem.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CacheItem.cs 16 Nov 2005 07:01:47 -0000 1.5 --- CacheItem.cs 1 Mar 2006 01:38:50 -0000 1.6 *************** *** 5,11 **** { /// <summary> ! /// Summary description for CacheItem. /// </summary> - /// [Serializable] public class CacheItem : ICacheItem --- 5,10 ---- { /// <summary> ! /// A wrapper for cached objects that contains meta data /// </summary> [Serializable] public class CacheItem : ICacheItem *************** *** 17,20 **** --- 16,24 ---- protected Type _objectType = null; + /// <summary> + /// Initializes a new instance of the <see cref="CacheItem"/> class. + /// </summary> + /// <param name="key">The key.</param> + /// <param name="o">The o.</param> public CacheItem(string key, object o) { *************** *** 25,28 **** --- 29,36 ---- } + /// <summary> + /// Gets the creation time. + /// </summary> + /// <value>The creation time.</value> public DateTime Created { *************** *** 30,33 **** --- 38,45 ---- } + /// <summary> + /// Gets the type of the object. + /// </summary> + /// <value>The type of the object.</value> public Type ObjectType { *************** *** 35,38 **** --- 47,54 ---- } + /// <summary> + /// Gets the cached object. + /// </summary> + /// <value>The cached object.</value> public virtual object Object { *************** *** 40,43 **** --- 56,63 ---- } + /// <summary> + /// Gets the internal key. + /// </summary> + /// <value>The internal key.</value> public string Key { *************** *** 45,48 **** --- 65,72 ---- } + /// <summary> + /// Gets the type key. + /// </summary> + /// <value>The type key.</value> public string TypeKey { *************** *** 50,53 **** --- 74,81 ---- } + /// <summary> + /// Gets or sets the ordinal location. + /// </summary> + /// <value>The ordinal location.</value> public int Ordinal { *************** *** 56,59 **** --- 84,93 ---- } + /// <summary> + /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. + /// </summary> + /// <returns> + /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. + /// </returns> public override string ToString() { Index: CacheManager.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/CacheManager.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CacheManager.cs 16 Nov 2005 07:01:47 -0000 1.8 --- CacheManager.cs 1 Mar 2006 01:38:50 -0000 1.9 *************** *** 14,17 **** --- 14,22 ---- } + /// <summary> + /// Gets or sets the cache. + /// </summary> + /// + /// <value>The cache.</value> public static ICache Cache { *************** *** 32,35 **** --- 37,45 ---- } + /// <summary> + /// Sets the cache. + /// </summary> + /// <param name="cacheType">Type of the cache.</param> + /// <param name="copyExisting">if set to <c>true</c> [copy existing].</param> public static void SetCache(CacheType cacheType, bool copyExisting) { *************** *** 58,61 **** --- 68,76 ---- } + /// <summary> + /// Sets the cache. The existing cache will automatically be copied over + /// to the new cache. + /// </summary> + /// <param name="cacheType">Type of the cache.</param> public static void SetCache(CacheType cacheType) { Index: FileCache.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/FileCache.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileCache.cs 16 Nov 2005 07:01:47 -0000 1.7 --- FileCache.cs 1 Mar 2006 01:38:50 -0000 1.8 *************** *** 81,85 **** } ! public override CacheItem GetCacheItem(Type t, string key) { return this._items[TypeKey.Build(t, key)] as SerializedCacheItem; --- 81,85 ---- } ! public override ICacheItem GetCacheItem(Type t, string key) { return this._items[TypeKey.Build(t, key)] as SerializedCacheItem; *************** *** 109,113 **** } ! public override CacheItem[] Entries { get --- 109,113 ---- } ! public override ICacheItem[] Entries { get Index: MutableInMemoryCache.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/MutableInMemoryCache.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MutableInMemoryCache.cs 16 Nov 2005 07:01:47 -0000 1.5 --- MutableInMemoryCache.cs 1 Mar 2006 01:38:50 -0000 1.6 *************** *** 35,39 **** } ! public override CacheItem GetCacheItem(Type t, string key) { return this._hashtable[TypeKey.Build(t, key)] as CacheItem; --- 35,39 ---- } ! public override ICacheItem GetCacheItem(Type t, string key) { return this._hashtable[TypeKey.Build(t, key)] as CacheItem; *************** *** 58,62 **** } ! public override CacheItem[] Entries { get --- 58,62 ---- } ! public override ICacheItem[] Entries { get Index: CacheStats.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/CacheStats.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CacheStats.cs 16 Nov 2005 07:01:47 -0000 1.6 --- CacheStats.cs 1 Mar 2006 01:38:50 -0000 1.7 *************** *** 74,83 **** } ! public CacheItem GetCacheItem(Type t, string key) { return this._cache.GetCacheItem(t, key); } ! public CacheItem GetCacheItem(Type t, int key) { return this._cache.GetCacheItem(t, key); --- 74,83 ---- } ! public ICacheItem GetCacheItem(Type t, string key) { return this._cache.GetCacheItem(t, key); } ! public ICacheItem GetCacheItem(Type t, int key) { return this._cache.GetCacheItem(t, key); *************** *** 120,124 **** } ! public CacheItem[] Entries { get --- 120,124 ---- } ! public ICacheItem[] Entries { get Index: CacheUtil.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/CacheUtil.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CacheUtil.cs 16 Nov 2005 07:01:47 -0000 1.6 --- CacheUtil.cs 1 Mar 2006 01:38:50 -0000 1.7 *************** *** 10,13 **** --- 10,18 ---- private CacheUtil(){} + /// <summary> + /// Copies the specified source. + /// </summary> + /// <param name="source">The source.</param> + /// <param name="target">The target.</param> public static void Copy(ICache source, ICache target) { Index: ICache.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/ICache.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ICache.cs 16 Nov 2005 07:01:47 -0000 1.8 --- ICache.cs 1 Mar 2006 01:38:50 -0000 1.9 *************** *** 10,28 **** public interface ICache { void Add(string key, object o); void Add(int key, object o); void Remove(Type t, int key); void Remove(Type t, string key); object Get(Type t, int key); object Get(Type t, string key); ! CacheItem GetCacheItem(Type t, string key); ! CacheItem GetCacheItem(Type t, int key); void Clear(); int Count{get;} bool Contains(Type t, string key); bool Contains(Type t, int key); void Scavenge(IScavenger scavenger); ! CacheItem[] Entries{get;} void Populate(); void Copy(ICache cache); } --- 10,110 ---- public interface ICache { + /// <summary> + /// Adds the specified object. + /// </summary> + /// <param name="key">The key.</param> + /// <param name="o">The o.</param> void Add(string key, object o); + /// <summary> + /// Adds the specified object. + /// </summary> + /// <param name="key">The key.</param> + /// <param name="o">The o.</param> void Add(int key, object o); + /// <summary> + /// Removes the specified object. + /// </summary> + /// <param name="t">The object.</param> + /// <param name="key">The key.</param> void Remove(Type t, int key); + /// <summary> + /// Removes the specified object. + /// </summary> + /// <param name="t">The object.</param> + /// <param name="key">The key.</param> void Remove(Type t, string key); + /// <summary> + /// Gets the specified object. + /// </summary> + /// <param name="t">The object.</param> + /// <param name="key">The key.</param> + /// <returns></returns> object Get(Type t, int key); + /// <summary> + /// Gets the specified object. + /// </summary> + /// <param name="t">The object.</param> + /// <param name="key">The key.</param> + /// <returns></returns> object Get(Type t, string key); ! /// <summary> ! /// Gets the cache item. ! /// </summary> ! /// <param name="t">The object.</param> ! /// <param name="key">The key.</param> ! /// <returns></returns> ! ICacheItem GetCacheItem(Type t, string key); ! /// <summary> ! /// Gets the cache item. ! /// </summary> ! /// <param name="t">The object.</param> ! /// <param name="key">The key.</param> ! /// <returns></returns> ! ICacheItem GetCacheItem(Type t, int key); ! /// <summary> ! /// Clears this instance. ! /// </summary> void Clear(); + /// <summary> + /// Gets the count. + /// </summary> + /// <value>The count.</value> int Count{get;} + /// <summary> + /// Determines whether [contains] [the specified object]. + /// </summary> + /// <param name="t">The t.</param> + /// <param name="key">The key.</param> + /// <returns> + /// <c>true</c> if [contains] [the specified object]; otherwise, <c>false</c>. + /// </returns> bool Contains(Type t, string key); + /// <summary> + /// Determines whether [contains] [the specified object]. + /// </summary> + /// <param name="t">The t.</param> + /// <param name="key">The key.</param> + /// <returns> + /// <c>true</c> if [contains] [the specified object]; otherwise, <c>false</c>. + /// </returns> bool Contains(Type t, int key); + /// <summary> + /// Scavenges the current cache, using the specified scavenger. + /// </summary> + /// <param name="scavenger">The scavenger.</param> void Scavenge(IScavenger scavenger); ! /// <summary> ! /// Gets the entries. ! /// </summary> ! /// <value>The entries.</value> ! ICacheItem[] Entries{get;} ! /// <summary> ! /// Populates this instance. ! /// </summary> void Populate(); + /// <summary> + /// Copies the specified cache. + /// </summary> + /// <param name="cache">The cache.</param> void Copy(ICache cache); } Index: ImmutableInMemoryCache.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/ImmutableInMemoryCache.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImmutableInMemoryCache.cs 16 Nov 2005 07:01:47 -0000 1.5 --- ImmutableInMemoryCache.cs 1 Mar 2006 01:38:50 -0000 1.6 *************** *** 35,39 **** } ! public override CacheItem GetCacheItem(Type t, string key) { return this._hashtable[TypeKey.Build(t, key)] as CacheItem; --- 35,39 ---- } ! public override ICacheItem GetCacheItem(Type t, string key) { return this._hashtable[TypeKey.Build(t, key)] as CacheItem; *************** *** 58,62 **** } ! public override CacheItem[] Entries { get --- 58,62 ---- } ! public override ICacheItem[] Entries { get |
From: Sean M. <int...@us...> - 2006-03-01 01:38:58
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.UnitTest.Core Modified Files: TestSuiteBuilder.cs Log Message: Index: TestSuiteBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestSuiteBuilder.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TestSuiteBuilder.cs 21 Feb 2006 04:31:18 -0000 1.18 --- TestSuiteBuilder.cs 1 Mar 2006 01:38:51 -0000 1.19 *************** *** 55,59 **** // create the logger private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); ! // setup the logging levels public TestSuite BuildAssemblies(params string[] assemblies) --- 55,60 ---- // create the logger private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); ! ! public static string DependencyLog = String.Empty; public TestSuite BuildAssemblies(params string[] assemblies) *************** *** 405,409 **** { AssemblyName assemblyName = assembly.GetName(); ! Console.WriteLine("Probing for: " + assemblyName); if (! dependencyList.Contains(assemblyName.FullName)) { --- 406,410 ---- { AssemblyName assemblyName = assembly.GetName(); ! //Console.WriteLine("Probing for: " + assemblyName); if (! dependencyList.Contains(assemblyName.FullName)) { *************** *** 411,416 **** foreach (AssemblyName name in assembly.GetReferencedAssemblies()) { ! Assembly referenced = Assembly.Load(name); ! FindDependencies(referenced, dependencyList); } } --- 412,424 ---- foreach (AssemblyName name in assembly.GetReferencedAssemblies()) { ! try ! { ! Assembly referenced = Assembly.Load(name); ! FindDependencies(referenced, dependencyList); ! } ! catch (Exception ex) ! { ! Console.Write(ex.Message); ! } } } *************** *** 419,423 **** public void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args) { ! Console.WriteLine("Loading: " + args.LoadedAssembly.FullName); } } --- 427,431 ---- public void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args) { ! //Console.WriteLine("Loading: " + args.LoadedAssembly.FullName); } } |
From: Sean M. <int...@us...> - 2006-03-01 01:38:58
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Cache.Tests Modified Files: AbstractICacheTest.cs Log Message: Index: AbstractICacheTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests/AbstractICacheTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractICacheTest.cs 26 Jan 2006 05:10:05 -0000 1.7 --- AbstractICacheTest.cs 1 Mar 2006 01:38:50 -0000 1.8 *************** *** 119,124 **** Assert.IsTrue(cache.Count == 2, "Cache count should be 2."); ! CacheItem c1 = cache.GetCacheItem(typeof(SuppliersEntity), e1.SupplierID); ! CacheItem c2 = cache.GetCacheItem(typeof(SuppliersEntity), e2.SupplierID); Assert.IsTrue(c1.Ordinal != c2.Ordinal, "Ordinals should be different."); --- 119,124 ---- Assert.IsTrue(cache.Count == 2, "Cache count should be 2."); ! ICacheItem c1 = cache.GetCacheItem(typeof(SuppliersEntity), e1.SupplierID); ! ICacheItem c2 = cache.GetCacheItem(typeof(SuppliersEntity), e2.SupplierID); Assert.IsTrue(c1.Ordinal != c2.Ordinal, "Ordinals should be different."); *************** *** 145,149 **** cache.Add(e1.SupplierID, e1); ! CacheItem c = cache.GetCacheItem(e1.GetType(), e1.SupplierID); Assert.AreEqual(e1.GetType(), c.ObjectType, "Object Types aren't equal."); Assert.AreEqual(1, c.Ordinal, "Ordinal should be 1"); --- 145,149 ---- cache.Add(e1.SupplierID, e1); ! ICacheItem c = cache.GetCacheItem(e1.GetType(), e1.SupplierID); Assert.AreEqual(e1.GetType(), c.ObjectType, "Object Types aren't equal."); Assert.AreEqual(1, c.Ordinal, "Ordinal should be 1"); |
From: Sean M. <int...@us...> - 2006-03-01 01:38:57
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/Scavengers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Cache/Scavengers Modified Files: LIFONumberScavenger.cs Log Message: Index: LIFONumberScavenger.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/Scavengers/LIFONumberScavenger.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LIFONumberScavenger.cs 16 Nov 2005 07:01:47 -0000 1.5 --- LIFONumberScavenger.cs 1 Mar 2006 01:38:50 -0000 1.6 *************** *** 20,24 **** public void Scavenge(ICache cache) { ! CacheItem[] entries = cache.Entries; for(int i = entries.Length; i>= _num; i--) --- 20,24 ---- public void Scavenge(ICache cache) { ! ICacheItem[] entries = cache.Entries; for(int i = entries.Length; i>= _num; i--) |
From: Sean M. <int...@us...> - 2006-03-01 01:38:56
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Data/Xml Modified Files: ProviderInfo.xml Log Message: Index: ProviderInfo.xml =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderInfo.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ProviderInfo.xml 16 Nov 2005 07:01:48 -0000 1.11 --- ProviderInfo.xml 1 Mar 2006 01:38:51 -0000 1.12 *************** *** 817,1039 **** </Type> </ProviderInfo> ! <ProviderInfo Name="dbtype_oledb"> ! <Type> ! <Id>1</Id> ! <Name>AnsiString</Name> ! <Object>AnsiString</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>""</Default> ! <TestDefault>"test"</TestDefault> ! </Type> ! <Type> ! <Id>2</Id> ! <Name>AnsiStringFixedLength</Name> ! <Object>AnsiStringFixedLength</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>""</Default> ! <TestDefault>"test"</TestDefault> ! </Type> ! <Type> ! <Id>3</Id> ! <Name>Binary</Name> ! <Object>Byte[]</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>null</Default> ! <TestDefault>System.Text.Encoding.ASCII.GetBytes("Test String2")</TestDefault> ! </Type> ! <Type> ! <Id>4</Id> ! <Name>Boolean</Name> ! <Object>Boolean</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>false</Default> ! <TestDefault>false</TestDefault> ! </Type> ! <Type> ! <Id>5</Id> ! <Name>Byte</Name> ! <Object>Byte</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! <Type> ! <Id>6</Id> ! <Name>Currency</Name> ! <Object>Currency</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0.00</Default> ! <TestDefault>2.00</TestDefault> ! </Type> ! <Type> ! <Id>7</Id> ! <Name>Date</Name> ! <Object>Date</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>null</Default> ! <TestDefault>null</TestDefault> ! </Type> ! <Type> ! <Id>8</Id> ! <Name>DateTime</Name> ! <Object>DateTime</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>DateTime.Now</Default> ! <TestDefault>DateTime.Today</TestDefault> ! </Type> ! <Type> ! <Id>9</Id> ! <Name>Decimal</Name> ! <Object>Decimal</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0.00M</Default> ! <TestDefault>2.00M</TestDefault> ! </Type> ! <Type> ! <Id>10</Id> ! <Name>Double</Name> ! <Object>Double</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0.00</Default> ! <TestDefault>2.00</TestDefault> ! </Type> ! <Type> ! <Id>11</Id> ! <Name>Guid</Name> ! <Object>Guid</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>Guid.NewGuid()</Default> ! <TestDefault>Guid.NewGuid()</TestDefault> ! </Type> ! <Type> ! <Id>12</Id> ! <Name>Int16</Name> ! <Object>Int16</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>2</TestDefault> ! </Type> ! <Type> ! <Id>13</Id> ! <Name>Int32</Name> ! <Object>Int32</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>2</TestDefault> ! </Type> ! <Type> ! <Id>14</Id> ! <Name>Int64</Name> ! <Object>Int64</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>123456</TestDefault> ! </Type> ! <Type> ! <Id>15</Id> ! <Name>Object</Name> ! <Object>Object</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>null</Default> ! <TestDefault>null</TestDefault> ! </Type> ! <Type> ! <Id>16</Id> ! <Name>SByte</Name> ! <Object>SByte</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! <Type> ! <Id>17</Id> ! <Name>Single</Name> ! <Object>Single</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! <Type> ! <Id>18</Id> ! <Name>String</Name> ! <Object>string</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>""</Default> ! <TestDefault>"test"</TestDefault> ! </Type> ! <Type> ! <Id>19</Id> ! <Name>StringFixedLength</Name> ! <Object>StringFixedLength</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>""</Default> ! <TestDefault>"test"</TestDefault> ! </Type> ! <Type> ! <Id>20</Id> ! <Name>Time</Name> ! <Object>Time</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>null</Default> ! <TestDefault>null</TestDefault> ! </Type> ! <Type> ! <Id>21</Id> ! <Name>UInt16</Name> ! <Object>UInt16</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! <Type> ! <Id>22</Id> ! <Name>UInt32</Name> ! <Object>UInt32</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! <Type> ! <Id>23</Id> ! <Name>UInt64</Name> ! <Object>UInt64</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! <Type> ! <Id>24</Id> ! <Name>VarNumeric</Name> ! <Object>VarNumeric</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! </ProviderInfo> ! <ProviderInfo Name="dbtype_sqlserver"> <Type> <Id>1</Id> --- 817,821 ---- </Type> </ProviderInfo> ! <ProviderInfo Name="dbtype"> <Type> <Id>1</Id> |
From: Sean M. <int...@us...> - 2006-03-01 01:38:55
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev Modified Files: Adapdev.csproj Util.cs Log Message: Index: Util.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/Util.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Util.cs 26 Nov 2005 08:09:23 -0000 1.6 --- Util.cs 1 Mar 2006 01:38:51 -0000 1.7 *************** *** 42,101 **** } - public static bool AreObjectsEqual(Object o1, Object o2) - { - Type t1 = o1.GetType(); - Type t2 = o2.GetType(); - - PropertyInfo[] pi1 = t1.GetProperties(); - PropertyInfo[] pi2 = t2.GetProperties(); - - for (int i = 0; i < pi1.Length; i++) - { - try - { - PropertyInfo i1 = pi1[i]; - PropertyInfo i2 = pi2[i]; - - if (!i1.GetValue(o1, null).Equals(null) && !i2.GetValue(o2, null).Equals(null)) - { - if (!i1.GetValue(o1, null).Equals(i2.GetValue(o2, null))) - { - return false; - } - } - } - catch (Exception) - { - throw; - } - } - - FieldInfo[] fi1 = t1.GetFields(); - FieldInfo[] fi2 = t2.GetFields(); - - for (int i = 0; i < fi1.Length; i++) - { - try - { - FieldInfo i1 = fi1[i]; - FieldInfo i2 = fi2[i]; - - if (!i1.GetValue(o1).Equals(null) && !i2.GetValue(o2).Equals(null)) - { - if (!i1.GetValue(o1).Equals(i2.GetValue(o2))) - { - return false; - } - } - } - catch (Exception) - { - throw; - } - } - - return true; - } - public static bool IsNumeric(object o) { --- 42,45 ---- Index: Adapdev.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/Adapdev.csproj,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Adapdev.csproj 21 Feb 2006 04:31:18 -0000 1.19 --- Adapdev.csproj 1 Mar 2006 01:38:51 -0000 1.20 *************** *** 25,29 **** <Config Name = "Debug" ! AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" --- 25,29 ---- <Config Name = "Debug" ! AllowUnsafeBlocks = "true" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" *************** *** 191,215 **** /> <File ! RelPath = "ObjectSorter.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SortableCollectionBase.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Util.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "ValidationResult.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Attributes\SchemaDataRewritableAttribute.cs" SubType = "Code" BuildAction = "Compile" --- 191,215 ---- /> <File ! RelPath = "Util.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "ValidationResult.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Attributes\SchemaDataRewritableAttribute.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Collections\CollectionSorter.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Collections\SortableCollectionBase.cs" SubType = "Code" BuildAction = "Compile" *************** *** 236,239 **** --- 236,244 ---- /> <File + RelPath = "Cryptography\DPAPI.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Cryptography\EncryptionAlgorithm.cs" SubType = "Code" |
From: Sean M. <int...@us...> - 2006-03-01 01:38:55
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Data Modified Files: AbstractDAO.cs CommandTextViewer.cs DataReaderDebugger.cs ProviderInfoManager.cs Log Message: Index: DataReaderDebugger.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DataReaderDebugger.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DataReaderDebugger.cs 16 Nov 2005 07:01:47 -0000 1.5 --- DataReaderDebugger.cs 1 Mar 2006 01:38:50 -0000 1.6 *************** *** 10,49 **** public class DataReaderDebugger { ! private IDataReader _reader = null; ! ! public DataReaderDebugger(IDataReader reader) ! { ! this._reader = reader; ! } ! public string Text { ! get { ! StringBuilder sb = new StringBuilder(); ! do { ! int i = _reader.FieldCount; ! for(int j = 0; j < i; j++) ! { ! sb.Append(this._reader.GetName(j) + "|"); ! } ! sb.Append(Environment.NewLine); ! while(this._reader.Read()) { ! for(int j = 0; j < i; j++) ! { ! sb.Append(this._reader.GetValue(j).ToString() + "|"); ! } ! sb.Append(Environment.NewLine); } sb.Append(Environment.NewLine); } ! while(this._reader.NextResult()); ! ! return sb.ToString(); } } } --- 10,41 ---- public class DataReaderDebugger { ! private DataReaderDebugger(){} ! public static string ToString(IDataReader reader) { ! StringBuilder sb = new StringBuilder(); ! do { ! int i = reader.FieldCount; ! for(int j = 0; j < i; j++) { ! sb.Append(reader.GetName(j) + "|"); ! } ! sb.Append(Environment.NewLine); ! while(reader.Read()) ! { ! for(int j = 0; j < i; j++) { ! sb.Append(reader.GetValue(j).ToString() + "|"); } sb.Append(Environment.NewLine); } ! sb.Append(Environment.NewLine); } + while(reader.NextResult()); + + return sb.ToString(); } } Index: ProviderInfoManager.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/ProviderInfoManager.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ProviderInfoManager.cs 16 Nov 2005 07:01:47 -0000 1.6 --- ProviderInfoManager.cs 1 Mar 2006 01:38:50 -0000 1.7 *************** *** 68,99 **** /// Gets the prefix by name /// </summary> - /// <param name="name">Name.</param> - /// <param name="typeName">Name of the type.</param> - /// <returns></returns> - public string GetPrefixByName(string name, string typeName) - { - return this.GetTypeRowByName(name, typeName).Prefix; - } - - /// <summary> - /// Gets the prefix by name - /// </summary> - /// <param name="ct">Ct.</param> - /// <param name="typeName">Name of the type.</param> - /// <returns></returns> - public string GetPrefixByName(DbProviderType ct, string typeName) - { - return this.GetPrefixByName(ct.ToString(), typeName); - } - - /// <summary> - /// Gets the postfix by name - /// </summary> - /// <param name="name">Name.</param> /// <param name="typeName">Name of the type.</param> /// <returns></returns> ! public string GetPostfixByName(string name, string typeName) { ! return this.GetTypeRowByName(name, typeName).Postfix; } --- 68,76 ---- /// Gets the prefix by name /// </summary> /// <param name="typeName">Name of the type.</param> /// <returns></returns> ! public string GetPrefixByName(string typeName) { ! return this.GetTypeRowByName("dbtype", typeName).Prefix; } *************** *** 101,110 **** /// Gets the postfix by name /// </summary> - /// <param name="ct">Ct.</param> /// <param name="typeName">Name of the type.</param> /// <returns></returns> ! public string GetPostfixByName(DbProviderType ct, string typeName) { ! return this.GetPostfixByName(ct.ToString(), typeName); } --- 78,86 ---- /// Gets the postfix by name /// </summary> /// <param name="typeName">Name of the type.</param> /// <returns></returns> ! public string GetPostfixByName(string typeName) { ! return this.GetTypeRowByName("dbtype", typeName).Postfix; } Index: CommandTextViewer.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/CommandTextViewer.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CommandTextViewer.cs 16 Nov 2005 07:01:47 -0000 1.6 --- CommandTextViewer.cs 1 Mar 2006 01:38:50 -0000 1.7 *************** *** 63,67 **** string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName("dbtype_oledb", ptype); string newValue = prefix + pvalue + prefix; // Console.WriteLine(newValue); --- 63,67 ---- string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName(ptype); string newValue = prefix + pvalue + prefix; // Console.WriteLine(newValue); *************** *** 95,99 **** string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName("dbtype_oledb", ptype); string newValue = prefix + pvalue + prefix; string comma = ","; --- 95,99 ---- string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName(ptype); string newValue = prefix + pvalue + prefix; string comma = ","; *************** *** 139,143 **** string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName("dbtype_sqlclient", ptype); string newValue = prefix + pvalue + prefix; --- 139,143 ---- string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName(ptype); string newValue = prefix + pvalue + prefix; *************** *** 165,169 **** string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName("dbtype_sqlclient", ptype); string newValue = prefix + pvalue + prefix; string comma = ","; --- 165,169 ---- string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName(ptype); string newValue = prefix + pvalue + prefix; string comma = ","; *************** *** 204,208 **** string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName("oracle", ptype); string newValue = prefix + pvalue + prefix; --- 204,208 ---- string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName(ptype); string newValue = prefix + pvalue + prefix; *************** *** 226,230 **** string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName("oracle", ptype); string newValue = prefix + pvalue + prefix; string comma = ","; --- 226,230 ---- string ptype = ((IDataParameter) cmd.Parameters[i]).DbType.ToString(); ! string prefix = dp.GetPrefixByName(ptype); string newValue = prefix + pvalue + prefix; string comma = ","; Index: AbstractDAO.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/AbstractDAO.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbstractDAO.cs 26 Nov 2005 08:09:22 -0000 1.8 --- AbstractDAO.cs 1 Mar 2006 01:38:50 -0000 1.9 *************** *** 527,530 **** --- 527,531 ---- /// </summary> /// <returns></returns> + [Obsolete("Use SelectAllDataSet")] public DataSet SelectAllDS() { *************** *** 533,536 **** --- 534,546 ---- /// <summary> + /// Selects all data set. + /// </summary> + /// <returns></returns> + public DataSet SelectAllDataSet() + { + return this.CreateDataSet(this.CreateSelectAllCommand()); + } + + /// <summary> /// Selects all records /// </summary> |
From: Sean M. <int...@us...> - 2006-03-01 01:38:55
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Cryptography In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Tests/Cryptography Modified Files: CryptoTest.cs Log Message: Index: CryptoTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Cryptography/CryptoTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CryptoTest.cs 21 Feb 2006 04:31:17 -0000 1.5 --- CryptoTest.cs 1 Mar 2006 01:38:51 -0000 1.6 *************** *** 24,27 **** --- 24,63 ---- [Test] + public void EncryptDecryptDPAPI() + { + try + { + string text = "Hello, world!"; + string entropy = null; + string description; + + Console.WriteLine("Plaintext: {0}\r\n", text); + + // Call DPAPI to encrypt data with user-specific key. + string encrypted = DPAPI.Encrypt( DPAPI.KeyType.UserKey, + text, + entropy, + "My Data"); + Console.WriteLine("Encrypted: {0}\r\n", encrypted); + + // Call DPAPI to decrypt data. + string decrypted = DPAPI.Decrypt( encrypted, + entropy, + out description); + Console.WriteLine("Decrypted: {0} <<<{1}>>>\r\n", + decrypted, description); + } + catch (Exception ex) + { + while (ex != null) + { + Console.WriteLine(ex.Message); + ex = ex.InnerException; + } + } + + } + + [Test] public void EncryptDecryptDes() { |
From: Sean M. <int...@us...> - 2006-03-01 01:38:54
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Tests Modified Files: Adapdev.Tests.csproj CollectionSorterTest.cs Log Message: Index: CollectionSorterTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/CollectionSorterTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CollectionSorterTest.cs 21 Feb 2006 04:31:17 -0000 1.1 --- CollectionSorterTest.cs 1 Mar 2006 01:38:51 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- using System.Collections; using Adapdev; + using Adapdev.Collections; using NUnit.Framework; *************** *** 88,131 **** } } - - public class Person - { - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } - - public int Age - { - get - { - return _age; - } - set - { - _age = value; - } - } - - public Person(string name, int age) - { - _name = name; - _age = age; - } - - public override string ToString() - { - return Name + ", " + Age; - } - protected string _name; - protected int _age; - } } --- 89,92 ---- Index: Adapdev.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Adapdev.Tests.csproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Adapdev.Tests.csproj 21 Feb 2006 04:31:17 -0000 1.9 --- Adapdev.Tests.csproj 1 Mar 2006 01:38:51 -0000 1.10 *************** *** 106,109 **** --- 106,114 ---- /> <File + RelPath = "CollectionSorterTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "CompositeValidatorTest.cs" SubType = "Code" *************** *** 121,124 **** --- 126,139 ---- /> <File + RelPath = "Person.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "SortableCollectionBaseTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Cryptography\CryptoTest.cs" SubType = "Code" *************** *** 141,144 **** --- 156,169 ---- /> <File + RelPath = "IO\FileUtilTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "IO\FileWatcherTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Reflection\ClassAccessorCacheTest.cs" SubType = "Code" |
From: Sean M. <int...@us...> - 2006-03-01 01:38:54
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests/CategoriesExample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Data.Tests/CategoriesExample Modified Files: CategoriesDAOBase.cs Log Message: Index: CategoriesDAOBase.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests/CategoriesExample/CategoriesDAOBase.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CategoriesDAOBase.cs 16 Nov 2005 07:01:47 -0000 1.5 --- CategoriesDAOBase.cs 1 Mar 2006 01:38:50 -0000 1.6 *************** *** 216,221 **** protected override void CustomSave(object o, IDbConnection connection){ ! string query = QueryHelper.GetSqlServerLastInsertedScopeCommand(); ! //string query = QueryHelper.GetSqlServerLastInsertedCommand(CategoriesDAO.TABLE_NAME); IDbCommand cmd = DbProviderFactory.CreateCommand(DbConstants.DatabaseProviderType); cmd.CommandText = query; --- 216,221 ---- protected override void CustomSave(object o, IDbConnection connection){ ! //string query = QueryHelper.GetSqlServerLastInsertedScopeCommand(); ! string query = QueryHelper.GetSqlServerLastInsertedCommand(CategoriesDAO.TABLE_NAME); IDbCommand cmd = DbProviderFactory.CreateCommand(DbConstants.DatabaseProviderType); cmd.CommandText = query; |
From: Sean M. <int...@us...> - 2006-03-01 01:38:54
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6213/src/Adapdev.Data.Tests Modified Files: Adapdev.Data.Tests.csproj Log Message: Index: Adapdev.Data.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests/Adapdev.Data.Tests.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Adapdev.Data.Tests.csproj 30 Dec 2005 20:42:10 -0000 1.15 --- Adapdev.Data.Tests.csproj 1 Mar 2006 01:38:50 -0000 1.16 *************** *** 100,103 **** --- 100,108 ---- HintPath = "..\..\lib\nunit.framework.dll" /> + <Reference + Name = "System.Data.OracleClient" + AssemblyName = "System.Data.OracleClient" + HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.OracleClient.dll" + /> </References> </Build> *************** *** 116,128 **** /> <File ! RelPath = "ProviderInfoManagerTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SchemaBuilderTest.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CategoriesExample\CategoriesDAO.cs" --- 121,139 ---- /> <File ! RelPath = "CommandTextViewerTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "ConnectionStringBuilderTest.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "ProviderInfoManagerTest.cs" SubType = "Code" BuildAction = "Compile" /> + <Folder RelPath = "bin\Debug\" /> <File RelPath = "CategoriesExample\CategoriesDAO.cs" *************** *** 181,184 **** --- 192,200 ---- /> <File + RelPath = "Schema\SchemaBuilderTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Sql\SelectQueryTest.cs" SubType = "Code" |
From: Sean M. <int...@us...> - 2006-02-21 04:31:30
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9122/src/Adapdev.UnitTest.Core Modified Files: TestRunner.cs TestSuiteBuilder.cs Log Message: Index: TestSuiteBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestSuiteBuilder.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TestSuiteBuilder.cs 8 Feb 2006 03:00:00 -0000 1.17 --- TestSuiteBuilder.cs 21 Feb 2006 04:31:18 -0000 1.18 *************** *** 1,4 **** --- 1,5 ---- using System.Collections.Specialized; using System.Diagnostics; + using Adapdev.Reflection; #region Copyright / License Information Index: TestRunner.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestRunner.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestRunner.cs 23 Nov 2005 03:00:42 -0000 1.13 --- TestRunner.cs 21 Feb 2006 04:31:18 -0000 1.14 *************** *** 1,2 **** --- 1,4 ---- + using Adapdev.Reflection; + #region Copyright / License Information |
From: Sean M. <int...@us...> - 2006-02-21 04:31:30
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9122/src/Adapdev.Tests Modified Files: Adapdev.Tests.csproj ObjectComparerTest.cs Added Files: CollectionSorterTest.cs Log Message: --- NEW FILE: CollectionSorterTest.cs --- using System; using System.Collections; using Adapdev; using NUnit.Framework; namespace Adapdev.Tests { [TestFixture] public class CollectionSorterTest { [Test] public void SortArrayByAge() { Person[] personArray = this.GetPersonArray(); Assert.AreEqual("Johnny", personArray[1].Name); Array.Sort(personArray, new CollectionSorter("Age")); Assert.AreEqual("Joey", personArray[1].Name); } [Test] public void SortArrayListByAge() { ArrayList personArray = this.GetPersonArrayList(); Assert.AreEqual("Johnny", (personArray[1] as Person).Name); personArray.Sort(new CollectionSorter("Age")); Assert.AreEqual("Joey", (personArray[1] as Person).Name); Assert.AreEqual(25, (personArray[1] as Person).Age); } [Test] public void SortArrayByNameAndAge() { Person[] personArray = this.GetPersonArray(); Assert.AreEqual("Johnny", personArray[1].Name); Array.Sort(personArray, new CollectionSorter("Name","Age")); Assert.AreEqual("C.J.", personArray[0].Name); Assert.AreEqual("Joey", personArray[2].Name); Assert.AreEqual(21, personArray[2].Age); Assert.AreEqual("Joey", personArray[3].Name); Assert.AreEqual(25, personArray[3].Age); } [Test] public void SortArrayByNameAndAgeDESC() { Person[] personArray = this.GetPersonArray(); Assert.AreEqual("Johnny", personArray[1].Name); Array.Sort(personArray, new CollectionSorter( new string[]{"Name","Age"}, new bool[]{false,true} )); Assert.AreEqual("C.J.", personArray[0].Name); Assert.AreEqual("Joey", personArray[2].Name); Assert.AreEqual(25, personArray[2].Age); Assert.AreEqual("Joey", personArray[3].Name); Assert.AreEqual(21, personArray[3].Age); } private Person[] GetPersonArray() { Person[] personArray = new Person[] { new Person("Joey", 21), new Person("Johnny", 30), new Person("Marky", 28), new Person("C.J.", 28), new Person("Joey", 25), new Person("Dee Dee", 33) }; return personArray; } private ArrayList GetPersonArrayList() { ArrayList personArray = new ArrayList(); personArray.Add(new Person("Joey", 21)); personArray.Add(new Person("Johnny", 30)); personArray.Add(new Person("Marky", 28)); personArray.Add(new Person("C.J.", 28)); personArray.Add(new Person("Joey", 25)); personArray.Add(new Person("Dee Dee", 33)); return personArray; } } public class Person { public string Name { get { return _name; } set { _name = value; } } public int Age { get { return _age; } set { _age = value; } } public Person(string name, int age) { _name = name; _age = age; } public override string ToString() { return Name + ", " + Age; } protected string _name; protected int _age; } } Index: ObjectComparerTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/ObjectComparerTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ObjectComparerTest.cs 26 Nov 2005 09:09:00 -0000 1.6 --- ObjectComparerTest.cs 21 Feb 2006 04:31:17 -0000 1.7 *************** *** 3,6 **** --- 3,7 ---- using System.Threading; using Adapdev.Mock; + using Adapdev.Reflection; using Adapdev.Serialization; using NUnit.Framework; *************** *** 16,20 **** { [Test] ! public void AreEqual() { DateTime now = DateTime.Now; --- 17,21 ---- { [Test] ! public void AreBytesEqual() { DateTime now = DateTime.Now; *************** *** 31,44 **** // Uses ISerializable comparison ! Assert.IsTrue(ObjectComparer.AreEqual(e1, e2), "Objects should be equal."); e2.Created = DateTime.Now.AddHours(1); ! Assert.IsFalse(ObjectComparer.AreEqual(e1, e2), "Objects should not be equal."); } [Test] ! public void FailAreEqualWithFields() { DateTime now = DateTime.Now; --- 32,112 ---- // Uses ISerializable comparison ! Assert.IsTrue(ObjectComparer.AreBytesEqual(e1, e2), "Objects should be equal."); e2.Created = DateTime.Now.AddHours(1); ! Assert.IsFalse(ObjectComparer.AreBytesEqual(e1, e2), "Objects should not be equal."); } [Test] ! public void ArePropertiesEqual() ! { ! DateTime now = DateTime.Now; ! ! SuppliersEntity e1 = new SuppliersEntity(); ! e1.Address = "Test"; ! e1.SupplierID = 12; ! e1.Created = now; ! ! SuppliersEntity e2 = new SuppliersEntity(); ! e2.Address = "Test"; ! e2.SupplierID = 12; ! e2.Created = now; ! ! // Uses ISerializable comparison ! Assert.IsTrue(ObjectComparer.ArePropertiesEqual(e1, e2), "Objects should be equal."); ! ! e2.Created = DateTime.Now.AddHours(1); ! ! Assert.IsFalse(ObjectComparer.ArePropertiesEqual(e1, e2), "Objects should not be equal."); ! ! } ! ! [Test] ! public void AreFieldsEqual() ! { ! DateTime now = DateTime.Now; ! ! SuppliersEntity e1 = new SuppliersEntity(); ! e1.Address = "Test"; ! e1.SupplierID = 12; ! e1.Created = now; ! ! SuppliersEntity e2 = new SuppliersEntity(); ! e2.Address = "Test"; ! e2.SupplierID = 12; ! e2.Created = now; ! ! Assert.IsTrue(ObjectComparer.AreFieldsEqual(e1, e2), "Objects should be equal."); ! ! ClassAccessor c = ClassAccessorCache.Get(e2); ! c.SetValue(e2, "_Created", DateTime.Now.AddHours(1)); ! ! Assert.IsFalse(ObjectComparer.AreFieldsEqual(e1, e2), "Objects should not be equal."); ! ! } ! ! ! [Test] ! public void FailDefaultEquals() ! { ! DateTime now = DateTime.Now; ! ! SuppliersEntity e1 = new SuppliersEntity(); ! e1.Address = "Test"; ! e1.SupplierID = 12; ! e1.Created = now; ! ! SuppliersEntity e2 = new SuppliersEntity(); ! e2.Address = "Test"; ! e2.SupplierID = 12; ! e2.Created = now; ! ! Assert.IsFalse(e1.Equals(e2)); ! } ! ! [Test] ! public void FailAreEqual() { DateTime now = DateTime.Now; *************** *** 59,63 **** //Console.WriteLine(e2); ! Assert.IsFalse(ObjectComparer.AreEqual(e1, e2, true), "Objects should not be equal because InternalCreated is different."); } } --- 127,131 ---- //Console.WriteLine(e2); ! Assert.IsFalse(ObjectComparer.AreEqual(e1, e2), "Objects should not be equal because InternalCreated is different."); } } Index: Adapdev.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Adapdev.Tests.csproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Adapdev.Tests.csproj 16 Nov 2005 07:01:52 -0000 1.8 --- Adapdev.Tests.csproj 21 Feb 2006 04:31:17 -0000 1.9 *************** *** 126,129 **** --- 126,134 ---- /> <File + RelPath = "Cryptography\HasherTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Diagnostics\CPUMeterTest.cs" SubType = "Code" *************** *** 166,169 **** --- 171,179 ---- /> <File + RelPath = "Serialization\SerializerTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Text\Indexing\FullTextSearchTests.cs" SubType = "Code" |
From: Sean M. <int...@us...> - 2006-02-21 04:31:30
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/XPath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9122/src/Adapdev.Tests/XPath Modified Files: XPathObjectNavigatorTest.cs Log Message: Index: XPathObjectNavigatorTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/XPath/XPathObjectNavigatorTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** XPathObjectNavigatorTest.cs 26 Nov 2005 08:27:35 -0000 1.5 --- XPathObjectNavigatorTest.cs 21 Feb 2006 04:31:17 -0000 1.6 *************** *** 41,44 **** --- 41,148 ---- namespace Adapdev.XPath.Tests { + /// <summary> + /// Summary description for Class1. + /// </summary> + [TestFixture] + public class XPathObjectNavigatorTest + { + [Test] + public void TestSimpleProperties() + { + Address address = new Address("Al. Calder�o Branco", 784); + Customer customer = new Customer("Rodrigo", "Oliveira", address); + + XPathObjectNavigator context = new XPathObjectNavigator(customer); + XPathNodeIterator i = context.Select("/Customer/Address/Street"); + Assert.AreEqual(1, i.Count); + Assert.AreEqual(true, i.MoveNext()); + Assert.AreEqual(customer.Address.Street, i.Current.Value); + Assert.AreEqual(customer.Address.Street, ((XPathObjectNavigator)i.Current).Node); + + i = context.Select("FirstName"); + Assert.AreEqual(1, i.Count); + Assert.AreEqual(true, i.MoveNext()); + Assert.AreEqual(customer.FirstName, i.Current.Value); + + i = context.Select("/Customer/LastName"); + Assert.AreEqual(true, i.MoveNext()); + Assert.AreEqual(customer.LastName, i.Current.Value); + } + + [Test] + public void TestIListProperties() + { + Product p1 = new Product("egg"); + Product p2 = new Product("Monty Python Flying Circus Box"); + p2.Categories.Add("Silly Stuff"); + + Customer c1 = new Customer("Rodrigo", "Oliveira", new Address("Al. Ribeir�o Preto", 487)); + Customer c2 = new Customer("Marcia", "Longo", new Address("Al. Ribeir�o Preto", 487)); + + Order o1 = new Order(c1); + o1.Add(new OrderItem(p1, 10)); + o1.Add(new OrderItem(p2, 1)); + + Order o2 = new Order(c2); + o2.Add(new OrderItem(p1, 15)); + o2.Add(new OrderItem(p2, 1)); + + Order[] orders = new Order[] { o1, o2 }; + XPathObjectNavigator navigator = new XPathObjectNavigator(orders, "Orders"); + Assert.AreEqual(2, navigator.Select("//Order").Count); + Assert.AreEqual(2, navigator.Select("Order").Count); + Assert.AreEqual(o1, navigator.SelectObject("Order[1]")); + Assert.AreEqual(o2, navigator.SelectObject("Order[2]")); + + Assert.AreEqual(o1, navigator.SelectObject("//Order[Customer/FirstName='Rodrigo']")); + Assert.AreEqual(o2, navigator.SelectObject("//Order[Customer/LastName='Longo']")); + + XPathNodeIterator i = navigator.Select("//Product[Name='egg']"); + Assert.AreEqual(2, i.Count); + Assert.AreEqual(true, i.MoveNext()); + Assert.AreEqual(p1, ((XPathObjectNavigator)i.Current).Node); + + Assert.AreEqual(o2.Items[0], navigator.SelectObject("//OrderItem[Quantity>10]")); + Assert.AreEqual(p2, navigator.SelectObject("//Product[Categories/String='Silly Stuff']")); + } + + [Test] + public void TestIDictionaryProperties() + { + Customer customer = new Customer("Rodrigo", "Oliveira", new Address("Penny Lane", 64)); + customer.Properties["email"] = "rod...@us..."; + + XPathObjectNavigator navigator = new XPathObjectNavigator(customer); + Assert.AreEqual(customer.Properties["email"], navigator.SelectObject("Properties/email")); + } + + [Test] + public void TestSelectObjects() + { + Address address = new Address("Strawberry Street", 45); + Customer customer1 = new Customer("Rodrigo", "Oliveira", address); + Customer customer2 = new Customer("Marcia", "Longo", address); + + Customer[] customers = { customer1, customer2 }; + XPathObjectNavigator navigator = new XPathObjectNavigator(customers); + object[] actual = navigator.SelectObjects("Customer[Address/Number = 45]"); + Assert.AreEqual(2, actual.Length); + Assert.AreEqual(customer1, actual[0]); + Assert.AreEqual(customer2, actual[1]); + } + + [Test] + public void TestSelectByField() + { + Customer customer1 = new Customer("Rodrigo", "Oliveira", new Address("al. Calder�o Branco", 45)); + customer1.Email = "rb...@ac..."; + + XPathObjectNavigator navigator = new XPathObjectNavigator(customer1); + Assert.AreSame(customer1.Email, navigator.SelectObject("Email")); + + Assert.AreSame(customer1, navigator.SelectObject("/Customer[Email='rb...@ac...']")); + } + } + public class Address { *************** *** 215,320 **** } - /// <summary> - /// Summary description for Class1. - /// </summary> - [TestFixture] - public class XPathObjectNavigatorTest - { - [Test] - public void TestSimpleProperties() - { - Address address = new Address("Al. Calder�o Branco", 784); - Customer customer = new Customer("Rodrigo", "Oliveira", address); - - XPathObjectNavigator context = new XPathObjectNavigator(customer); - XPathNodeIterator i = context.Select("/Customer/Address/Street"); - Assert.AreEqual(1, i.Count); - Assert.AreEqual(true, i.MoveNext()); - Assert.AreEqual(customer.Address.Street, i.Current.Value); - Assert.AreEqual(customer.Address.Street, ((XPathObjectNavigator)i.Current).Node); - - i = context.Select("FirstName"); - Assert.AreEqual(1, i.Count); - Assert.AreEqual(true, i.MoveNext()); - Assert.AreEqual(customer.FirstName, i.Current.Value); - - i = context.Select("/Customer/LastName"); - Assert.AreEqual(true, i.MoveNext()); - Assert.AreEqual(customer.LastName, i.Current.Value); - } - - [Test] - public void TestIListProperties() - { - Product p1 = new Product("egg"); - Product p2 = new Product("Monty Python Flying Circus Box"); - p2.Categories.Add("Silly Stuff"); - - Customer c1 = new Customer("Rodrigo", "Oliveira", new Address("Al. Ribeir�o Preto", 487)); - Customer c2 = new Customer("Marcia", "Longo", new Address("Al. Ribeir�o Preto", 487)); - - Order o1 = new Order(c1); - o1.Add(new OrderItem(p1, 10)); - o1.Add(new OrderItem(p2, 1)); - - Order o2 = new Order(c2); - o2.Add(new OrderItem(p1, 15)); - o2.Add(new OrderItem(p2, 1)); - - Order[] orders = new Order[] { o1, o2 }; - XPathObjectNavigator navigator = new XPathObjectNavigator(orders, "Orders"); - Assert.AreEqual(2, navigator.Select("//Order").Count); - Assert.AreEqual(2, navigator.Select("Order").Count); - Assert.AreEqual(o1, navigator.SelectObject("Order[1]")); - Assert.AreEqual(o2, navigator.SelectObject("Order[2]")); - - Assert.AreEqual(o1, navigator.SelectObject("//Order[Customer/FirstName='Rodrigo']")); - Assert.AreEqual(o2, navigator.SelectObject("//Order[Customer/LastName='Longo']")); - - XPathNodeIterator i = navigator.Select("//Product[Name='egg']"); - Assert.AreEqual(2, i.Count); - Assert.AreEqual(true, i.MoveNext()); - Assert.AreEqual(p1, ((XPathObjectNavigator)i.Current).Node); - - Assert.AreEqual(o2.Items[0], navigator.SelectObject("//OrderItem[Quantity>10]")); - Assert.AreEqual(p2, navigator.SelectObject("//Product[Categories/String='Silly Stuff']")); - } - - [Test] - public void TestIDictionaryProperties() - { - Customer customer = new Customer("Rodrigo", "Oliveira", new Address("Penny Lane", 64)); - customer.Properties["email"] = "rod...@us..."; - - XPathObjectNavigator navigator = new XPathObjectNavigator(customer); - Assert.AreEqual(customer.Properties["email"], navigator.SelectObject("Properties/email")); - } - - [Test] - public void TestSelectObjects() - { - Address address = new Address("Strawberry Street", 45); - Customer customer1 = new Customer("Rodrigo", "Oliveira", address); - Customer customer2 = new Customer("Marcia", "Longo", address); - - Customer[] customers = { customer1, customer2 }; - XPathObjectNavigator navigator = new XPathObjectNavigator(customers); - object[] actual = navigator.SelectObjects("Customer[Address/Number = 45]"); - Assert.AreEqual(2, actual.Length); - Assert.AreEqual(customer1, actual[0]); - Assert.AreEqual(customer2, actual[1]); - } - - [Test] - public void TestSelectByField() - { - Customer customer1 = new Customer("Rodrigo", "Oliveira", new Address("al. Calder�o Branco", 45)); - customer1.Email = "rb...@ac..."; - - XPathObjectNavigator navigator = new XPathObjectNavigator(customer1); - Assert.AreSame(customer1.Email, navigator.SelectObject("Email")); - - Assert.AreSame(customer1, navigator.SelectObject("/Customer[Email='rb...@ac...']")); - } - } } --- 319,321 ---- |
From: Sean M. <int...@us...> - 2006-02-21 04:31:29
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Reflection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9122/src/Adapdev.Tests/Reflection Modified Files: ClassAccessorTest.cs Log Message: Index: ClassAccessorTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Reflection/ClassAccessorTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClassAccessorTest.cs 19 Feb 2006 06:13:55 -0000 1.4 --- ClassAccessorTest.cs 21 Feb 2006 04:31:17 -0000 1.5 *************** *** 119,128 **** --- 119,158 ---- FieldAccessorTestObject o = new FieldAccessorTestObject(); ClassAccessor c = new ClassAccessor(o); + Console.WriteLine(c.Created.ToString()); c.LoadAllPropertiesAndFields(); Console.WriteLine(c); Assert.AreEqual(36, c.TotalCount, "Should have loaded 36 total."); + Assert.AreEqual(19, c.FieldCount, "Should have loaded 19 fields."); + Assert.AreEqual(15, c.PropertyCount, "Should have loaded 15 properties."); + + } + + [Test] + public void GetPropertyInfo() + { + PropertyAccessorTestObject o = new PropertyAccessorTestObject(); + ClassAccessor c = new ClassAccessor(o); + c.LoadAllProperties(); + + PropertyAccessor p = c.GetPropertyAccessor("Int"); + Assert.IsTrue(p.CanRead); + Assert.IsTrue(p.CanWrite); + Assert.AreEqual(typeof(PropertyAccessorTestObject), p.TargetType); + Assert.AreEqual(typeof(Int32), p.PropertyType); } + [Test] + public void GetFieldInfo() + { + FieldAccessorTestObject o = new FieldAccessorTestObject(); + ClassAccessor c = new ClassAccessor(o); + c.LoadAllFields(); + + FieldAccessor f = c.GetFieldAccessor("mInt"); + Assert.AreEqual(typeof(FieldAccessorTestObject), f.TargetType); + Assert.AreEqual(typeof(Int32), f.FieldType); + + } } |
From: Sean M. <int...@us...> - 2006-02-21 04:31:29
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9122/src/Adapdev Modified Files: Adapdev.csproj AppDomainManager.cs ObjectComparer.cs Added Files: CollectionSorter.cs Log Message: --- NEW FILE: CollectionSorter.cs --- // Original Copyright (c) 2003 Diego Mijelshon. http://www.codeproject.com/csharp/objectcomparer.asp #region Modified Copyright / License Information /* Copyright 2004 - 2005 Adapdev Technologies, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ============================ Author Log ============================ III Full Name SMM Sean McCormack (Adapdev) ============================ Change Log ============================ III MMDDYY Change */ #endregion using System; using System.Collections; using System.Reflection; namespace Adapdev { [Serializable] public class CollectionSorter : IComparer { #region methods /// <summary> /// Compares two objects and returns a value indicating whether one is less than, equal to or greater than the other. /// </summary> /// <param name="x">First object to compare.</param> /// <param name="y">Second object to compare.</param> /// <returns></returns> public int Compare(object x, object y) { //Get types of the objects Type typex = x.GetType(); Type typey = y.GetType(); for(int i = 0; i<Fields.Length; i++) { //Get each property by name PropertyInfo pix = typex.GetProperty(Fields[i]); PropertyInfo piy = typey.GetProperty(Fields[i]); //Get the value of the property for each object IComparable pvalx = (IComparable)pix.GetValue(x, null); object pvaly = piy.GetValue(y, null); //Compare values, using IComparable interface of the property's type int iResult = pvalx.CompareTo(pvaly); if (iResult != 0) { //Return if not equal if (Descending[i]) { //Invert order return -iResult; } else { return iResult; } } } //Objects have the same sort order return 0; } #endregion #region constructors /// <summary> /// Create a comparer for objects of arbitrary types having using the specified properties /// </summary> /// <param name="fields">Properties to sort objects by</param> public CollectionSorter(params string[] fields) : this(fields, new bool[fields.Length]) {} /// <summary> /// Create a comparer for objects of arbitrary types having using the specified properties and sort order /// </summary> /// <param name="fields">Properties to sort objects by</param> /// <param name="descending">Properties to sort in descending order</param> public CollectionSorter(string[] fields, bool[] descending) { Fields = fields; Descending = descending; } #endregion #region protected fields /// <summary> /// Properties to sort objects by /// </summary> protected string[] Fields; /// <summary> /// Properties to sort in descending order /// </summary> protected bool[] Descending; #endregion } } Index: AppDomainManager.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/AppDomainManager.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AppDomainManager.cs 16 Nov 2005 07:02:01 -0000 1.7 --- AppDomainManager.cs 21 Feb 2006 04:31:18 -0000 1.8 *************** *** 36,39 **** --- 36,40 ---- using System.Security.Permissions; using System.Security.Policy; + using Adapdev.Reflection; using SecurityPermission = System.Security.Permissions.SecurityPermission; Index: Adapdev.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/Adapdev.csproj,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Adapdev.csproj 8 Feb 2006 03:00:00 -0000 1.18 --- Adapdev.csproj 21 Feb 2006 04:31:18 -0000 1.19 *************** *** 121,129 **** /> <File - RelPath = "AssemblyCache.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "AssemblyInfo.cs" SubType = "Code" --- 121,124 ---- *************** *** 316,319 **** --- 311,319 ---- /> <File + RelPath = "Reflection\AssemblyCache.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Reflection\ClassAccessor.cs" SubType = "Code" *************** *** 351,359 **** /> <File - RelPath = "Reflection\ReflectionCache.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Scheduling\Task\ScheduledTasks.cs" SubType = "Code" --- 351,354 ---- Index: ObjectComparer.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/ObjectComparer.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ObjectComparer.cs 26 Nov 2005 08:51:25 -0000 1.10 --- ObjectComparer.cs 21 Feb 2006 04:31:18 -0000 1.11 *************** *** 16,30 **** } ! public static bool AreEqual(ISerializable x, ISerializable y) { return AreBytesEqual(Serializer.SerializeToBinary(x), Serializer.SerializeToBinary(y)); } ! public static bool AreEqual(object x, object y) ! { ! return AreEqual(x, y, false); ! } ! ! public static bool AreEqual(object x, object y, bool includeFields) { Type t = x.GetType(); --- 16,38 ---- } ! /// <summary> ! /// Does a binary comparison of the objects. ! /// </summary> ! /// <remarks>Both class must support serialization.</remarks> ! /// <param name="x">Object x.</param> ! /// <param name="y">Object y.</param> ! /// <returns></returns> ! public static bool AreBytesEqual(object x, object y) { return AreBytesEqual(Serializer.SerializeToBinary(x), Serializer.SerializeToBinary(y)); } ! /// <summary> ! /// Are the properties equal. ! /// </summary> ! /// <param name="x">Object x.</param> ! /// <param name="y">Object y.</param> ! /// <returns></returns> ! public static bool ArePropertiesEqual(object x, object y) { Type t = x.GetType(); *************** *** 45,53 **** } - if(includeFields) - { - if(!AreFieldsEqual(x, y)) return false; - } - return true; } --- 53,56 ---- *************** *** 58,70 **** } ! private static bool AreFieldsEqual(object x, object y) { ! foreach(FieldInfo field in x.GetType().GetFields()) { ! if(!(field.GetValue(x).ToString().Equals(field.GetValue(y).ToString()))) return false; } ! return true; } public static bool AreBytesEqual(byte[] a, byte[] b) { --- 61,118 ---- } ! /// <summary> ! /// Are the objects equal. Compares both fields and properties ! /// </summary> ! /// <param name="x">Object x.</param> ! /// <param name="y">Object y.</param> ! /// <returns></returns> ! public static bool AreEqual(object x, object y) { ! bool equal = false; ! equal = ObjectComparer.AreFieldsEqual(x, y); ! if(!equal) return false; ! equal = ObjectComparer.ArePropertiesEqual(x, y); ! return equal; ! } ! ! /// <summary> ! /// Are the fields equal. ! /// </summary> ! /// <param name="x">Object x.</param> ! /// <param name="y">Object y.</param> ! /// <returns></returns> ! public static bool AreFieldsEqual(object x, object y) ! { ! Type t = x.GetType(); ! ClassAccessor accessor = ClassAccessorCache.Get(t); ! try { ! object p1 = null; ! object p2 = null; ! FieldAccessor property = null; ! foreach(string key in accessor.GetFieldAccessors().Keys) ! { ! property = accessor.GetFieldAccessor(key); ! p1 = accessor.GetFieldValue(x, key); ! p2 = accessor.GetFieldValue(y, key); ! ! if(!p1.Equals(Convert.ChangeType(p2, property.FieldType))) ! return false; ! } ! ! return true; } ! catch(ArgumentException) ! { ! return false; ! } } + /// <summary> + /// Are the bytes equal. + /// </summary> + /// <param name="a">Object A</param> + /// <param name="b">Object B</param> + /// <returns></returns> public static bool AreBytesEqual(byte[] a, byte[] b) { |
From: Sean M. <int...@us...> - 2006-02-21 04:31:28
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Cryptography In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9122/src/Adapdev.Tests/Cryptography Modified Files: CryptoTest.cs Added Files: HasherTest.cs Log Message: --- NEW FILE: HasherTest.cs --- using System; using Adapdev.Cryptography; using NUnit.Framework; namespace Adapdev.Tests.Cryptography { /// <summary> /// Summary description for HasherTest. /// </summary> /// [TestFixture] public class HasherTest { private string _text = "some text"; [Test] public void DefaultHash() { string hash = Hasher.Hash(this._text); Assert.IsTrue(Hasher.IsHashEqual(this._text, hash), "Hash is incorrect."); } [Test] public void HashMD5() { Hasher.HashType hashType = Hasher.HashType.MD5; string hash = Hasher.Hash(this._text, hashType); Assert.IsTrue(Hasher.IsHashEqual(this._text, hash, hashType), "Hash is incorrect."); } [Test] public void HashSHA() { Hasher.HashType hashType = Hasher.HashType.SHA; string hash = Hasher.Hash(this._text, hashType); Assert.IsTrue(Hasher.IsHashEqual(this._text, hash, hashType), "Hash is incorrect."); } [Test] public void HashSHA256() { Hasher.HashType hashType = Hasher.HashType.SHA256; string hash = Hasher.Hash(this._text, hashType); Assert.IsTrue(Hasher.IsHashEqual(this._text, hash, hashType), "Hash is incorrect."); } [Test] public void HashSHA384() { Hasher.HashType hashType = Hasher.HashType.SHA384; string hash = Hasher.Hash(this._text, hashType); Assert.IsTrue(Hasher.IsHashEqual(this._text, hash, hashType), "Hash is incorrect."); } [Test] public void HashSHA512() { Hasher.HashType hashType = Hasher.HashType.SHA512; string hash = Hasher.Hash(this._text, hashType); Assert.IsTrue(Hasher.IsHashEqual(this._text, hash, hashType), "Hash is incorrect."); } } } Index: CryptoTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Cryptography/CryptoTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CryptoTest.cs 16 Nov 2005 07:01:52 -0000 1.4 --- CryptoTest.cs 21 Feb 2006 04:31:17 -0000 1.5 *************** *** 27,30 **** --- 27,31 ---- { this.EncryptDecrypt(this._password8, this._vector8, EncryptionAlgorithm.Des); + this.EncryptDecryptFile(this._password8, this._vector8, EncryptionAlgorithm.Des); } *************** *** 33,36 **** --- 34,38 ---- { this.EncryptDecrypt(this._password16, this._vector8, EncryptionAlgorithm.TripleDes); + this.EncryptDecryptFile(this._password16, this._vector8, EncryptionAlgorithm.TripleDes); } *************** *** 39,42 **** --- 41,45 ---- { this.EncryptDecrypt(this._password16, this._vector16, EncryptionAlgorithm.Rijndael); + this.EncryptDecryptFile(this._password16, this._vector16, EncryptionAlgorithm.Rijndael); } *************** *** 45,48 **** --- 48,52 ---- { this.EncryptDecrypt(EncryptionAlgorithm.Des); + this.EncryptDecryptFile(EncryptionAlgorithm.Des); } *************** *** 51,54 **** --- 55,59 ---- { this.EncryptDecrypt(EncryptionAlgorithm.TripleDes); + this.EncryptDecryptFile(EncryptionAlgorithm.TripleDes); } *************** *** 57,60 **** --- 62,66 ---- { this.EncryptDecrypt(EncryptionAlgorithm.Rijndael); + this.EncryptDecryptFile(EncryptionAlgorithm.Rijndael); } *************** *** 76,79 **** --- 82,102 ---- } + private void EncryptDecryptFile(string key, string vector, EncryptionAlgorithm algorithm) + { + Console.WriteLine("Processing " + algorithm.ToString()); + + // Get the encrypted value + byte[] cipherText = Crypto.EncryptToFile("encrypted.dat", this._text, key, vector, algorithm); + // Display it + //Console.WriteLine("Encrypted: " + Encoding.ASCII.GetString(cipherText)); + // Decrypt + string plainText = Crypto.DecryptFromFile("encrypted.dat", key, vector, algorithm); + // Display it + Console.WriteLine("Decrypted: " + plainText); + + // Decrypted value should be same as original + Assert.AreEqual(this._text, plainText, "Incorrect value decrypted"); + } + private void EncryptDecrypt(EncryptionAlgorithm algorithm) { *************** *** 92,95 **** --- 115,136 ---- Assert.AreEqual(this._text, plainText, "Incorrect value decrypted"); } + + private void EncryptDecryptFile(EncryptionAlgorithm algorithm) + { + Console.WriteLine("Processing " + algorithm.ToString()); + + // Get the encrypted value using the built in key and vector + byte[] cipherText = Crypto.EncryptToFile("encrypted.dat", this._text, algorithm); + // Display it + //Console.WriteLine("Encrypted: " + Encoding.ASCII.GetString(cipherText)); + // Get the decrypted value using the built in key and vector + string plainText = Crypto.DecryptFromFile("encrypted.dat", algorithm); + // Display it + Console.WriteLine("Decrypted: " + plainText); + + // Decrypted value should be same as original + Assert.AreEqual(this._text, plainText, "Incorrect value decrypted"); + } + } } |
From: Sean M. <int...@us...> - 2006-02-21 04:31:26
|
Update of /cvsroot/adapdev/Adapdev/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9122/lib Modified Files: MySql.Data.dll nunit.framework.dll Log Message: Index: MySql.Data.dll =================================================================== RCS file: /cvsroot/adapdev/Adapdev/lib/MySql.Data.dll,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvsnNR9Zj and /tmp/cvsKQTGcz differ Index: nunit.framework.dll =================================================================== RCS file: /cvsroot/adapdev/Adapdev/lib/nunit.framework.dll,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsmC5joD and /tmp/cvs90O8KT differ |
From: Sean M. <int...@us...> - 2006-02-21 04:30:27
|
Update of /cvsroot/adapdev/Adapdev/src/FullBuild/obj/Release In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8960/Release Log Message: Directory /cvsroot/adapdev/Adapdev/src/FullBuild/obj/Release added to the repository |
From: Sean M. <int...@us...> - 2006-02-19 06:17:24
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Sql/Oracle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14337/src/Adapdev.Data/Sql/Oracle Added Files: OracleCriteria.cs OracleDeleteQuery.cs OracleInsertQuery.cs OracleSelectQuery.cs OracleUpdateQuery.cs Log Message: --- NEW FILE: OracleDeleteQuery.cs --- namespace Adapdev.Data.Sql { /// <summary> /// Summary description for SqlDeleteQuery. /// </summary> public class OracleDeleteQuery : DeleteQuery { public OracleDeleteQuery() : base(DbType.ORACLE, DbProviderType.ORACLE) { } public OracleDeleteQuery(string tableName) : base(DbType.ORACLE, DbProviderType.ORACLE, tableName) { } } } --- NEW FILE: OracleCriteria.cs --- namespace Adapdev.Data.Sql { using System.Collections; using System.Text; using Adapdev.Text; /// <summary> /// Summary description for ICriteria. /// </summary> public class OracleCriteria : Criteria { public OracleCriteria() : base(DbType.ORACLE, DbProviderType.ORACLE) { } public OracleCriteria(string sql) : base(DbType.ORACLE, DbProviderType.ORACLE, sql) { } } } --- NEW FILE: OracleUpdateQuery.cs --- namespace Adapdev.Data.Sql { /// <summary> /// Summary description for UpdateQuery. /// </summary> public class OracleUpdateQuery : UpdateQuery { public OracleUpdateQuery() : base(DbType.ORACLE, DbProviderType.ORACLE) { } public OracleUpdateQuery(string tableName) : base(DbType.ORACLE, DbProviderType.ORACLE, tableName) { } } } --- NEW FILE: OracleSelectQuery.cs --- namespace Adapdev.Data.Sql { public class OracleSelectQuery : SelectQuery { public OracleSelectQuery() : base(DbType.ORACLE, DbProviderType.ORACLE) { } public OracleSelectQuery(string tableName) : base(DbType.ORACLE, DbProviderType.ORACLE, tableName) { } protected override string GetLimit() { if(this.maxRecords > 0) { return " ROWNUM <= " + this.maxRecords; } return ""; } public override string GetText() { string sql = "SELECT " + this.GetColumns() + " FROM " + this._table + this._join + this.GetCriteria(); if(this.maxRecords > 0) { if(sql.ToLower().IndexOf("where") < 1) sql+= " WHERE "; else sql += " AND "; sql += this.GetLimit(); } sql += this.GetOrderBy() + this.GetGroupBy(); return sql; } } } --- NEW FILE: OracleInsertQuery.cs --- namespace Adapdev.Data.Sql { /// <summary> /// Summary description for SqlInsertQuery. /// </summary> public class OracleInsertQuery : InsertQuery { public OracleInsertQuery() : base(DbType.ORACLE, DbProviderType.ORACLE) { } public OracleInsertQuery(string tableName) : base(DbType.ORACLE, DbProviderType.ORACLE, tableName) { } } } |
From: Sean M. <int...@us...> - 2006-02-19 06:17:24
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Sql/Access In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14337/src/Adapdev.Data/Sql/Access Added Files: AccessCriteria.cs AccessDeleteQuery.cs AccessInsertQuery.cs AccessSelectQuery.cs AccessUpdateQuery.cs Log Message: --- NEW FILE: AccessCriteria.cs --- namespace Adapdev.Data.Sql { /// <summary> /// Summary description for AccessCriteria. /// </summary> public class AccessCriteria : Criteria { public AccessCriteria() : base(DbType.ACCESS, DbProviderType.OLEDB) { } public AccessCriteria(string sql) : base(DbType.ACCESS, DbProviderType.OLEDB, sql) { } } } --- NEW FILE: AccessDeleteQuery.cs --- using System; namespace Adapdev.Data.Sql { /// <summary> /// Summary description for AccessDeleteQuery. /// </summary> public class AccessDeleteQuery : DeleteQuery { public AccessDeleteQuery():base(DbType.ACCESS, DbProviderType.OLEDB){} public AccessDeleteQuery(string table):base(DbType.ACCESS, DbProviderType.OLEDB, table){} } } --- NEW FILE: AccessUpdateQuery.cs --- using System; namespace Adapdev.Data.Sql { /// <summary> /// Summary description for AccessUpdateQuery. /// </summary> public class AccessUpdateQuery : UpdateQuery { public AccessUpdateQuery():base(DbType.ACCESS, DbProviderType.OLEDB){} public AccessUpdateQuery(string table):base(DbType.ACCESS, DbProviderType.OLEDB, table){} } } --- NEW FILE: AccessSelectQuery.cs --- using System; namespace Adapdev.Data.Sql { /// <summary> /// Summary description for AccessSelectQuery. /// </summary> public class AccessSelectQuery : SelectQuery { public AccessSelectQuery():base(DbType.ACCESS, DbProviderType.OLEDB){} public AccessSelectQuery(string table):base(DbType.ACCESS, DbProviderType.OLEDB, table){} } } --- NEW FILE: AccessInsertQuery.cs --- using System; namespace Adapdev.Data.Sql { /// <summary> /// Summary description for AccessInsertQuery. /// </summary> public class AccessInsertQuery : InsertQuery { public AccessInsertQuery():base(DbType.ACCESS, DbProviderType.OLEDB){} public AccessInsertQuery(string table):base(DbType.ACCESS, DbProviderType.OLEDB, table){} } } |
From: Sean M. <int...@us...> - 2006-02-19 06:17:24
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Sql/MsSql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14337/src/Adapdev.Data/Sql/MsSql Added Files: SqlDeleteQuery.cs SqlInsertQuery.cs SqlSelectQuery.cs SqlServerCriteria.cs SqlUpdateQuery.cs Log Message: --- NEW FILE: SqlSelectQuery.cs --- namespace Adapdev.Data.Sql { public class SqlSelectQuery : SelectQuery { public SqlSelectQuery() : base(DbType.SQLSERVER, DbProviderType.SQLSERVER) { } public SqlSelectQuery(string tableName) : base(DbType.SQLSERVER, DbProviderType.SQLSERVER, tableName) { } } } --- NEW FILE: SqlServerCriteria.cs --- namespace Adapdev.Data.Sql { using System.Collections; using System.Text; using Adapdev.Text; /// <summary> /// Summary description for ICriteria. /// </summary> public class SqlServerCriteria : Criteria { public SqlServerCriteria() : base(DbType.SQLSERVER, DbProviderType.SQLSERVER) { } public SqlServerCriteria(string sql) : base(DbType.SQLSERVER, DbProviderType.SQLSERVER, sql) { } } } --- NEW FILE: SqlDeleteQuery.cs --- namespace Adapdev.Data.Sql { /// <summary> /// Summary description for SqlDeleteQuery. /// </summary> public class SqlDeleteQuery : DeleteQuery { public SqlDeleteQuery() : base(DbType.SQLSERVER, DbProviderType.SQLSERVER) { } public SqlDeleteQuery(string tableName) : base(DbType.SQLSERVER, DbProviderType.SQLSERVER, tableName) { } } } --- NEW FILE: SqlInsertQuery.cs --- namespace Adapdev.Data.Sql { /// <summary> /// Summary description for SqlInsertQuery. /// </summary> public class SqlInsertQuery : InsertQuery { public SqlInsertQuery() : base(DbType.SQLSERVER, DbProviderType.SQLSERVER) { } public SqlInsertQuery(string tableName) : base(DbType.SQLSERVER, DbProviderType.SQLSERVER, tableName) { } } } --- NEW FILE: SqlUpdateQuery.cs --- namespace Adapdev.Data.Sql { /// <summary> /// Summary description for UpdateQuery. /// </summary> public class SqlUpdateQuery : UpdateQuery { public SqlUpdateQuery() : base(DbType.SQLSERVER, DbProviderType.SQLSERVER) { } public SqlUpdateQuery(string tableName) : base(DbType.SQLSERVER, DbProviderType.SQLSERVER, tableName) { } } } |