You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Peter S. <sz...@us...> - 2004-09-22 08:00:38
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24327/nhibernate Modified Files: releasenotes.txt Log Message: Fixed typo. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** releasenotes.txt 22 Sep 2004 04:49:54 -0000 1.15 --- releasenotes.txt 22 Sep 2004 08:00:29 -0000 1.16 *************** *** 22,26 **** - Renamed PrimitiveType to ValueTypeType to be more .net style consistent and fixed them up so they inherit from the appropriate class. - Fixed bug with caching an ObjectType. ! - Mucho code cleaned up for FxCop (Peter Smulovics). - Fixed bug with <bag lazy="true">, doing an Add, and then a Flush() resulting in the entity in there twice. --- 22,26 ---- - Renamed PrimitiveType to ValueTypeType to be more .net style consistent and fixed them up so they inherit from the appropriate class. - Fixed bug with caching an ObjectType. ! - Much code cleaned up for FxCop (Peter Smulovics). - Fixed bug with <bag lazy="true">, doing an Add, and then a Flush() resulting in the entity in there twice. |
From: Michael D. <mik...@us...> - 2004-09-22 04:50:03
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21225 Modified Files: releasenotes.txt Log Message: updated release notes with latest bug fix Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** releasenotes.txt 20 Sep 2004 03:04:35 -0000 1.14 --- releasenotes.txt 22 Sep 2004 04:49:54 -0000 1.15 *************** *** 22,25 **** --- 22,27 ---- - Renamed PrimitiveType to ValueTypeType to be more .net style consistent and fixed them up so they inherit from the appropriate class. - Fixed bug with caching an ObjectType. + - Mucho code cleaned up for FxCop (Peter Smulovics). + - Fixed bug with <bag lazy="true">, doing an Add, and then a Flush() resulting in the entity in there twice. Alpha Build 0.2.0.0 |
From: Michael D. <mik...@us...> - 2004-09-22 04:47:57
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20845/NHibernate.Test Modified Files: ParentChildTest.cs Log Message: Test Case to catch new bug found with Bags. Index: ParentChildTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ParentChildTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ParentChildTest.cs 31 Aug 2004 20:37:28 -0000 1.8 --- ParentChildTest.cs 22 Sep 2004 04:47:47 -0000 1.9 *************** *** 477,480 **** --- 477,497 ---- s.Close(); + // new test code in here to catch when a lazy bag has an addition then + // is flushed and then an operation that causes it to read from the db + // occurs - this used to cause the element in Add(element) to be in there + // twice and throw off the count by 1 (or by however many additions were + // made before the flush + s = sessions.OpenSession(); + c = (Container)s.Find("from c in class ContainerX")[0]; + Contained c5 = new Contained(); + c.LazyBag.Add( c5 ); + c5.LazyBag.Add( c ); + + // this causes the additions to be written to the db - now verify + // the additions list was cleared and the count returns correctly + s.Flush(); + Assert.AreEqual( 4, c.LazyBag.Count, "correct additions clearing after flush" ); + s.Close(); + s = sessions.OpenSession(); t = s.BeginTransaction(); *************** *** 488,492 **** Assert.AreEqual( 3, j); ! Assert.AreEqual( 3, c.LazyBag.Count ); s.Delete(c); c.Bag.Remove(c2); --- 505,512 ---- Assert.AreEqual( 3, j); ! ! // this used to be 3 - but since I added an item in the test above for flush ! // I increased it to 4 ! Assert.AreEqual( 4, c.LazyBag.Count ); s.Delete(c); c.Bag.Remove(c2); *************** *** 500,503 **** --- 520,524 ---- Assert.AreEqual( 2, j ); + s.Delete( s.Load( typeof(Contained), c5.Id ) ); s.Delete( s.Load( typeof(Contained), c4.Id ) ); s.Delete( s.Load( typeof(Contained), c3.Id ) ); |
From: Michael D. <mik...@us...> - 2004-09-22 04:46:54
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20582/Collection Modified Files: ArrayHolder.cs Bag.cs IdentifierBag.cs List.cs Map.cs PersistentCollection.cs Set.cs Log Message: Removed Obsoleted method from PersistentCollection Fixed bug with Bags that are lazy loading being flushed after an addition that would end up putting the same item in the bag twice. Index: Bag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Bag.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Bag.cs 9 Sep 2004 21:22:14 -0000 1.6 --- Bag.cs 22 Sep 2004 04:46:43 -0000 1.7 *************** *** 71,96 **** { object element = persister.ElementType.ResolveIdentifier(bagIdentifiers[i], session, owner); ! bag[i] = element; } } public override object ReadFrom(IDataReader reader, CollectionPersister persister, object owner) { object elementIdentifier = persister.ReadElementIdentifier(reader, owner, session); ! int index = bag.Add(null); ! bagIdentifiers.Insert(index, elementIdentifier); return elementIdentifier; } - [Obsolete("See PersistentCollection.ReadEntries for reason")] - public override void ReadEntries(ICollection entries) - { - foreach(object obj in entries) - { - bag.Add(obj); - } - } - public override void WriteTo(IDbCommand st, CollectionPersister persister, object entry, int i, bool writeOrder) { --- 71,93 ---- { object element = persister.ElementType.ResolveIdentifier(bagIdentifiers[i], session, owner); ! bag.Add( element ); ! } ! ! if( Additions!=null ) ! { ! DelayedAddAll( Additions ); ! Additions = null; } } + public override object ReadFrom(IDataReader reader, CollectionPersister persister, object owner) { object elementIdentifier = persister.ReadElementIdentifier(reader, owner, session); ! bagIdentifiers.Add( elementIdentifier ); return elementIdentifier; } public override void WriteTo(IDbCommand st, CollectionPersister persister, object entry, int i, bool writeOrder) { Index: Set.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Set.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Set.cs 16 Sep 2004 14:03:29 -0000 1.14 --- Set.cs 22 Sep 2004 04:46:43 -0000 1.15 *************** *** 319,331 **** } - /// <summary> - /// <see cref="PersistentCollection.ReadEntries"/> - /// </summary> - [Obsolete("See PersistentCollection for why it is obsolete")] - public override void ReadEntries(ICollection entries) { - foreach(DictionaryEntry entry in entries) { - map[entry.Key] = entry.Value; - } - } /// <summary> --- 319,322 ---- Index: List.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/List.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** List.cs 2 Sep 2004 15:07:19 -0000 1.13 --- List.cs 22 Sep 2004 04:46:43 -0000 1.14 *************** *** 155,163 **** } ! public override void EndRead(CollectionPersister persister, object owner) { ! for(int i = 0 ;i < listIdentifiers.Count; i++) { object element = persister.ElementType.ResolveIdentifier(listIdentifiers[i], session, owner); list[i] = element; } } --- 155,171 ---- } ! public override void EndRead(CollectionPersister persister, object owner) ! { ! for(int i = 0 ;i < listIdentifiers.Count; i++) ! { object element = persister.ElementType.ResolveIdentifier(listIdentifiers[i], session, owner); list[i] = element; } + + if( Additions!=null ) + { + DelayedAddAll( Additions ); + Additions = null; + } } *************** *** 197,208 **** } - [Obsolete("See PersistentCollection.ReadEntries for reason")] - public override void ReadEntries(ICollection entries) - { - foreach(object obj in entries) { - list.Add(obj); - } - } - public List(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) : base(session) { BeforeInitialize(persister); --- 205,208 ---- Index: Map.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Map.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Map.cs 16 Sep 2004 14:03:29 -0000 1.14 --- Map.cs 22 Sep 2004 04:46:43 -0000 1.15 *************** *** 230,241 **** } - [Obsolete("See PersistentCollection.ReadEntries for reason")] - public override void ReadEntries(ICollection entries) - { - foreach(DictionaryEntry entry in entries) { - map[entry.Key] = entry.Value; - } - } - public override object Disassemble(CollectionPersister persister) { object[] result = new object[map.Count * 2]; --- 230,233 ---- Index: ArrayHolder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/ArrayHolder.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ArrayHolder.cs 16 Sep 2004 14:03:29 -0000 1.12 --- ArrayHolder.cs 22 Sep 2004 04:46:43 -0000 1.13 *************** *** 123,137 **** } - [Obsolete("See PersistentCollection.ReadEntries for reason")] - public override void ReadEntries(ICollection entries) - { - ArrayList list = new ArrayList(); - foreach(object obj in entries) - { - list.Add(obj); - } - array = list.ToArray( elementClass ); - } - public override void BeginRead() { --- 123,126 ---- Index: PersistentCollection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/PersistentCollection.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PersistentCollection.cs 16 Sep 2004 14:03:29 -0000 1.15 --- PersistentCollection.cs 22 Sep 2004 04:46:43 -0000 1.16 *************** *** 123,126 **** --- 123,153 ---- } + /// <summary> + /// Gets or Sets an <see cref="ArrayList"/> of objects that have been placed in the Queue + /// to be added. + /// </summary> + /// <value>An <see cref="ArrayList"/> of objects or null.</value> + protected ArrayList Additions + { + get { return additions; } + set { additions = value; } + } + + /// <summary> + /// Clears out any Queued Additions. + /// </summary> + /// <remarks> + /// After a Flush() the database is in synch with the in-memory + /// contents of the Collection. Since everything is in synch remove + /// any Queued Additions. + /// </remarks> + public virtual void PostFlush() + { + if( additions!=null ) + { + additions.Clear(); + } + } + protected PersistentCollection(ISessionImplementor session) { *************** *** 251,258 **** public abstract ICollection Entries(); - //TODO: determine where this is used - not in H2.0.3 - [Obsolete("Not in H2.0.3 - can't find any usage in NH")] - public abstract void ReadEntries(ICollection entries); - /// <summary> /// Reads the elements Identifier from the reader. --- 278,281 ---- Index: IdentifierBag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/IdentifierBag.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdentifierBag.cs 9 Aug 2004 03:11:45 -0000 1.3 --- IdentifierBag.cs 22 Sep 2004 04:46:43 -0000 1.4 *************** *** 225,234 **** } - [Obsolete("See PersistentCollection.ReadEntries for reason")] - public override void ReadEntries(ICollection entries) - { - throw new NotSupportedException("Should not call..."); - } - public override ICollection Entries() { --- 225,228 ---- |
From: Michael D. <mik...@us...> - 2004-09-22 04:46:53
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20582/Type Modified Files: PersistentCollectionType.cs Log Message: Removed Obsoleted method from PersistentCollection Fixed bug with Bags that are lazy loading being flushed after an addition that would end up putting the same item in the bag twice. Index: PersistentCollectionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentCollectionType.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PersistentCollectionType.cs 20 Aug 2004 17:39:01 -0000 1.14 --- PersistentCollectionType.cs 22 Sep 2004 04:46:44 -0000 1.15 *************** *** 7,34 **** using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// PersistentCollectionType. /// </summary> ! public abstract class PersistentCollectionType : AbstractType, IAssociationType { private readonly string role; private static readonly SqlType[] NoSqlTypes = {}; ! public PersistentCollectionType(string role) { this.role = role; } ! public virtual string Role { get { return role; } } ! public override bool IsPersistentCollectionType { get { return true; } } ! public override sealed bool Equals(object x, object y) { ! // proxies? return x==y; } --- 7,39 ---- using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// PersistentCollectionType. /// </summary> ! public abstract class PersistentCollectionType : AbstractType, IAssociationType ! { private readonly string role; private static readonly SqlType[] NoSqlTypes = {}; ! public PersistentCollectionType(string role) ! { this.role = role; } ! public virtual string Role ! { get { return role; } } ! public override bool IsPersistentCollectionType ! { get { return true; } } ! public override sealed bool Equals(object x, object y) ! { ! // proxies? - comment in h2.0.3 also return x==y; } *************** *** 36,49 **** public abstract PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister); ! public override object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, object owner) { throw new AssertionFailure("bug in PersistentCollectionType"); } ! public override object NullSafeGet(IDataReader rs, string[] name, ISessionImplementor session, object owner) { return ResolveIdentifier( Hydrate(rs, name, session, owner), session, owner ); } ! public virtual object GetCollection(object id, object owner, ISessionImplementor session) { ! PersistentCollection collection = session.GetLoadingCollection(role, id); if(collection!=null) return collection.GetCachedValue(); //TODO: yuck... call another method - H2.0.3comment --- 41,62 ---- public abstract PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister); ! public override object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, object owner) ! { throw new AssertionFailure("bug in PersistentCollectionType"); } ! public override object NullSafeGet(IDataReader rs, string[] name, ISessionImplementor session, object owner) ! { return ResolveIdentifier( Hydrate(rs, name, session, owner), session, owner ); } ! public override void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session) ! { ! } ! ! public virtual object GetCollection(object id, object owner, ISessionImplementor session) ! { ! // added the owner ! PersistentCollection collection = session.GetLoadingCollection( role, id ); if(collection!=null) return collection.GetCachedValue(); //TODO: yuck... call another method - H2.0.3comment *************** *** 64,87 **** } ! public override void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session) { ! } ! ! public override SqlType[] SqlTypes(IMapping session) { return NoSqlTypes; } ! public override int GetColumnSpan(IMapping session) { return 0; } ! public override string ToXML(object value, ISessionFactoryImplementor factory) { return (value==null) ? null : value.ToString(); } ! public override object DeepCopy(object value) { return value; } ! public override string Name { get { return ReturnedClass.Name; } } --- 77,102 ---- } ! public override SqlType[] SqlTypes(IMapping session) ! { return NoSqlTypes; } ! public override int GetColumnSpan(IMapping session) ! { return 0; } ! public override string ToXML(object value, ISessionFactoryImplementor factory) ! { return (value==null) ? null : value.ToString(); } ! public override object DeepCopy(object value) ! { return value; } ! public override string Name ! { get { return ReturnedClass.Name; } } *************** *** 98,106 **** /// DictionaryEntry. /// </remarks> ! public virtual ICollection GetElementsCollection(object collection) { return ( (ICollection)collection ); } ! public override bool IsMutable { get { return false; } } --- 113,123 ---- /// DictionaryEntry. /// </remarks> ! public virtual ICollection GetElementsCollection(object collection) ! { return ( (ICollection)collection ); } ! public override bool IsMutable ! { get { return false; } } *************** *** 120,144 **** } ! public override object Assemble(object cached, ISessionImplementor session, object owner) { object id = session.GetEntityIdentifier(owner); ! if(id==null) throw new AssertionFailure("bug re-assembling collection reference"); return ResolveIdentifier(id, session, owner); - //return ResolveIdentifier(cached, session, owner); } ! public override bool IsDirty(object old, object current, ISessionImplementor session) { ! System.Type ownerClass = session.Factory.GetCollectionPersister(role).OwnerClass; ! if ( !session.Factory.GetPersister(ownerClass).IsVersioned ) { // collections don't dirty an unversioned parent entity return false; } ! else { return base.IsDirty(old, current, session); } } ! public override bool HasNiceEquals { get { return false; } } --- 137,167 ---- } ! public override object Assemble(object cached, ISessionImplementor session, object owner) ! { object id = session.GetEntityIdentifier(owner); ! if(id==null) ! { ! throw new AssertionFailure("bug re-assembling collection reference"); ! } return ResolveIdentifier(id, session, owner); } ! public override bool IsDirty(object old, object current, ISessionImplementor session) ! { System.Type ownerClass = session.Factory.GetCollectionPersister(role).OwnerClass; ! if ( !session.Factory.GetPersister(ownerClass).IsVersioned ) ! { // collections don't dirty an unversioned parent entity return false; } ! else ! { return base.IsDirty(old, current, session); } } ! public override bool HasNiceEquals ! { get { return false; } } *************** *** 150,175 **** * all collections are associations. */ ! public override bool IsAssociationType { get { return true; } } ! public virtual ForeignKeyType ForeignKeyType { get { return ForeignKeyType.ForeignKeyToParent; } } ! public override object Hydrate(IDataReader rs, string[] name, ISessionImplementor session, object owner) { return session.GetEntityIdentifier(owner); } ! public override object ResolveIdentifier(object value, ISessionImplementor session, object owner) { ! if (value==null) { return null; } ! else { return GetCollection( value, owner, session); } } ! public virtual bool IsArrayType { get { return false; } } --- 173,207 ---- * all collections are associations. */ ! public override bool IsAssociationType ! { get { return true; } } ! public virtual ForeignKeyType ForeignKeyType ! { get { return ForeignKeyType.ForeignKeyToParent; } } ! public override object Hydrate(IDataReader rs, string[] name, ISessionImplementor session, object owner) ! { return session.GetEntityIdentifier(owner); } ! public override object ResolveIdentifier(object value, ISessionImplementor session, object owner) ! { ! if (value==null) ! { return null; } ! else ! { ! // h2.1 changed this to use sesion.GetCollection( role, value, owner ) and ! // move the impl of GetCollection from this class to the ISession. return GetCollection( value, owner, session); } } ! public virtual bool IsArrayType ! { get { return false; } } |
From: Michael D. <mik...@us...> - 2004-09-22 04:46:53
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20582/Impl Modified Files: SessionImpl.cs Log Message: Removed Obsoleted method from PersistentCollection Fixed bug with Bags that are lazy loading being flushed after an addition that would end up putting the same item in the bag twice. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** SessionImpl.cs 14 Sep 2004 17:49:55 -0000 1.41 --- SessionImpl.cs 22 Sep 2004 04:46:44 -0000 1.42 *************** *** 284,287 **** --- 284,288 ---- public void PostInitialize(PersistentCollection collection) { + initialized = true; snapshot = collection.GetSnapshot(loadedPersister); } *************** *** 290,298 **** public void PostFlush(PersistentCollection collection) { ! if (!processed) throw new AssertionFailure("Hibernate has a bug processing collections"); loadedKey = currentKey; SetLoadedPersister( currentPersister ); dirty = false; if ( initialized && ( doremove || dorecreate || doupdate ) ) { --- 291,307 ---- public void PostFlush(PersistentCollection collection) { ! if( !processed ) ! { throw new AssertionFailure("Hibernate has a bug processing collections"); + } loadedKey = currentKey; SetLoadedPersister( currentPersister ); dirty = false; + + // collection needs to know its' representation in memory and with + // the db is now in synch - esp important for collections like a bag + // that can add without initializing the collection. + collection.PostFlush(); + if ( initialized && ( doremove || dorecreate || doupdate ) ) { *************** *** 2917,2920 **** --- 2926,2930 ---- AddUninitializedCollection(pc, GetCollectionPersister(snapshot.Role), id); pc.ForceLoad(); + // commented out in h2.0.3 also // ugly & inefficient little hack to force collection to be recreated // after "disconnected" collection replaces the "connected" one *************** *** 3242,3245 **** --- 3252,3256 ---- // TODO: replace with owner version of this method... + [Obsolete("Use the one with CollectionPersister, id, owner) instead")] public PersistentCollection GetLoadingCollection(CollectionPersister persister, object id) { *************** *** 3445,3452 **** } - ce.initialized = true; ce.PostInitialize(collection); ! if (!writing) persister.Cache(id, collection, this); } } --- 3456,3466 ---- } ce.PostInitialize(collection); ! //removed this because it is not in h2.1 - I was having problems with Bags and ! // lazy additions and trying to cache uninitialized collections at this point. ! // Collections are still written to the Cache in EndLoadingCollection and that ! // is probably the most appropriate place for that code anyway. ! // if (!writing) persister.Cache(id, collection, this); } } |
From: Peter S. <sz...@us...> - 2004-09-21 12:43:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13190 Modified Files: ADOException.cs AssertionFailure.cs CallbackException.cs InstantiationException.cs LazyInitializationException.cs MappingException.cs ObjectDeletedException.cs ObjectNotFoundException.cs ValidationFailure.cs Log Message: Some more exception constructor. Index: ObjectDeletedException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ObjectDeletedException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectDeletedException.cs 13 Sep 2004 05:37:37 -0000 1.2 --- ObjectDeletedException.cs 21 Sep 2004 12:43:26 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 25,28 **** --- 26,39 ---- get { return base.Message + ": " + identifier; } } + + public ObjectDeletedException(string msg, Exception root) : this(msg, root.Message) {} + + public ObjectDeletedException(string msg) : this(msg, msg) {} + + public ObjectDeletedException(Exception root) : this(root.Message, root.Message) {} + + public ObjectDeletedException() : this(string.Empty, string.Empty) {} + + protected ObjectDeletedException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } Index: CallbackException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/CallbackException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CallbackException.cs 20 Sep 2004 17:49:25 -0000 1.3 --- CallbackException.cs 21 Sep 2004 12:43:26 -0000 1.4 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 13,16 **** --- 14,19 ---- public CallbackException(string message, Exception e) : base(message, e) {} + + protected CallbackException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } Index: InstantiationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/InstantiationException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InstantiationException.cs 13 Sep 2004 05:37:37 -0000 1.2 --- InstantiationException.cs 21 Sep 2004 12:43:26 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 25,28 **** --- 26,37 ---- get { return base.Message + type.FullName; } } + + public InstantiationException(string s, Exception root) : this(s, typeof(InstantiationException), root) {} + + public InstantiationException(string s) : this(s, typeof(InstantiationException), new InvalidOperationException("Invalid Operation")) {} + + public InstantiationException() : this("Exception occured", typeof(InstantiationException), new InvalidOperationException("Invalid Operation")) {} + + protected InstantiationException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } Index: ADOException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ADOException.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ADOException.cs 20 Sep 2004 17:49:25 -0000 1.5 --- ADOException.cs 21 Sep 2004 12:43:26 -0000 1.6 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Data; + using System.Runtime.Serialization; namespace NHibernate *************** *** 14,17 **** --- 15,20 ---- public ADOException() : this("DataException occured", new InvalidOperationException("Invalid Operation")) { } + public ADOException(string str) : this(str, new InvalidOperationException("Invalid Operation")) { } + public ADOException(DataException root) : this("DataException occurred", root) { } *************** *** 22,25 **** --- 25,30 ---- } + protected ADOException(SerializationInfo info, StreamingContext context) : base(info, context) { } + } } Index: ObjectNotFoundException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ObjectNotFoundException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectNotFoundException.cs 13 Sep 2004 05:37:37 -0000 1.2 --- ObjectNotFoundException.cs 21 Sep 2004 12:43:26 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 33,36 **** --- 34,44 ---- get { return type; } } + public ObjectNotFoundException(string msg, Exception root) : this(msg, root.Message, typeof(ObjectNotFoundException)) {} + + public ObjectNotFoundException(string msg) : this(msg, msg, typeof(ObjectNotFoundException)) {} + + public ObjectNotFoundException(Exception root) : this(root.Message, root.Message, typeof(ObjectNotFoundException)) {} + + protected ObjectNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } Index: MappingException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/MappingException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MappingException.cs 13 Sep 2004 05:37:37 -0000 1.3 --- MappingException.cs 21 Sep 2004 12:43:26 -0000 1.4 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 15,18 **** --- 16,23 ---- public MappingException(string msg) : base(msg) {} + + public MappingException() : base() {} + + protected MappingException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } Index: AssertionFailure.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/AssertionFailure.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AssertionFailure.cs 20 Sep 2004 17:49:25 -0000 1.3 --- AssertionFailure.cs 21 Sep 2004 12:43:26 -0000 1.4 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 23,26 **** --- 24,29 ---- log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate", e); } + + protected AssertionFailure(SerializationInfo info, StreamingContext context) : base(info, context) { } } } Index: ValidationFailure.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ValidationFailure.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ValidationFailure.cs 13 Sep 2004 05:37:37 -0000 1.2 --- ValidationFailure.cs 21 Sep 2004 12:43:26 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 15,18 **** --- 16,23 ---- public ValidationFailure(Exception e) : base("A validation failure occured", e) {} + + public ValidationFailure() : base("A validation failure occured") {} + + protected ValidationFailure(SerializationInfo info, StreamingContext context) : base(info, context) { } } } Index: LazyInitializationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/LazyInitializationException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LazyInitializationException.cs 13 Sep 2004 05:37:37 -0000 1.3 --- LazyInitializationException.cs 21 Sep 2004 12:43:26 -0000 1.4 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 10,14 **** public class LazyInitializationException : Exception { ! public LazyInitializationException(Exception root) : base("Hibernate lazy instantiation problem", root) {} public LazyInitializationException(string msg) : base(msg) --- 11,15 ---- public class LazyInitializationException : Exception { ! public LazyInitializationException(Exception root) : this(root.Message) {} public LazyInitializationException(string msg) : base(msg) *************** *** 17,21 **** } ! public LazyInitializationException(string msg, Exception root) : base(msg, root) { } } --- 18,26 ---- } ! public LazyInitializationException(string msg, Exception root) : this(msg + " " + root.Message) {} ! ! public LazyInitializationException() : this("LazyInitalizationException") {} ! ! protected LazyInitializationException(SerializationInfo info, StreamingContext context) : base(info, context) { } } |
From: Peter S. <sz...@us...> - 2004-09-21 09:58:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13204/SqlCommand Modified Files: Parameter.cs SelectFragment.cs SqlBaseBuilder.cs SqlString.cs Log Message: Fixed performance issue regarding empty strings Index: SqlString.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlString.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SqlString.cs 13 Sep 2004 07:11:05 -0000 1.14 --- SqlString.cs 21 Sep 2004 09:58:25 -0000 1.15 *************** *** 113,117 **** builderString = builder.ToString(); ! if(builderString!=String.Empty) { sqlBuilder.Add(builderString); --- 113,117 ---- builderString = builder.ToString(); ! if(builderString.Length > 0) { sqlBuilder.Add(builderString); *************** *** 286,290 **** // move on to the next SqlPart, otherwise lets make sure that // it does in fact start with the value ! if(partText!=String.Empty) { return partText.StartsWith(value); --- 286,290 ---- // move on to the next SqlPart, otherwise lets make sure that // it does in fact start with the value ! if(partText.Length > 0) { return partText.StartsWith(value); Index: Parameter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/Parameter.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Parameter.cs 9 Aug 2004 03:13:18 -0000 1.9 --- Parameter.cs 21 Sep 2004 09:58:25 -0000 1.10 *************** *** 149,153 **** public override string ToString() { ! return (tableAlias==null || tableAlias==String.Empty)? ":" + name : ":" + tableAlias + "." + name; --- 149,153 ---- public override string ToString() { ! return (tableAlias==null || tableAlias.Length == 0)? ":" + name : ":" + tableAlias + "." + name; Index: SqlBaseBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlBaseBuilder.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlBaseBuilder.cs 10 Sep 2004 21:23:15 -0000 1.2 --- SqlBaseBuilder.cs 21 Sep 2004 09:58:25 -0000 1.3 *************** *** 69,73 **** string columnName; ! if(tableAlias!=null && tableAlias!=String.Empty) { columnName = tableAlias + StringHelper.Dot + columnNames[i]; } --- 69,73 ---- string columnName; ! if(tableAlias!=null && tableAlias.Length > 0) { columnName = tableAlias + StringHelper.Dot + columnNames[i]; } Index: SelectFragment.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SelectFragment.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SelectFragment.cs 16 Aug 2004 05:18:52 -0000 1.5 --- SelectFragment.cs 21 Sep 2004 09:58:25 -0000 1.6 *************** *** 47,51 **** public SelectFragment AddColumn(string tableAlias, string columnName, string columnAlias) { ! if(tableAlias==null || tableAlias==String.Empty) { columns.Add(columnName); --- 47,51 ---- public SelectFragment AddColumn(string tableAlias, string columnName, string columnAlias) { ! if(tableAlias==null || tableAlias.Length == 0) { columns.Add(columnName); |
From: Peter S. <sz...@us...> - 2004-09-21 09:58:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13204/Persister Modified Files: AbstractEntityPersister.cs EntityPersister.cs NormalizedEntityPersister.cs Log Message: Fixed performance issue regarding empty strings Index: NormalizedEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/NormalizedEntityPersister.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** NormalizedEntityPersister.cs 14 Sep 2004 17:49:56 -0000 1.31 --- NormalizedEntityPersister.cs 21 Sep 2004 09:58:24 -0000 1.32 *************** *** 1462,1466 **** //TODO: H2.0.3 synch - figure out what is different here and why it is different // make sure an Alias was actually passed into the statement ! if(alias!=null && alias!=String.Empty) return StringHelper.Prefix(cols, Alias(alias, tableIndex) + StringHelper.Dot); else --- 1462,1466 ---- //TODO: H2.0.3 synch - figure out what is different here and why it is different // make sure an Alias was actually passed into the statement ! if(alias!=null && alias.Length > 0) return StringHelper.Prefix(cols, Alias(alias, tableIndex) + StringHelper.Dot); else Index: AbstractEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/AbstractEntityPersister.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AbstractEntityPersister.cs 10 Sep 2004 12:21:21 -0000 1.25 --- AbstractEntityPersister.cs 21 Sep 2004 09:58:24 -0000 1.26 *************** *** 781,785 **** protected bool HasWhere { ! get { return (sqlWhereString!=null && sqlWhereString!=String.Empty); } } --- 781,785 ---- protected bool HasWhere { ! get { return (sqlWhereString!=null && sqlWhereString.Length > 0); } } Index: EntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/EntityPersister.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** EntityPersister.cs 15 Sep 2004 13:19:44 -0000 1.29 --- EntityPersister.cs 21 Sep 2004 09:58:24 -0000 1.30 *************** *** 594,598 **** // add any special text that is contained in the forUpdateFragment ! if(forUpdateFragment!=null && forUpdateFragment!=String.Empty) { SqlStringBuilder sqlBuilder = new SqlStringBuilder(forUpdateSqlString); --- 594,598 ---- // add any special text that is contained in the forUpdateFragment ! if(forUpdateFragment!=null && forUpdateFragment.Length > 0) { SqlStringBuilder sqlBuilder = new SqlStringBuilder(forUpdateSqlString); *************** *** 1168,1172 **** // make sure an Alias was actually passed into the statement ! if(name!=null && name!=String.Empty) { return StringHelper.Prefix(cols, name + StringHelper.Dot); --- 1168,1172 ---- // make sure an Alias was actually passed into the statement ! if(name!=null && name.Length > 0) { return StringHelper.Prefix(cols, name + StringHelper.Dot); |
From: Peter S. <sz...@us...> - 2004-09-21 09:58:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13204/Id Modified Files: ForeignGenerator.cs Log Message: Fixed performance issue regarding empty strings Index: ForeignGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/ForeignGenerator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ForeignGenerator.cs 28 Mar 2004 06:06:40 -0000 1.2 --- ForeignGenerator.cs 21 Sep 2004 09:58:24 -0000 1.3 *************** *** 34,38 **** { propertyName = (string)parms["property"]; ! if(propertyName==null || propertyName==String.Empty) throw new MappingException("param named \"property\" is required for foreign id generation strategy"); } --- 34,38 ---- { propertyName = (string)parms["property"]; ! if(propertyName==null || propertyName.Length == 0) throw new MappingException("param named \"property\" is required for foreign id generation strategy"); } |
From: Peter S. <sz...@us...> - 2004-09-21 09:58:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13204/Impl Modified Files: SessionFactoryImpl.cs SessionFactoryObjectFactory.cs Log Message: Fixed performance issue regarding empty strings Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** SessionFactoryImpl.cs 13 Sep 2004 07:30:56 -0000 1.31 --- SessionFactoryImpl.cs 21 Sep 2004 09:58:24 -0000 1.32 *************** *** 141,145 **** // has been set so just use the default of the DataProvider. string isolationString = PropertiesHelper.GetString( Cfg.Environment.Isolation, properties, String.Empty ); ! if( isolationString!=String.Empty ) { try --- 141,145 ---- // has been set so just use the default of the DataProvider. string isolationString = PropertiesHelper.GetString( Cfg.Environment.Isolation, properties, String.Empty ); ! if( isolationString.Length > 0) { try Index: SessionFactoryObjectFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryObjectFactory.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SessionFactoryObjectFactory.cs 9 Aug 2004 03:25:55 -0000 1.1 --- SessionFactoryObjectFactory.cs 21 Sep 2004 09:58:24 -0000 1.2 *************** *** 52,56 **** { string nameMsg = "unnamed"; ! if(name!=null && name!=String.Empty) { nameMsg = name; --- 52,56 ---- { string nameMsg = "unnamed"; ! if(name!=null && name.Length > 0) { nameMsg = name; *************** *** 61,65 **** Instances[uid] = instance; ! if(name!=null && name!=String.Empty) { log.Info("Factory name:" + name); --- 61,65 ---- Instances[uid] = instance; ! if(name!=null && name.Length > 0) { log.Info("Factory name:" + name); *************** *** 81,85 **** public static void RemoveInstance(string uid, string name, IDictionary properties) { ! if(name!=null && name!=String.Empty) { log.Info("unbinding factory: " + name); --- 81,85 ---- public static void RemoveInstance(string uid, string name, IDictionary properties) { ! if(name!=null && name.Length > 0) { log.Info("unbinding factory: " + name); |
From: Peter S. <sz...@us...> - 2004-09-21 09:58:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13204/Driver Modified Files: DriverBase.cs Log Message: Fixed performance issue regarding empty strings Index: DriverBase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/DriverBase.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DriverBase.cs 16 Aug 2004 05:21:12 -0000 1.7 --- DriverBase.cs 21 Sep 2004 09:58:24 -0000 1.8 *************** *** 48,52 **** ! if(tableAlias!=null && tableAlias!=String.Empty) { return NamedPrefix + tableAlias + parameterName; --- 48,52 ---- ! if(tableAlias!=null && tableAlias.Length > 0) { return NamedPrefix + tableAlias + parameterName; *************** *** 68,72 **** ! if(tableAlias!=null && tableAlias!=String.Empty) { return NamedPrefix + tableAlias + parameterName; --- 68,72 ---- ! if(tableAlias!=null && tableAlias.Length > 0) { return NamedPrefix + tableAlias + parameterName; |
From: Peter S. <sz...@us...> - 2004-09-20 17:55:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26513 Modified Files: ClassName.cs Log Message: Fixed some more typo Index: ClassName.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/ClassName.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassName.cs 13 Sep 2004 12:47:59 -0000 1.2 --- ClassName.cs 20 Sep 2004 17:54:55 -0000 1.3 *************** *** 83,95 **** /// <summary>Two ClassName are equals if their fullyQualifiedName are the same/equals! </summary> ! public override bool Equals(Object other) { ClassName otherClassName = (ClassName) other; return otherClassName.fullyQualifiedName.Equals(fullyQualifiedName); } public virtual bool inJavaLang() { ! return "java.lang".Equals(packageName); } --- 83,100 ---- /// <summary>Two ClassName are equals if their fullyQualifiedName are the same/equals! </summary> ! public override bool Equals(object other) { ClassName otherClassName = (ClassName) other; return otherClassName.fullyQualifiedName.Equals(fullyQualifiedName); } + + public override int GetHashCode() + { + return base.GetHashCode (); + } public virtual bool inJavaLang() { ! return "System".Equals(packageName); } |
From: Peter S. <sz...@us...> - 2004-09-20 17:53:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26143 Modified Files: JavaTool.cs Log Message: Fixed two bad reference Index: JavaTool.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/JavaTool.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JavaTool.cs 13 Sep 2004 12:55:24 -0000 1.2 --- JavaTool.cs 20 Sep 2004 17:53:11 -0000 1.3 *************** *** 140,144 **** public virtual bool hasExtends(ClassMapping cmap) { ! return (Object) getExtends(cmap) != string.Empty; } --- 140,144 ---- public virtual bool hasExtends(ClassMapping cmap) { ! return getExtends(cmap).Length != 0; } *************** *** 183,187 **** public virtual bool hasImplements(ClassMapping cmap) { ! return (Object) getImplements(cmap) != string.Empty; } --- 183,187 ---- public virtual bool hasImplements(ClassMapping cmap) { ! return getImplements(cmap).Length != 0; } |
From: Peter S. <sz...@us...> - 2004-09-20 17:49:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25309 Modified Files: ADOException.cs AssertionFailure.cs CallbackException.cs HibernateException.cs Log Message: Added some more constructors to exceptions to act more like .NET does Index: CallbackException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/CallbackException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CallbackException.cs 13 Sep 2004 05:37:37 -0000 1.2 --- CallbackException.cs 20 Sep 2004 17:49:25 -0000 1.3 *************** *** 6,9 **** --- 6,11 ---- public class CallbackException : HibernateException { + public CallbackException() : base("An exception occured in a callback") {} + public CallbackException(Exception root) : base("An exception occured in a callback", root) {} Index: AssertionFailure.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/AssertionFailure.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssertionFailure.cs 13 Sep 2004 05:37:37 -0000 1.2 --- AssertionFailure.cs 20 Sep 2004 17:49:25 -0000 1.3 *************** *** 9,12 **** --- 9,17 ---- public class AssertionFailure : ApplicationException { + public AssertionFailure() : base(String.Empty) + { + log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate"); + } + public AssertionFailure(string s) : base(s) { Index: ADOException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ADOException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ADOException.cs 13 Sep 2004 05:37:37 -0000 1.4 --- ADOException.cs 20 Sep 2004 17:49:25 -0000 1.5 *************** *** 12,15 **** --- 12,17 ---- private Exception sqle; + public ADOException() : this("DataException occured", new InvalidOperationException("Invalid Operation")) { } + public ADOException(DataException root) : this("DataException occurred", root) { } Index: HibernateException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/HibernateException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HibernateException.cs 13 Sep 2004 05:37:37 -0000 1.4 --- HibernateException.cs 20 Sep 2004 17:49:25 -0000 1.5 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Runtime.Serialization; namespace NHibernate *************** *** 11,14 **** --- 12,17 ---- public class HibernateException : ApplicationException { + public HibernateException() : base (String.Empty) { } + public HibernateException(Exception e) : base(String.Empty, e) { } *************** *** 16,19 **** --- 19,24 ---- public HibernateException(string str) : base(str) { } + + protected HibernateException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } |
From: Peter S. <sz...@us...> - 2004-09-20 17:46:55
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263 Modified Files: CriteriaTest.cs ObjectAssertion.cs SimpleTest.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: CriteriaTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CriteriaTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CriteriaTest.cs 13 Jul 2004 19:37:25 -0000 1.5 --- CriteriaTest.cs 20 Sep 2004 17:45:58 -0000 1.6 *************** *** 52,64 **** .List(); ! Assertion.AssertEquals(1, results2.Count); Simple simple2 = (Simple)results2[0]; ! Assertion.AssertNotNull("Unable to load object", simple2); ! Assertion.AssertEquals("Load failed", simple1.Count, simple2.Count); ! Assertion.AssertEquals("Load failed", simple1.Name, simple2.Name); ! Assertion.AssertEquals("Load failed", simple1.Address, simple2.Address); ! Assertion.AssertEquals("Load failed", simple1.Date.ToString(), simple2.Date.ToString()); s2.Delete("from Simple"); --- 52,64 ---- .List(); ! Assert.AreEqual(1, results2.Count); Simple simple2 = (Simple)results2[0]; ! Assert.IsNotNull(simple2, "Unable to load object"); ! Assert.AreEqual(simple1.Count, simple2.Count, "Load failed"); ! Assert.AreEqual(simple1.Name, simple2.Name, "Load failed"); ! Assert.AreEqual(simple1.Address, simple2.Address, "Load failed"); ! Assert.AreEqual(simple1.Date.ToString(), simple2.Date.ToString(), "Load failed"); s2.Delete("from Simple"); Index: SimpleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SimpleTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SimpleTest.cs 18 Aug 2004 20:48:33 -0000 1.5 --- SimpleTest.cs 20 Sep 2004 17:45:58 -0000 1.6 *************** *** 60,66 **** // verify each property was saved as expected ! Assertion.AssertNotNull("Unable to load object", simple2); ! Assertion.AssertNotNull(otherSimple2); ! Assertion.AssertSame(simple2.Other, otherSimple2); // update --- 60,66 ---- // verify each property was saved as expected ! Assert.IsNotNull(simple2, "Unable to load object"); ! Assert.IsNotNull(otherSimple2); ! Assert.AreSame(simple2.Other, otherSimple2); // update *************** *** 83,90 **** Simple otherSimple3; ! Assertion.AssertEquals(simple2.Count, simple3.Count); ! Assertion.AssertEquals(simple2.Name, simple3.Name); ! Assertion.AssertEquals(simple2.Address, simple3.Address); ! Assertion.AssertEquals(simple2.Date, simple3.Date); // note that the Other will not be the same object because --- 83,90 ---- Simple otherSimple3; ! Assert.AreEqual(simple2.Count, simple3.Count); ! Assert.AreEqual(simple2.Name, simple3.Name); ! Assert.AreEqual(simple2.Address, simple3.Address); ! Assert.AreEqual(simple2.Date, simple3.Date); // note that the Other will not be the same object because *************** *** 101,105 **** // verify there is no other Simple objects in the db ISession s4 = sessions.OpenSession(); ! Assertion.AssertEquals(0, s4.CreateCriteria(typeof(Simple)).List().Count); s4.Close(); --- 101,105 ---- // verify there is no other Simple objects in the db ISession s4 = sessions.OpenSession(); ! Assert.AreEqual(0, s4.CreateCriteria(typeof(Simple)).List().Count); s4.Close(); Index: ObjectAssertion.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ObjectAssertion.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectAssertion.cs 9 Jun 2004 01:05:46 -0000 1.4 --- ObjectAssertion.cs 20 Sep 2004 17:45:58 -0000 1.5 *************** *** 9,18 **** { /// <summary> ! /// Helps with Assertions with two Objects. /// </summary> [TestFixture] ! public class ObjectAssertion { ! public ObjectAssertion() { } --- 9,18 ---- { /// <summary> ! /// Helps with Asserts with two Objects. /// </summary> [TestFixture] ! public class ObjectAssert { ! public ObjectAssert() { } *************** *** 20,33 **** internal static void AssertPropertiesEqual(JoinedSubclassBase expected, JoinedSubclassBase actual) { ! Assertion.AssertEquals(expected.Id, actual.Id); ! Assertion.AssertEquals(expected.TestDateTime, actual.TestDateTime); ! Assertion.AssertEquals(expected.TestLong, actual.TestLong); ! Assertion.AssertEquals(expected.TestString, actual.TestString); } internal static void AssertPropertiesEqual(JoinedSubclassOne expected, JoinedSubclassOne actual) { ! ObjectAssertion.AssertPropertiesEqual((JoinedSubclassBase)expected, (JoinedSubclassBase)actual); ! Assertion.AssertEquals(expected.OneTestLong, actual.OneTestLong); } --- 20,33 ---- internal static void AssertPropertiesEqual(JoinedSubclassBase expected, JoinedSubclassBase actual) { ! Assert.AreEqual(expected.Id, actual.Id); ! Assert.AreEqual(expected.TestDateTime, actual.TestDateTime); ! Assert.AreEqual(expected.TestLong, actual.TestLong); ! Assert.AreEqual(expected.TestString, actual.TestString); } internal static void AssertPropertiesEqual(JoinedSubclassOne expected, JoinedSubclassOne actual) { ! ObjectAssert.AssertPropertiesEqual((JoinedSubclassBase)expected, (JoinedSubclassBase)actual); ! Assert.AreEqual(expected.OneTestLong, actual.OneTestLong); } *************** *** 74,84 **** internal static void AssertEquals(IDictionary expected, IDictionary actual, bool compareValues) { ! Assertion.AssertEquals(expected.Count, actual.Count); foreach(DictionaryEntry de in expected) { ! Assertion.Assert(actual.Contains(de.Key)); if(compareValues) ! Assertion.AssertEquals("The item identified by the key " + de.Key.ToString(), expected[de.Key], actual[de.Key]); } } --- 74,84 ---- internal static void AssertEquals(IDictionary expected, IDictionary actual, bool compareValues) { ! Assert.AreEqual(expected.Count, actual.Count); foreach(DictionaryEntry de in expected) { ! Assert.IsTrue(actual.Contains(de.Key)); if(compareValues) ! Assert.AreEqual(expected[de.Key], actual[de.Key], "The item identified by the key " + de.Key.ToString()); } } *************** *** 96,100 **** actualWithEqualValues["ONE"] = "one"; ! ObjectAssertion.AssertEquals(expected, actualWithEqualValues, true); } --- 96,100 ---- actualWithEqualValues["ONE"] = "one"; ! ObjectAssert.AssertEquals(expected, actualWithEqualValues, true); } *************** *** 102,113 **** public static void AssertEquals(DateTime expected, DateTime actual, bool useMilliseconds) { ! Assertion.AssertEquals("Year", expected.Year, actual.Year); ! Assertion.AssertEquals("Month", expected.Month, actual.Month); ! Assertion.AssertEquals("Day", expected.Day, actual.Day); ! Assertion.AssertEquals("Hour", expected.Hour, actual.Hour); ! Assertion.AssertEquals("Minute", expected.Minute, actual.Minute); ! Assertion.AssertEquals("Second", expected.Second, actual.Second); if(useMilliseconds) ! Assertion.AssertEquals("Millisecond", expected.Millisecond, actual.Millisecond); } --- 102,113 ---- public static void AssertEquals(DateTime expected, DateTime actual, bool useMilliseconds) { ! Assert.AreEqual(expected.Year, actual.Year, "Year"); ! Assert.AreEqual(expected.Month, actual.Month, "Month"); ! Assert.AreEqual(expected.Day, actual.Day, "Day"); ! Assert.AreEqual(expected.Hour, actual.Hour, "Hour"); ! Assert.AreEqual(expected.Minute, actual.Minute, "Minute"); ! Assert.AreEqual(expected.Second, actual.Second, "Second"); if(useMilliseconds) ! Assert.AreEqual(expected.Millisecond, actual.Millisecond, "Millisecond"); } |
From: Peter S. <sz...@us...> - 2004-09-20 17:46:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263/SqlCommandTest Modified Files: SqlDeleteBuilderFixture.cs SqlInsertBuilderFixture.cs SqlSelectBuilderFixture.cs SqlSimpleSelectBuilderFixture.cs SqlStringParameterFixture.cs SqlUpdateBuilderFixture.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: SqlDeleteBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlDeleteBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlDeleteBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.3 --- SqlDeleteBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 *************** *** 40,44 **** string expectedSql = "DELETE FROM test_delete_builder WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) { --- 40,44 ---- string expectedSql = "DELETE FROM test_delete_builder WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) { *************** *** 48,52 **** } } ! Assertion.AssertEquals("Two parameters", 2, numOfParameters); --- 48,52 ---- } } ! Assert.AreEqual(2, numOfParameters, "Two parameters"); *************** *** 59,67 **** secondParam.Name = "versionColumn"; ! Assertion.AssertEquals("firstParam Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("firstParam Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("secondParam Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("secondParam Name", secondParam.Name, actualParams[1].Name); --- 59,67 ---- secondParam.Name = "versionColumn"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "firstParam Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "firstParam Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "secondParam Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "secondParam Name"); Index: SqlSimpleSelectBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlSimpleSelectBuilderFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlSimpleSelectBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.2 --- SqlSimpleSelectBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 *************** *** 58,62 **** ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) --- 58,62 ---- ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) *************** *** 68,72 **** } } ! Assertion.AssertEquals("3 parameters", 3, numOfParameters); Parameter firstParam = new Parameter(); --- 68,72 ---- } } ! Assert.AreEqual(3, numOfParameters, "3 parameters"); Parameter firstParam = new Parameter(); *************** *** 82,93 **** thirdParam.Name = "where_frag_column"; ! Assertion.AssertEquals("First Parameter Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("First Parameter Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("Second Parameter Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("Second Parameter Name", secondParam.Name, actualParams[1].Name); ! Assertion.AssertEquals("Third Parameter Type", thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType); ! Assertion.AssertEquals("Third Parameter Name", thirdParam.Name, actualParams[2].Name); } --- 82,93 ---- thirdParam.Name = "where_frag_column"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "First Parameter Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "First Parameter Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "Second Parameter Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "Second Parameter Name"); ! Assert.AreEqual(thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType, "Third Parameter Type"); ! Assert.AreEqual(thirdParam.Name, actualParams[2].Name, "Third Parameter Name"); } Index: SqlUpdateBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlUpdateBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlUpdateBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.3 --- SqlUpdateBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 *************** *** 45,49 **** string expectedSql = "UPDATE test_update_builder SET intColumn = :intColumn, longColumn = :longColumn, literalColumn = 0, stringColumn = 5 WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) --- 45,49 ---- string expectedSql = "UPDATE test_update_builder SET intColumn = :intColumn, longColumn = :longColumn, literalColumn = 0, stringColumn = 5 WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) *************** *** 55,59 **** } } ! Assertion.AssertEquals("Four parameters", 4, numOfParameters); --- 55,59 ---- } } ! Assert.AreEqual(4, numOfParameters, "Four parameters"); *************** *** 74,88 **** fourthParam.Name = "versionColumn"; ! Assertion.AssertEquals("firstParam Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("firstParam Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("secondParam Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("secondParam Name", secondParam.Name, actualParams[1].Name); ! Assertion.AssertEquals("thirdParam Type", thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType); ! Assertion.AssertEquals("thirdParam Name", thirdParam.Name, actualParams[2].Name); ! Assertion.AssertEquals("fourthParam Type", fourthParam.SqlType.DbType, actualParams[3].SqlType.DbType); ! Assertion.AssertEquals("fourthParam Name", fourthParam.Name, actualParams[3].Name); --- 74,88 ---- fourthParam.Name = "versionColumn"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "firstParam Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "firstParam Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "secondParam Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "secondParam Name"); ! Assert.AreEqual(thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType, "thirdParam Type"); ! Assert.AreEqual(thirdParam.Name, actualParams[2].Name, "thirdParam Name"); ! Assert.AreEqual(fourthParam.SqlType.DbType, actualParams[3].SqlType.DbType, "fourthParam Type"); ! Assert.AreEqual(fourthParam.Name, actualParams[3].Name, "fourthParam Name"); Index: SqlStringParameterFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlStringParameterFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlStringParameterFixture.cs 19 Jul 2004 03:25:25 -0000 1.2 --- SqlStringParameterFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 *************** *** 28,34 **** cloned = (Parameter)original.Clone(); ! Assertion.Assert("Not the same object by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same DbType", original.SqlType.DbType, cloned.SqlType.DbType); ! Assertion.AssertEquals("Same Name", original.Name, cloned.Name); // change some of the values of the clone to ensure the original doesn't change --- 28,34 ---- cloned = (Parameter)original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same object by =="); ! Assert.AreEqual(original.SqlType.DbType, cloned.SqlType.DbType, "Same DbType"); ! Assert.AreEqual(original.Name, cloned.Name, "Same Name"); // change some of the values of the clone to ensure the original doesn't change *************** *** 37,42 **** cloned.Name = "Cloned name"; ! Assertion.Assert("Should not the same db type anymore", cloned.SqlType.DbType!=original.SqlType.DbType); ! Assertion.Assert("Should not the same name anymore", cloned.Name!=original.Name); --- 37,42 ---- cloned.Name = "Cloned name"; ! Assert.IsTrue(cloned.SqlType.DbType!=original.SqlType.DbType, "Should not the same db type anymore"); ! Assert.IsTrue(cloned.Name!=original.Name, "Should not the same name anymore"); *************** *** 55,62 **** cloned = (ParameterLength)original.Clone(); ! Assertion.Assert("Not the same object by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same DbType", original.SqlType.DbType, cloned.SqlType.DbType); ! Assertion.AssertEquals("Same Name", original.Name, cloned.Name); ! Assertion.AssertEquals("Same Length", original.Length, cloned.Length); // change some of the values of the clone to ensure the original doesn't change --- 55,62 ---- cloned = (ParameterLength)original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same object by =="); ! Assert.AreEqual(original.SqlType.DbType, cloned.SqlType.DbType, "Same DbType"); ! Assert.AreEqual(original.Name, cloned.Name, "Same Name"); ! Assert.AreEqual(original.Length, cloned.Length, "Same Length"); // change some of the values of the clone to ensure the original doesn't change *************** *** 66,72 **** cloned.Length = 175; ! Assertion.Assert("Should not the same db type anymore", cloned.SqlType.DbType!=original.SqlType.DbType); ! Assertion.Assert("Should not the same name anymore", cloned.Name!=original.Name); ! Assertion.Assert("Should not the same length anymore", cloned.Length!=original.Length); } --- 66,72 ---- cloned.Length = 175; ! Assert.IsTrue(cloned.SqlType.DbType!=original.SqlType.DbType, "Should not the same db type anymore"); ! Assert.IsTrue(cloned.Name!=original.Name, "Should not the same name anymore"); ! Assert.IsTrue(cloned.Length!=original.Length, "Should not the same length anymore"); } *************** *** 85,93 **** cloned = (ParameterPrecisionScale)original.Clone(); ! Assertion.Assert("Not the same object by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same DbType", original.SqlType.DbType, cloned.SqlType.DbType); ! Assertion.AssertEquals("Same Name", original.Name, cloned.Name); ! Assertion.AssertEquals("Same Precision", original.Precision, cloned.Precision); ! Assertion.AssertEquals("Same Scale", original.Scale, cloned.Scale); // change some of the values of the clone to ensure the original doesn't change --- 85,93 ---- cloned = (ParameterPrecisionScale)original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same object by =="); ! Assert.AreEqual(original.SqlType.DbType, cloned.SqlType.DbType, "Same DbType"); ! Assert.AreEqual(original.Name, cloned.Name, "Same Name"); ! Assert.AreEqual(original.Precision, cloned.Precision, "Same Precision"); ! Assert.AreEqual(original.Scale, cloned.Scale, "Same Scale"); // change some of the values of the clone to ensure the original doesn't change *************** *** 100,107 **** cloned.Scale = 4; ! Assertion.Assert("Should not the same db type anymore", cloned.SqlType.DbType!=original.SqlType.DbType); ! Assertion.Assert("Should not the same name anymore", cloned.Name!=original.Name); ! Assertion.Assert("Should not the same Precision anymore", cloned.Precision!=original.Precision); ! Assertion.Assert("Should not the same Scale anymore", cloned.Scale!=original.Scale); } --- 100,107 ---- cloned.Scale = 4; ! Assert.IsTrue(cloned.SqlType.DbType!=original.SqlType.DbType, "Should not the same db type anymore"); ! Assert.IsTrue(cloned.Name!=original.Name, "Should not the same name anymore"); ! Assert.IsTrue(cloned.Precision!=original.Precision, "Should not the same Precision anymore"); ! Assert.IsTrue(cloned.Scale!=original.Scale, "Should not the same Scale anymore"); } *************** *** 136,145 **** cloned = original.Clone(); ! Assertion.Assert("Not the same SqlString by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same # of parts", original.SqlParts.Length, cloned.SqlParts.Length); ! Assertion.Assert("First param not the same by ==", (original.SqlParts[1]==cloned.SqlParts[1])==false); ! Assertion.Assert("Second param not the same by ==", (original.SqlParts[3]==cloned.SqlParts[3])==false); ! Assertion.AssertEquals("The ToString() is the same", original.ToString(), cloned.ToString()); // modify the first parameter of the clone to ensure they are not the same --- 136,145 ---- cloned = original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same SqlString by =="); ! Assert.AreEqual(original.SqlParts.Length, cloned.SqlParts.Length, "Same # of parts"); ! Assert.IsTrue((original.SqlParts[1]==cloned.SqlParts[1])==false, "First param not the same by =="); ! Assert.IsTrue((original.SqlParts[3]==cloned.SqlParts[3])==false, "Second param not the same by =="); ! Assert.AreEqual(original.ToString(), cloned.ToString(), "The ToString() is the same"); // modify the first parameter of the clone to ensure they are not the same *************** *** 148,152 **** lastParamPart.Name = "modifiedOP2"; ! Assertion.Assert("Should not be the same ToString()", cloned.ToString()!=original.ToString()); } --- 148,152 ---- lastParamPart.Name = "modifiedOP2"; ! Assert.IsTrue(cloned.ToString()!=original.ToString(), "Should not be the same ToString()"); } Index: SqlSelectBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlSelectBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlSelectBuilderFixture.cs 19 Aug 2004 17:44:12 -0000 1.3 --- SqlSelectBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 *************** *** 62,67 **** } ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); ! Assertion.AssertEquals("One parameter", 1, numOfParams); Parameter firstParam = new Parameter(); --- 62,67 ---- } ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); ! Assert.AreEqual(1, numOfParams, "One parameter"); Parameter firstParam = new Parameter(); *************** *** 70,76 **** firstParam.Name = "identity_column"; ! Assertion.AssertEquals("First Parameter Type", firstParam.SqlType.DbType, expectedParam.SqlType.DbType); ! Assertion.AssertEquals("First Parameter TableAlias", firstParam.TableAlias, expectedParam.TableAlias); ! Assertion.AssertEquals("First Parameter Name", firstParam.Name, expectedParam.Name); --- 70,76 ---- firstParam.Name = "identity_column"; ! Assert.AreEqual(firstParam.SqlType.DbType, expectedParam.SqlType.DbType, "First Parameter Type"); ! Assert.AreEqual(firstParam.TableAlias, expectedParam.TableAlias, "First Parameter TableAlias"); ! Assert.AreEqual(firstParam.Name, expectedParam.Name, "First Parameter Name"); Index: SqlInsertBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlInsertBuilderFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlInsertBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.2 --- SqlInsertBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 *************** *** 39,43 **** string expectedSql = "INSERT INTO test_insert_builder (intColumn, longColumn, literalColumn, stringColumn) VALUES (:intColumn, :longColumn, 0, 5)"; ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) --- 39,43 ---- string expectedSql = "INSERT INTO test_insert_builder (intColumn, longColumn, literalColumn, stringColumn) VALUES (:intColumn, :longColumn, 0, 5)"; ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) *************** *** 50,54 **** } ! Assertion.AssertEquals("Two parameters", 2, numOfParameters); Parameter firstParam = new Parameter(); --- 50,54 ---- } ! Assert.AreEqual(2, numOfParameters, "Two parameters"); Parameter firstParam = new Parameter(); *************** *** 60,68 **** secondParam.Name = "longColumn"; ! Assertion.AssertEquals("First Parameter Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("First Parameter Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("Second Parameter Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("Second Parameter Name", secondParam.Name, actualParams[1].Name); --- 60,68 ---- secondParam.Name = "longColumn"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "First Parameter Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "First Parameter Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "Second Parameter Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "Second Parameter Name"); |
From: Peter S. <sz...@us...> - 2004-09-20 17:46:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263/NHSpecificTest Modified Files: BasicBinaryFixture.cs BasicClassFixture.cs ClassWithCompositeIdFixture.cs JoinedSubclassFixture.cs MapFixture.cs SimpleComponentFixture.cs SubclassFixture.cs UnsavedValueFixture.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: BasicClassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BasicClassFixture.cs 1 Sep 2004 00:10:28 -0000 1.5 --- BasicClassFixture.cs 20 Sep 2004 17:46:00 -0000 1.6 *************** *** 41,45 **** bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); ! Assertion.AssertNotNull(bc[index]); AssertPropertiesEqual(bc[index-1], bc[index]); --- 41,45 ---- bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); ! Assert.IsNotNull(bc[index]); AssertPropertiesEqual(bc[index-1], bc[index]); *************** *** 768,772 **** .List(); ! Assertion.AssertEquals(0, results.Count); s.Close(); --- 768,772 ---- .List(); ! Assert.AreEqual(0, results.Count); s.Close(); *************** *** 819,823 **** Assert.AreEqual(expected.DateTimeProperty, actual.DateTimeProperty, "DateTimeProperty"); Assert.AreEqual(expected.DecimalProperty, actual.DecimalProperty, "DecimalProperty using Assert should be AreEqual"); ! Assertion.Assert("DecimalProperty", expected.DecimalProperty.Equals(actual.DecimalProperty)); // Assert.AreEqual(expected.DoubleProperty, actual.DoubleProperty, 0, "DoubleProperty"); Assert.AreEqual(expected.Int16Property, actual.Int16Property, "Int16Property"); --- 819,823 ---- Assert.AreEqual(expected.DateTimeProperty, actual.DateTimeProperty, "DateTimeProperty"); Assert.AreEqual(expected.DecimalProperty, actual.DecimalProperty, "DecimalProperty using Assert should be AreEqual"); ! Assert.IsTrue(expected.DecimalProperty.Equals(actual.DecimalProperty), "DecimalProperty"); // Assert.AreEqual(expected.DoubleProperty, actual.DoubleProperty, 0, "DoubleProperty"); Assert.AreEqual(expected.Int16Property, actual.Int16Property, "Int16Property"); *************** *** 832,841 **** if(includeCollections) { ! ObjectAssertion.AssertEquals(expected.StringArray, actual.StringArray); ! ObjectAssertion.AssertEquals(expected.Int32Array, actual.Int32Array); ! ObjectAssertion.AssertEquals(expected.StringBag, actual.StringBag, false); ! ObjectAssertion.AssertEquals(expected.StringList, actual.StringList); ! ObjectAssertion.AssertEquals(expected.StringMap, actual.StringMap, true); ! ObjectAssertion.AssertEquals(expected.StringSet, actual.StringSet, false); } } --- 832,841 ---- if(includeCollections) { ! ObjectAssert.AssertEquals(expected.StringArray, actual.StringArray); ! ObjectAssert.AssertEquals(expected.Int32Array, actual.Int32Array); ! ObjectAssert.AssertEquals(expected.StringBag, actual.StringBag, false); ! ObjectAssert.AssertEquals(expected.StringList, actual.StringList); ! ObjectAssert.AssertEquals(expected.StringMap, actual.StringMap, true); ! ObjectAssert.AssertEquals(expected.StringSet, actual.StringSet, false); } } Index: SubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/SubclassFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SubclassFixture.cs 23 Aug 2004 13:13:25 -0000 1.2 --- SubclassFixture.cs 20 Sep 2004 17:46:00 -0000 1.3 *************** *** 56,65 **** // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssertion.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assertion.AssertNotNull(one2); // lets update the objects --- 56,65 ---- // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssert.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assert.IsNotNull(one2); // lets update the objects *************** *** 86,90 **** .List(); ! Assertion.AssertEquals(2, results3.Count); JoinedSubclassBase base3 = null; --- 86,90 ---- .List(); ! Assert.AreEqual(2, results3.Count); JoinedSubclassBase base3 = null; *************** *** 100,105 **** // verify the properties got updated ! ObjectAssertion.AssertPropertiesEqual(base2, base3); ! ObjectAssertion.AssertPropertiesEqual(one2, one3); s3.Delete(base3); --- 100,105 ---- // verify the properties got updated ! ObjectAssert.AssertPropertiesEqual(base2, base3); ! ObjectAssert.AssertPropertiesEqual(one2, one3); s3.Delete(base3); Index: SimpleComponentFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/SimpleComponentFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleComponentFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- SimpleComponentFixture.cs 20 Sep 2004 17:46:00 -0000 1.2 *************** *** 29,35 **** SimpleComponent simpleComp = (SimpleComponent)s.Load(typeof(SimpleComponent), 10); ! Assertion.AssertEquals(10, simpleComp.Key); ! Assertion.AssertEquals("TestCreated", simpleComp.Audit.CreatedUserId); ! Assertion.AssertEquals("TestUpdated", simpleComp.Audit.UpdatedUserId); t.Commit(); --- 29,35 ---- SimpleComponent simpleComp = (SimpleComponent)s.Load(typeof(SimpleComponent), 10); ! Assert.AreEqual(10, simpleComp.Key); ! Assert.AreEqual("TestCreated", simpleComp.Audit.CreatedUserId); ! Assert.AreEqual("TestUpdated", simpleComp.Audit.UpdatedUserId); t.Commit(); Index: JoinedSubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/JoinedSubclassFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclassFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- JoinedSubclassFixture.cs 20 Sep 2004 17:46:00 -0000 1.2 *************** *** 67,76 **** // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssertion.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assertion.AssertNotNull(one2); // lets update the objects --- 67,76 ---- // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssert.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assert.IsNotNull(one2); // lets update the objects *************** *** 97,101 **** .List(); ! Assertion.AssertEquals(2, results3.Count); JoinedSubclassBase base3 = null; --- 97,101 ---- .List(); ! Assert.AreEqual(2, results3.Count); JoinedSubclassBase base3 = null; *************** *** 111,116 **** // verify the properties got updated ! ObjectAssertion.AssertPropertiesEqual(base2, base3); ! ObjectAssertion.AssertPropertiesEqual(one2, one3); s3.Delete(base3); --- 111,116 ---- // verify the properties got updated ! ObjectAssert.AssertPropertiesEqual(base2, base3); ! ObjectAssert.AssertPropertiesEqual(one2, one3); s3.Delete(base3); Index: BasicBinaryFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicBinaryFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicBinaryFixture.cs 31 Aug 2004 21:24:38 -0000 1.4 --- BasicBinaryFixture.cs 20 Sep 2004 17:46:00 -0000 1.5 *************** *** 93,98 **** Assert.IsFalse(bcBinary==bcBinaryLoaded); ! ObjectAssertion.AssertEquals(bcBinary.DefaultSize, bcBinaryLoaded.DefaultSize); ! ObjectAssertion.AssertEquals(bcBinary.WithSize, bcBinaryLoaded.WithSize); s.Delete(bcBinaryLoaded); --- 93,98 ---- Assert.IsFalse(bcBinary==bcBinaryLoaded); ! ObjectAssert.AssertEquals(bcBinary.DefaultSize, bcBinaryLoaded.DefaultSize); ! ObjectAssert.AssertEquals(bcBinary.WithSize, bcBinaryLoaded.WithSize); s.Delete(bcBinaryLoaded); *************** *** 128,132 **** Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); // WithSize should not have been updated ! ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(10) ); // lets modify WithSize --- 128,132 ---- Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); // WithSize should not have been updated ! ObjectAssert.AssertEquals( bcBinary.WithSize, GetByteArray(10) ); // lets modify WithSize *************** *** 142,146 **** Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); ! ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(20) ); s.Delete(bcBinary); --- 142,146 ---- Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); ! ObjectAssert.AssertEquals( bcBinary.WithSize, GetByteArray(20) ); s.Delete(bcBinary); Index: UnsavedValueFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/UnsavedValueFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UnsavedValueFixture.cs 16 Aug 2004 05:15:10 -0000 1.2 --- UnsavedValueFixture.cs 20 Sep 2004 17:46:00 -0000 1.3 *************** *** 36,40 **** // simple should have been inserted - generating a new key for it ! Assertion.Assert("Id should not be zero", unsavedToSave.Id != 0); // use the ICriteria interface to get another instance in a different --- 36,40 ---- // simple should have been inserted - generating a new key for it ! Assert.IsTrue(unsavedToSave.Id != 0, "Id should not be zero"); // use the ICriteria interface to get another instance in a different *************** *** 47,56 **** .List(); ! Assertion.AssertEquals("Should have found a match for the new Id", 1, results2.Count); UnsavedType unsavedToUpdate = (UnsavedType)results2[0]; // make sure it has the same Id ! Assertion.AssertEquals("Should have the same Id", unsavedToSave.Id, unsavedToUpdate.Id); t2.Commit(); --- 47,56 ---- .List(); ! Assert.AreEqual(1, results2.Count, "Should have found a match for the new Id"); UnsavedType unsavedToUpdate = (UnsavedType)results2[0]; // make sure it has the same Id ! Assert.AreEqual(unsavedToSave.Id, unsavedToUpdate.Id, "Should have the same Id"); t2.Commit(); *************** *** 71,75 **** // make sure it has the same Id - if the Id has changed then that means it // was inserted. ! Assertion.AssertEquals("Should have the same Id", unsavedToSave.Id, unsavedToUpdate.Id); // lets get a list of all the rows in the table to make sure --- 71,75 ---- // make sure it has the same Id - if the Id has changed then that means it // was inserted. ! Assert.AreEqual(unsavedToSave.Id, unsavedToUpdate.Id, "Should have the same Id"); // lets get a list of all the rows in the table to make sure *************** *** 79,87 **** IList results4 = s4.CreateCriteria(typeof(UnsavedType)).List(); ! Assertion.AssertEquals("Should only be one item", 1, results4.Count); // lets make sure the object was updated UnsavedType unsavedToDelete = (UnsavedType)results4[0]; ! Assertion.AssertEquals(unsavedToUpdate.TypeName, unsavedToDelete.TypeName); s4.Delete(unsavedToDelete); --- 79,87 ---- IList results4 = s4.CreateCriteria(typeof(UnsavedType)).List(); ! Assert.AreEqual(1, results4.Count, "Should only be one item"); // lets make sure the object was updated UnsavedType unsavedToDelete = (UnsavedType)results4[0]; ! Assert.AreEqual(unsavedToUpdate.TypeName, unsavedToDelete.TypeName); s4.Delete(unsavedToDelete); *************** *** 96,100 **** { UnsavedType unsavedNull = (UnsavedType)s5.Load(typeof(UnsavedType), unsavedToDelete.Id); ! Assertion.AssertNull(unsavedNull); } catch(ObjectNotFoundException onfe) --- 96,100 ---- { UnsavedType unsavedNull = (UnsavedType)s5.Load(typeof(UnsavedType), unsavedToDelete.Id); ! Assert.IsNull(unsavedNull); } catch(ObjectNotFoundException onfe) Index: ClassWithCompositeIdFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/ClassWithCompositeIdFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClassWithCompositeIdFixture.cs 16 Aug 2004 05:15:10 -0000 1.4 --- ClassWithCompositeIdFixture.cs 20 Sep 2004 17:46:00 -0000 1.5 *************** *** 87,91 **** .List(); ! Assertion.AssertEquals(1, results2.Count); ClassWithCompositeId theSecondClass2 = (ClassWithCompositeId)results2[0]; --- 87,91 ---- .List(); ! Assert.AreEqual(1, results2.Count); ClassWithCompositeId theSecondClass2 = (ClassWithCompositeId)results2[0]; *************** *** 93,104 **** // verify the same results through Criteria & Load were achieved ! Assertion.AssertSame(theClass2, theClass2Copy); // compare them to the objects created in the first session ! Assertion.AssertEquals(theClass.Id, theClass2.Id); ! Assertion.AssertEquals(theClass.OneProperty, theClass2.OneProperty); ! Assertion.AssertEquals(theSecondClass.Id, theSecondClass2.Id); ! Assertion.AssertEquals(theSecondClass.OneProperty, theSecondClass2.OneProperty); // test the update functionallity --- 93,104 ---- // verify the same results through Criteria & Load were achieved ! Assert.AreSame(theClass2, theClass2Copy); // compare them to the objects created in the first session ! Assert.AreEqual(theClass.Id, theClass2.Id); ! Assert.AreEqual(theClass.OneProperty, theClass2.OneProperty); ! Assert.AreEqual(theSecondClass.Id, theSecondClass2.Id); ! Assert.AreEqual(theSecondClass.OneProperty, theSecondClass2.OneProperty); // test the update functionallity *************** *** 120,125 **** // check the update properties ! Assertion.AssertEquals(theClass3.OneProperty, theClass2.OneProperty); ! Assertion.AssertEquals(theSecondClass3.OneProperty, theSecondClass2.OneProperty); // test the delete method --- 120,125 ---- // check the update properties ! Assert.AreEqual(theClass3.OneProperty, theClass2.OneProperty); ! Assert.AreEqual(theSecondClass3.OneProperty, theSecondClass2.OneProperty); // test the delete method *************** *** 147,151 **** .List(); ! Assertion.AssertEquals(0, results.Count); } --- 147,151 ---- .List(); ! Assert.AreEqual(0, results.Count); } Index: MapFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/MapFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- MapFixture.cs 20 Sep 2004 17:46:00 -0000 1.2 *************** *** 93,97 **** currentId = friend.Id; ! Assertion.Assert("Current should have a higher Id than previous", currentId > previousId); } --- 93,97 ---- currentId = friend.Id; ! Assert.IsTrue(currentId > previousId, "Current should have a higher Id than previous"); } |
From: Peter S. <sz...@us...> - 2004-09-20 17:46:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263/ExpressionTest Modified Files: BaseExpressionFixture.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: BaseExpressionFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest/BaseExpressionFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BaseExpressionFixture.cs 28 Jun 2004 18:59:06 -0000 1.3 --- BaseExpressionFixture.cs 20 Sep 2004 17:45:59 -0000 1.4 *************** *** 57,61 **** protected void CompareSqlStrings(SqlString actualSqlString, string expectedString) { ! Assertion.AssertEquals("SqlString.ToString()", expectedString, actualSqlString.ToString()); } --- 57,61 ---- protected void CompareSqlStrings(SqlString actualSqlString, string expectedString) { ! Assert.AreEqual(expectedString, actualSqlString.ToString(), "SqlString.ToString()"); } *************** *** 66,71 **** GetParameters(actualSqlString, ref actualParameters, ref numOfParameters); ! Assertion.AssertEquals("SqlString.ToString()", expectedString, actualSqlString.ToString()); ! Assertion.AssertEquals("Num of Parameters", expectedNumOfParameters, numOfParameters); } --- 66,71 ---- GetParameters(actualSqlString, ref actualParameters, ref numOfParameters); ! Assert.AreEqual(expectedString, actualSqlString.ToString(), "SqlString.ToString()"); ! Assert.AreEqual(expectedNumOfParameters, numOfParameters, "Num of Parameters"); } *************** *** 78,88 **** GetParameters(actualSqlString, ref actualParameters, ref numOfParameters); ! Assertion.AssertEquals("SqlString.ToString()", expectedString, actualSqlString.ToString()); ! Assertion.AssertEquals("Num of Parameters", expectedParameters.Length, numOfParameters); for(int i = 0; i < expectedParameters.Length; i++) { ! Assertion.AssertEquals("Parameter[" + i + "]", expectedParameters[i], actualParameters[i]); } } --- 78,88 ---- GetParameters(actualSqlString, ref actualParameters, ref numOfParameters); ! Assert.AreEqual(expectedString, actualSqlString.ToString(), "SqlString.ToString()"); ! Assert.AreEqual(expectedParameters.Length, numOfParameters, "Num of Parameters"); for(int i = 0; i < expectedParameters.Length; i++) { ! Assert.AreEqual(expectedParameters[i], actualParameters[i], "Parameter[" + i + "]"); } } |
From: Peter S. <sz...@us...> - 2004-09-20 17:46:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/DialectTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263/DialectTest Modified Files: DialectFixture.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: DialectFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/DialectTest/DialectFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DialectFixture.cs 16 Apr 2004 14:08:35 -0000 1.1 --- DialectFixture.cs 20 Sep 2004 17:45:59 -0000 1.2 *************** *** 119,123 **** actualUnquoted = d.UnQuote(new string[] {tableThatNeedsToBeQuoted[BeforeQuoteIndex], tableAlreadyQuoted[BeforeQuoteIndex] } ); ! ObjectAssertion.AssertEquals(expectedUnquoted, actualUnquoted, true); } --- 119,123 ---- actualUnquoted = d.UnQuote(new string[] {tableThatNeedsToBeQuoted[BeforeQuoteIndex], tableAlreadyQuoted[BeforeQuoteIndex] } ); ! ObjectAssert.AssertEquals(expectedUnquoted, actualUnquoted, true); } |
From: Peter S. <sz...@us...> - 2004-09-20 17:46:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CacheTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263/CacheTest Modified Files: CacheFixture.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: CacheFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CacheTest/CacheFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CacheFixture.cs 6 May 2004 20:56:59 -0000 1.1 --- CacheFixture.cs 20 Sep 2004 17:45:59 -0000 1.2 *************** *** 27,31 **** // cache something ! Assertion.Assert( ccs.Put("foo", "foo", before) ); System.Threading.Thread.Sleep(15); --- 27,31 ---- // cache something ! Assert.IsTrue( ccs.Put("foo", "foo", before) ); System.Threading.Thread.Sleep(15); *************** *** 33,39 **** long after = Timestamper.Next(); ! Assertion.AssertNull( ccs.Get("foo", longBefore) ); ! Assertion.AssertEquals( "foo", ccs.Get("foo", after) ); ! Assertion.Assert( !ccs.Put("foo", "foo", before) ); // update it; --- 33,39 ---- long after = Timestamper.Next(); ! Assert.IsNull( ccs.Get("foo", longBefore) ); ! Assert.AreEqual( "foo", ccs.Get("foo", after) ); ! Assert.IsFalse( ccs.Put("foo", "foo", before) ); // update it; *************** *** 41,47 **** ccs.Lock("foo"); ! Assertion.AssertNull( ccs.Get("foo", after) ); ! Assertion.AssertNull( ccs.Get("foo", longBefore) ); ! Assertion.Assert( !ccs.Put("foo", "foo", before) ); System.Threading.Thread.Sleep(15); --- 41,47 ---- ccs.Lock("foo"); ! Assert.IsNull( ccs.Get("foo", after) ); ! Assert.IsNull( ccs.Get("foo", longBefore) ); ! Assert.IsFalse( ccs.Put("foo", "foo", before) ); System.Threading.Thread.Sleep(15); *************** *** 49,53 **** long whileLocked = Timestamper.Next(); ! Assertion.Assert( !ccs.Put("foo", "foo", whileLocked) ); System.Threading.Thread.Sleep(15); --- 49,53 ---- long whileLocked = Timestamper.Next(); ! Assert.IsFalse( ccs.Put("foo", "foo", whileLocked) ); System.Threading.Thread.Sleep(15); *************** *** 55,62 **** ccs.Release("foo"); ! Assertion.AssertNull( ccs.Get("foo", after) ); ! Assertion.AssertNull( ccs.Get("foo", longBefore) ); ! Assertion.Assert( !ccs.Put("foo", "bar", whileLocked) ); ! Assertion.Assert( !ccs.Put("foo", "bar", after) ); System.Threading.Thread.Sleep(15); --- 55,62 ---- ccs.Release("foo"); ! Assert.IsNull( ccs.Get("foo", after) ); ! Assert.IsNull( ccs.Get("foo", longBefore) ); ! Assert.IsFalse( ccs.Put("foo", "bar", whileLocked) ); ! Assert.IsFalse( ccs.Put("foo", "bar", after) ); System.Threading.Thread.Sleep(15); *************** *** 64,70 **** long longAfter = Timestamper.Next(); ! Assertion.Assert( ccs.Put("foo", "baz", longAfter) ); ! Assertion.AssertNull( ccs.Get("foo", after) ); ! Assertion.AssertNull( ccs.Get("foo", whileLocked) ); System.Threading.Thread.Sleep(15); --- 64,70 ---- long longAfter = Timestamper.Next(); ! Assert.IsTrue( ccs.Put("foo", "baz", longAfter) ); ! Assert.IsNull( ccs.Get("foo", after) ); ! Assert.IsNull( ccs.Get("foo", whileLocked) ); System.Threading.Thread.Sleep(15); *************** *** 72,76 **** long longLongAfter = Timestamper.Next(); ! Assertion.AssertEquals("baz", ccs.Get("foo", longLongAfter) ); // update it again, with multiple locks --- 72,76 ---- long longLongAfter = Timestamper.Next(); ! Assert.AreEqual("baz", ccs.Get("foo", longLongAfter) ); // update it again, with multiple locks *************** *** 79,83 **** ccs.Lock("foo"); ! Assertion.AssertNull( ccs.Get("foo", longLongAfter) ); System.Threading.Thread.Sleep(15); --- 79,83 ---- ccs.Lock("foo"); ! Assert.IsNull( ccs.Get("foo", longLongAfter) ); System.Threading.Thread.Sleep(15); *************** *** 85,89 **** whileLocked = Timestamper.Next(); ! Assertion.Assert( !ccs.Put("foo", "foo", whileLocked) ); System.Threading.Thread.Sleep(15); --- 85,89 ---- whileLocked = Timestamper.Next(); ! Assert.IsFalse( ccs.Put("foo", "foo", whileLocked) ); System.Threading.Thread.Sleep(15); *************** *** 95,100 **** long betweenReleases = Timestamper.Next(); ! Assertion.Assert( !ccs.Put("foo", "bar", betweenReleases) ); ! Assertion.AssertNull( ccs.Get("foo", betweenReleases) ); System.Threading.Thread.Sleep(15); --- 95,100 ---- long betweenReleases = Timestamper.Next(); ! Assert.IsFalse( ccs.Put("foo", "bar", betweenReleases) ); ! Assert.IsNull( ccs.Get("foo", betweenReleases) ); System.Threading.Thread.Sleep(15); *************** *** 102,106 **** ccs.Release("foo"); ! Assertion.Assert( !ccs.Put("foo", "bar", whileLocked) ); System.Threading.Thread.Sleep(15); --- 102,106 ---- ccs.Release("foo"); ! Assert.IsFalse( ccs.Put("foo", "bar", whileLocked) ); System.Threading.Thread.Sleep(15); *************** *** 108,113 **** longAfter = Timestamper.Next(); ! Assertion.Assert( ccs.Put("foo", "baz", longAfter) ); ! Assertion.AssertNull( ccs.Get("foo", whileLocked) ); System.Threading.Thread.Sleep(15); --- 108,113 ---- longAfter = Timestamper.Next(); ! Assert.IsTrue( ccs.Put("foo", "baz", longAfter) ); ! Assert.IsNull( ccs.Get("foo", whileLocked) ); System.Threading.Thread.Sleep(15); *************** *** 115,119 **** longLongAfter = Timestamper.Next(); ! Assertion.AssertEquals("baz", ccs.Get("foo", longLongAfter) ); } --- 115,119 ---- longLongAfter = Timestamper.Next(); ! Assert.AreEqual("baz", ccs.Get("foo", longLongAfter) ); } |
From: Michael D. <mik...@us...> - 2004-09-20 03:04:44
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11329 Modified Files: releasenotes.txt Log Message: More items in release notes. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** releasenotes.txt 19 Sep 2004 16:55:51 -0000 1.13 --- releasenotes.txt 20 Sep 2004 03:04:35 -0000 1.14 *************** *** 6,10 **** - Fixed bug with Expression.Ge() not returning correct Expression. - PersistentCollection now implements ICollection (Donald Mull). ! - BatcherImpl and PreparerImpl were combined and code cleaned up thanks to problems found when using Ngpsql - ITransaction is now responsible for joining IDbCommand to IDbTransaction instead of IBatcher - if applicable. - Modified code to help improve performance of Drivers that don't support multiple Open DataReaders on a single IDbConnection. --- 6,10 ---- - Fixed bug with Expression.Ge() not returning correct Expression. - PersistentCollection now implements ICollection (Donald Mull). ! - BatcherImpl and PreparerImpl were combined and code cleaned up thanks to problems found when using Ngpsql (Martijn Boland). - ITransaction is now responsible for joining IDbCommand to IDbTransaction instead of IBatcher - if applicable. - Modified code to help improve performance of Drivers that don't support multiple Open DataReaders on a single IDbConnection. *************** *** 20,24 **** - DateTimeType.DeepCopyNotNull() cleaned up (Mark Traudt). - Added VersionProperty to IClassMetadata. ! Alpha Build 0.2.0.0 --- 20,25 ---- - DateTimeType.DeepCopyNotNull() cleaned up (Mark Traudt). - Added VersionProperty to IClassMetadata. ! - Renamed PrimitiveType to ValueTypeType to be more .net style consistent and fixed them up so they inherit from the appropriate class. ! - Fixed bug with caching an ObjectType. Alpha Build 0.2.0.0 |
From: Michael D. <mik...@us...> - 2004-09-20 03:03:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11186/src/NHibernate.Tool.hbm2net Modified Files: ClassMapping.cs Log Message: Removed code that treated a PrimitiveType differently than any other .net object because of the ValueType refactoring. Index: ClassMapping.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/ClassMapping.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassMapping.cs 13 Sep 2004 12:47:59 -0000 1.2 --- ClassMapping.cs 20 Sep 2004 03:03:41 -0000 1.3 *************** *** 882,896 **** if (basicType != null) { ! ! if ((basicType is PrimitiveType) && !hibernateType.Trim().Equals(basicType.ReturnedClass.Name) && !mustBeNullable) ! { ! cn = new ClassName(((PrimitiveType) basicType).PrimitiveClass.Name + postfix); ! return cn; ! } ! else ! { ! cn = new ClassName(basicType.ReturnedClass.Name + postfix); ! return cn; ! } } else --- 882,887 ---- if (basicType != null) { ! cn = new ClassName(basicType.ReturnedClass.Name + postfix); ! return cn; } else |
From: Michael D. <mik...@us...> - 2004-09-20 03:01:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/TypesTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/src/NHibernate.Test/TypesTest Modified Files: DateTimeTypeFixture.cs Log Message: Fixed up test for ValueType refactoring. Index: DateTimeTypeFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/TypesTest/DateTimeTypeFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DateTimeTypeFixture.cs 9 Sep 2004 21:20:16 -0000 1.1 --- DateTimeTypeFixture.cs 20 Sep 2004 03:01:25 -0000 1.2 *************** *** 20,32 **** object value1 = DateTime.Now; - object value2 = type.DeepCopyNotNull(value1); Assert.AreEqual( value1, value2, "Copies should be the same."); ! Assert.IsFalse( Object.ReferenceEquals(value1, value2), "Should be different objects in memory." ); value2 = ((DateTime)value2).AddHours(2); ! ! Assert.IsFalse( value1==value2, "value2 was changed, should not be the same." ); } } --- 20,30 ---- object value1 = DateTime.Now; object value2 = type.DeepCopyNotNull(value1); Assert.AreEqual( value1, value2, "Copies should be the same."); ! value2 = ((DateTime)value2).AddHours(2); ! Assert.IsFalse( value1==value2, "value2 was changed, value1 should not have changed also." ); } } |
From: Michael D. <mik...@us...> - 2004-09-20 03:00:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10443/src/NHibernate/Cfg Modified Files: Binder.cs Log Message: Refactored ValueTypes to inherit from ValueTypeType instead of PrimitiveType. Removed PrimitiveClass property so that changed Binder & QueryTranslator - it is not applicable in .net since the type system has no 'Primitives' Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Binder.cs 28 Aug 2004 15:31:07 -0000 1.30 --- Binder.cs 20 Sep 2004 03:00:17 -0000 1.31 *************** *** 668,674 **** IType type = GetTypeFromXML(subnode); ! model.ElementClass = model.IsPrimitiveArray ? ! ((PrimitiveType) type).PrimitiveClass : ! type.ReturnedClass; break; --- 668,672 ---- IType type = GetTypeFromXML(subnode); ! model.ElementClass = type.ReturnedClass; break; |