From: <fab...@us...> - 2009-05-27 23:06:13
|
Revision: 4389 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4389&view=rev Author: fabiomaulo Date: 2009-05-27 23:06:09 +0000 (Wed, 27 May 2009) Log Message: ----------- Test for a bug (NH-1805) to fix Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/MappingTest/NonReflectiveBinderFixture.cs trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.cs trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.hbm.xml Modified: trunk/nhibernate/src/NHibernate.Test/MappingTest/NonReflectiveBinderFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingTest/NonReflectiveBinderFixture.cs 2009-05-25 22:26:28 UTC (rev 4388) +++ trunk/nhibernate/src/NHibernate.Test/MappingTest/NonReflectiveBinderFixture.cs 2009-05-27 23:06:09 UTC (rev 4389) @@ -82,7 +82,7 @@ MetaAttribute metaAttribute = cm.GetMetaAttribute("globalmutated"); Assert.That(metaAttribute, Is.Not.Null); - /*assertEquals( metaAttribute.getValues().size(), 2 ); + /*assertEquals( metaAttribute.getValues().size(), 2 ); assertEquals( "top level", metaAttribute.getValues().get(0) );*/ Assert.That(metaAttribute.Value, Is.EqualTo("wicked level")); @@ -90,8 +90,8 @@ MetaAttribute propertyAttribute = property.GetMetaAttribute("globalmutated"); Assert.That(propertyAttribute, Is.Not.Null); - /*assertEquals( propertyAttribute.getValues().size(), 3 ); - assertEquals( "top level", propertyAttribute.getValues().get(0) ); + /*assertEquals( propertyAttribute.getValues().size(), 3 ); + assertEquals( "top level", propertyAttribute.getValues().get(0) ); assertEquals( "wicked level", propertyAttribute.getValues().get(1) );*/ Assert.That(propertyAttribute.Value, Is.EqualTo("monetaryamount level")); @@ -100,9 +100,9 @@ propertyAttribute = property.GetMetaAttribute("globalmutated"); Assert.That(propertyAttribute, Is.Not.Null); - /*assertEquals( propertyAttribute.getValues().size(), 4 ); - assertEquals( "top level", propertyAttribute.getValues().get(0) ); - assertEquals( "wicked level", propertyAttribute.getValues().get(1) ); + /*assertEquals( propertyAttribute.getValues().size(), 4 ); + assertEquals( "top level", propertyAttribute.getValues().get(0) ); + assertEquals( "wicked level", propertyAttribute.getValues().get(1) ); assertEquals( "monetaryamount level", propertyAttribute.getValues().get(2) );*/ Assert.That(propertyAttribute.Value, Is.EqualTo("monetaryamount x level")); @@ -110,8 +110,8 @@ propertyAttribute = property.GetMetaAttribute("globalmutated"); Assert.That(propertyAttribute, Is.Not.Null); - /*assertEquals( propertyAttribute.getValues().size(), 3 ); - assertEquals( "top level", propertyAttribute.getValues().get(0) ); + /*assertEquals( propertyAttribute.getValues().size(), 3 ); + assertEquals( "top level", propertyAttribute.getValues().get(0) ); assertEquals( "wicked level", propertyAttribute.getValues().get(1) );*/ Assert.That(propertyAttribute.Value, Is.EqualTo("sortedemployee level")); @@ -119,7 +119,7 @@ propertyAttribute = property.GetMetaAttribute("globalmutated"); Assert.That(propertyAttribute, Is.Not.Null); - /*assertEquals( propertyAttribute.getValues().size(), 2 ); + /*assertEquals( propertyAttribute.getValues().size(), 2 ); assertEquals( "top level", propertyAttribute.getValues().get(0) );*/ Assert.That(propertyAttribute.Value, Is.EqualTo("wicked level")); @@ -129,8 +129,8 @@ Assert.That(component.MetaAttributes.Count, Is.EqualTo(4)); metaAttribute = component.GetMetaAttribute("globalmutated"); - /*assertEquals( metaAttribute.getValues().size(), 3 ); - assertEquals( "top level", metaAttribute.getValues().get(0) ); + /*assertEquals( metaAttribute.getValues().size(), 3 ); + assertEquals( "top level", metaAttribute.getValues().get(0) ); assertEquals( "wicked level", metaAttribute.getValues().get(1) );*/ Assert.That(metaAttribute.Value, Is.EqualTo("monetaryamount anotherSet composite level")); @@ -138,9 +138,9 @@ propertyAttribute = property.GetMetaAttribute("globalmutated"); Assert.That(propertyAttribute, Is.Not.Null); - /*assertEquals( propertyAttribute.getValues().size(), 4 ); - assertEquals( "top level", propertyAttribute.getValues().get(0) ); - assertEquals( "wicked level", propertyAttribute.getValues().get(1) ); + /*assertEquals( propertyAttribute.getValues().size(), 4 ); + assertEquals( "top level", propertyAttribute.getValues().get(0) ); + assertEquals( "wicked level", propertyAttribute.getValues().get(1) ); assertEquals( "monetaryamount anotherSet composite level", propertyAttribute.getValues().get(2) );*/ Assert.That(propertyAttribute.Value, Is.EqualTo("monetaryamount anotherSet composite property emp level")); @@ -148,9 +148,9 @@ propertyAttribute = property.GetMetaAttribute("globalmutated"); Assert.That(propertyAttribute, Is.Not.Null); - /*assertEquals( propertyAttribute.getValues().size(), 4 ); - assertEquals( "top level", propertyAttribute.getValues().get(0) ); - assertEquals( "wicked level", propertyAttribute.getValues().get(1) ); + /*assertEquals( propertyAttribute.getValues().size(), 4 ); + assertEquals( "top level", propertyAttribute.getValues().get(0) ); + assertEquals( "wicked level", propertyAttribute.getValues().get(1) ); assertEquals( "monetaryamount anotherSet composite level", propertyAttribute.getValues().get(2) );*/ Assert.That(propertyAttribute.Value, Is.EqualTo("monetaryamount anotherSet composite property empinone level")); } @@ -164,5 +164,13 @@ var col = (Mapping.Collection)property.Value; Assert.That(col.ComparerClassName, Text.StartsWith("NHibernate.Test.MappingTest.NonExistingComparator")); } + + [Test, Ignore("Not fixed yet.")] + public void ReadSubClasses() + { + PersistentClass cm = cfg.GetClassMapping("NHibernate.Test.MappingTest.DomesticAnimal"); + MetaAttribute metaAttribute = cm.GetMetaAttribute("Auditable"); + Assert.That(metaAttribute, Is.Not.Null); + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.cs 2009-05-25 22:26:28 UTC (rev 4388) +++ trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.cs 2009-05-27 23:06:09 UTC (rev 4389) @@ -1,3 +1,4 @@ +using System; using System.Collections; using Iesi.Collections; @@ -23,4 +24,32 @@ public string Emp { get; set; } public Employee Empinone { get; set; } } + + public class Animal + { + public virtual string Description { get; set; } + } + + public class Reptile : Animal + { + public virtual double BodyTemperature { get; set; } + } + + public class Lizard : Reptile { } + + public class Mammal : Animal + { + public virtual bool Pregnant { get; set; } + public virtual DateTime Birthdate { get; set; } + } + + public class DomesticAnimal : Animal + { + public virtual string Name { get; set; } + public virtual Employee Owner { get; set; } + } + + public class Cat : Animal { } + + public class Dog : Animal { } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.hbm.xml 2009-05-25 22:26:28 UTC (rev 4388) +++ trunk/nhibernate/src/NHibernate.Test/MappingTest/Wicked.hbm.xml 2009-05-27 23:06:09 UTC (rev 4389) @@ -56,5 +56,28 @@ <generator class="assigned"/> </id> </class> + + <class name="Animal" abstract="true"> + <id type="int"> + <generator class="hilo"/> + </id> + <discriminator column="ObjectType"/> + <property name="Description"/> + <subclass name="Reptile"> + <property name="BodyTemperature"/> + <subclass name="Lizard"/> + </subclass> + <subclass name="Mammal"> + <property name="Pregnant"/> + <property name="Birthdate" type="Date"/> + <subclass name="DomesticAnimal"> + <meta attribute="Auditable"/> + <property name="Name"/> + <many-to-one name="Owner"/> + <subclass name="Cat"/> + <subclass name="Dog"/> + </subclass> + </subclass> + </class> </hibernate-mapping> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |