|
From: <fab...@us...> - 2009-05-14 21:35:15
|
Revision: 4306
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4306&view=rev
Author: fabiomaulo
Date: 2009-05-14 21:35:00 +0000 (Thu, 14 May 2009)
Log Message:
-----------
The user said that is a valid test... it not fail on trunk.
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Mappings.hbm.xml
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Principal.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedPrincipal.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedTeaml.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/StatelessTest.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Team.cs
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Mappings.hbm.xml
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Mappings.hbm.xml (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Mappings.hbm.xml 2009-05-14 21:35:00 UTC (rev 4306)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
+ assembly="NHibernate.Test"
+ namespace="NHibernate.Test.NHSpecificTest.NH1574">
+
+ <class name="SpecializedTeamStorage"
+ table="TeamStorage"
+ discriminator-value="-1963354017">
+ <id name="Id" type="Int32" column="TeamStorageID">
+ <generator class="hilo">
+ <param name="table">HiLoGenerator</param>
+ <param name="column">NextValue</param>
+ <param name="max_lo">100</param>
+ </generator>
+ </id>
+ <property name="Name" column="Name" type="String" length="450" />
+ <property name="EloRanking" column="EloRanking" type="Int32" />
+ <property name="MaxElo" column="MaxElo" type="Int32" />
+ <property name="MinElo" column="MinElo" type="Int32" />
+ <property name="CreationDate" column="CreationDate" type="DateTime" />
+ <property name="NumberPlayedBattles" column="NumberPlayedBattles" type="Int32" />
+ <property name="LadderActive" column="LadderActive" type="Boolean" />
+ <property name="LadderPosition" column="LadderPosition" type="Int32" />
+ <property name="IsInBattle" column="IsInBattle" type="Int32" />
+ <property name="RestUntil" column="RestUntil" type="Int32" />
+ <property name="StoppedUntil" column="StoppedUntil" type="Int32" />
+ <bag name="Principals" inverse="true" lazy="true">
+ <key column="TeamID" />
+ <one-to-many class="SpecializedPrincipal" />
+ </bag>
+ </class>
+
+ <class name="SpecializedPrincipal"
+ table="Principal"
+ discriminator-value="-2035371692">
+ <id name="Id" type="Int32" column="PrincipalID">
+ <generator class="hilo">
+ <param name="table">HiLoGenerator</param>
+ <param name="column">NextValue</param>
+ <param name="max_lo">100</param>
+ </generator>
+ </id>
+ <property name="IsBot" column="IsBot" type="Boolean" />
+ <property name="MyStatsId" column="MyStatsId" type="Int32" />
+ <property name="EloRanking" column="EloRanking" type="Int32" />
+ <property name="ReceiveMail" column="ReceiveMail" type="Boolean" />
+ <property name="Credits" column="Credits" type="Int32" />
+ <property name="LadderActive" column="LadderActive" type="Boolean" />
+ <property name="LadderPosition" column="LadderPosition" type="Int32" />
+ <property name="IsInBattle" column="IsInBattle" type="Int32" />
+ <property name="RestUntil" column="RestUntil" type="Int32" />
+ <property name="StoppedUntil" column="StoppedUntil" type="Int32" />
+ <property name="AvailableVacationTicks" column="AvailableVacationTicks" type="Int32" />
+ <property name="VacationStartTick" column="VacationStartTick" type="Int32" />
+ <property name="VacationEndtick" column="VacationEndtick" type="Int32" />
+ <property name="AutoStartVacations" column="AutoStartVacations" type="Boolean" />
+
+ <many-to-one name="Team" column="TeamID" not-null="false" />
+
+ <property name="Name" column="Name" type="String" length="200" />
+ <property name="Password" column="Password" type="String" length="50" />
+ <property name="Email" column="Email" type="String" length="200" />
+ <property name="Ip" column="Ip" type="String" length="15" />
+ <property name="RegistDate" column="RegistDate" type="DateTime" />
+ <property name="LastLogin" column="LastLogin" type="DateTime" />
+ <property name="Approved" column="Approved" type="Boolean" />
+ <property name="IsOnline" column="IsOnline" type="Boolean" />
+ <property name="Locked" column="Locked" type="Boolean" />
+ <property name="Locale" column="Locale" type="String" length="6" />
+ <property name="ConfirmationCode" column="ConfirmationCode" type="String" length="100" />
+ <property name="RawRoles" column="RawRoles" type="String" length="250" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Principal.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Principal.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Principal.cs 2009-05-14 21:35:00 UTC (rev 4306)
@@ -0,0 +1,283 @@
+using System;
+
+namespace NHibernate.Test.NHSpecificTest.NH1574
+{
+ public class Principal
+ {
+ private bool approved;
+ private bool autoStartVacations;
+ private int availableVacationTicks;
+ private string confirmationCode;
+ private int credits;
+ private int eloRanking;
+ private string email;
+ private string ip;
+ private bool isBot;
+ private int isInBattle;
+ private bool isOnline;
+ private bool ladderActive;
+ private int ladderPosition;
+ private DateTime lastLogin = DateTime.Now;
+ private string locale;
+ private bool locked;
+ private int myStatsId;
+ private string name;
+ private string password;
+ private string rawRoles;
+ private bool receiveMail;
+ private DateTime registDate = DateTime.Now;
+ private int restUntil;
+ private int stoppedUntil;
+ private int vacationEndtick;
+ private int vacationStartTick;
+
+ private int id;
+ private SpecializedTeamStorage team;
+
+ public virtual int Id
+ {
+ get { return id; }
+ set { id = value; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's IsBot
+ /// </summary>
+ public virtual bool IsBot
+ {
+ set { isBot = value; }
+ get { return isBot; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's MyStatsId
+ /// </summary>
+ public virtual int MyStatsId
+ {
+ set { myStatsId = value; }
+ get { return myStatsId; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's EloRanking
+ /// </summary>
+ public virtual int EloRanking
+ {
+ set { eloRanking = value; }
+ get { return eloRanking; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's ReceiveMail
+ /// </summary>
+ public virtual bool ReceiveMail
+ {
+ set { receiveMail = value; }
+ get { return receiveMail; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Credits
+ /// </summary>
+ public virtual int Credits
+ {
+ set { credits = value; }
+ get { return credits; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's LadderActive
+ /// </summary>
+ public virtual bool LadderActive
+ {
+ set { ladderActive = value; }
+ get { return ladderActive; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's LadderPosition
+ /// </summary>
+ public virtual int LadderPosition
+ {
+ set { ladderPosition = value; }
+ get { return ladderPosition; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's IsInBattle
+ /// </summary>
+ public virtual int IsInBattle
+ {
+ set { isInBattle = value; }
+ get { return isInBattle; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's RestUntil
+ /// </summary>
+ public virtual int RestUntil
+ {
+ set { restUntil = value; }
+ get { return restUntil; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's StoppedUntil
+ /// </summary>
+ public virtual int StoppedUntil
+ {
+ set { stoppedUntil = value; }
+ get { return stoppedUntil; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's AvailableVacationTicks
+ /// </summary>
+ public virtual int AvailableVacationTicks
+ {
+ set { availableVacationTicks = value; }
+ get { return availableVacationTicks; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's VacationStartTick
+ /// </summary>
+ public virtual int VacationStartTick
+ {
+ set { vacationStartTick = value; }
+ get { return vacationStartTick; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's VacationEndtick
+ /// </summary>
+ public virtual int VacationEndtick
+ {
+ set { vacationEndtick = value; }
+ get { return vacationEndtick; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's AutoStartVacations
+ /// </summary>
+ public virtual bool AutoStartVacations
+ {
+ set { autoStartVacations = value; }
+ get { return autoStartVacations; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Name
+ /// </summary>
+ public virtual string Name
+ {
+ set { name = value; }
+ get { return name; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Password
+ /// </summary>
+ public virtual string Password
+ {
+ set { password = value; }
+ get { return password; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Email
+ /// </summary>
+ public virtual string Email
+ {
+ set { email = value; }
+ get { return email; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Ip
+ /// </summary>
+ public virtual string Ip
+ {
+ set { ip = value; }
+ get { return ip; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's RegistDate
+ /// </summary>
+ public virtual DateTime RegistDate
+ {
+ set { registDate = value; }
+ get { return registDate; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's LastLogin
+ /// </summary>
+ public virtual DateTime LastLogin
+ {
+ set { lastLogin = value; }
+ get { return lastLogin; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Approved
+ /// </summary>
+ public virtual bool Approved
+ {
+ set { approved = value; }
+ get { return approved; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's IsOnline
+ /// </summary>
+ public virtual bool IsOnline
+ {
+ set { isOnline = value; }
+ get { return isOnline; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Locked
+ /// </summary>
+ public virtual bool Locked
+ {
+ set { locked = value; }
+ get { return locked; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's Locale
+ /// </summary>
+ public virtual string Locale
+ {
+ set { locale = value; }
+ get { return locale; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's ConfirmationCode
+ /// </summary>
+ public virtual string ConfirmationCode
+ {
+ set { confirmationCode = value; }
+ get { return confirmationCode; }
+ }
+
+ /// <summary>
+ /// Gets the Principal's RawRoles
+ /// </summary>
+ public virtual string RawRoles
+ {
+ set { rawRoles = value; }
+ get { return rawRoles; }
+ }
+
+ public virtual SpecializedTeamStorage Team
+ {
+ get { return team; }
+ set { team = value; }
+ }
+ } ;
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedPrincipal.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedPrincipal.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedPrincipal.cs 2009-05-14 21:35:00 UTC (rev 4306)
@@ -0,0 +1,4 @@
+namespace NHibernate.Test.NHSpecificTest.NH1574
+{
+ public class SpecializedPrincipal : Principal {} ;
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedTeaml.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedTeaml.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/SpecializedTeaml.cs 2009-05-14 21:35:00 UTC (rev 4306)
@@ -0,0 +1,4 @@
+namespace NHibernate.Test.NHSpecificTest.NH1574
+{
+ public class SpecializedTeamStorage : TeamStorage {} ;
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/StatelessTest.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/StatelessTest.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/StatelessTest.cs 2009-05-14 21:35:00 UTC (rev 4306)
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using NUnit.Framework;
+
+namespace NHibernate.Test.NHSpecificTest.NH1574
+{
+ [TestFixture]
+ public class StatelessTest : BugTestCase
+ {
+ [Test]
+ public void StatelessManyToOne()
+ {
+ using (ISession session = OpenSession())
+ {
+ var principal = new SpecializedPrincipal();
+ var team = new SpecializedTeamStorage();
+ principal.Team = team;
+ session.SaveOrUpdate(team);
+ session.SaveOrUpdate(principal);
+ session.Flush();
+ }
+
+ using (IStatelessSession session = sessions.OpenStatelessSession())
+ {
+ IQuery query = session.CreateQuery("from SpecializedPrincipal p");
+ IList<Principal> principals = query.List<Principal>();
+ Assert.AreEqual(1, principals.Count);
+
+ ITransaction trans = session.BeginTransaction();
+ foreach (var principal in principals)
+ {
+ principal.Name = "Buu";
+ session.Update(principal);
+ }
+ trans.Commit();
+ }
+
+ // cleanup
+ using (ISession session = OpenSession())
+ {
+ session.Delete("from SpecializedTeamStorage");
+ session.Delete("from SpecializedPrincipal");
+ session.Flush();
+ }
+ }
+ }
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Team.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Team.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1574/Team.cs 2009-05-14 21:35:00 UTC (rev 4306)
@@ -0,0 +1,134 @@
+using System;
+using System.Collections.Generic;
+
+namespace NHibernate.Test.NHSpecificTest.NH1574
+{
+ public class TeamStorage
+ {
+ private DateTime creationDate = DateTime.Now;
+ private int eloRanking;
+ private int isInBattle;
+ private bool ladderActive;
+ private int ladderPosition;
+ private int maxElo;
+ private int minElo;
+ private string name;
+ private int numberPlayedBattles;
+ private int restUntil;
+ private int stoppedUntil;
+
+ private int id;
+ private IList<Principal> principals;
+
+ /// <summary>
+ /// Gets the TeamStorage's Name
+ /// </summary>
+ public virtual string Name
+ {
+ set { name = value; }
+ get { return name; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's EloRanking
+ /// </summary>
+ public virtual int EloRanking
+ {
+ set { eloRanking = value; }
+ get { return eloRanking; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's MaxElo
+ /// </summary>
+ public virtual int MaxElo
+ {
+ set { maxElo = value; }
+ get { return maxElo; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's MinElo
+ /// </summary>
+ public virtual int MinElo
+ {
+ set { minElo = value; }
+ get { return minElo; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's CreationDate
+ /// </summary>
+ public virtual DateTime CreationDate
+ {
+ set { creationDate = value; }
+ get { return creationDate; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's NumberPlayedBattles
+ /// </summary>
+ public virtual int NumberPlayedBattles
+ {
+ set { numberPlayedBattles = value; }
+ get { return numberPlayedBattles; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's LadderActive
+ /// </summary>
+ public virtual bool LadderActive
+ {
+ set { ladderActive = value; }
+ get { return ladderActive; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's LadderPosition
+ /// </summary>
+ public virtual int LadderPosition
+ {
+ set { ladderPosition = value; }
+ get { return ladderPosition; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's IsInBattle
+ /// </summary>
+ public virtual int IsInBattle
+ {
+ set { isInBattle = value; }
+ get { return isInBattle; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's RestUntil
+ /// </summary>
+ public virtual int RestUntil
+ {
+ set { restUntil = value; }
+ get { return restUntil; }
+ }
+
+ /// <summary>
+ /// Gets the TeamStorage's StoppedUntil
+ /// </summary>
+ public virtual int StoppedUntil
+ {
+ set { stoppedUntil = value; }
+ get { return stoppedUntil; }
+ }
+
+ public virtual IList<Principal> Principals
+ {
+ get { return principals; }
+ set { principals = value; }
+ }
+
+ public virtual int Id
+ {
+ get { return id; }
+ set { id = value; }
+ }
+ } ;
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-14 21:10:28 UTC (rev 4305)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-14 21:35:00 UTC (rev 4306)
@@ -329,6 +329,11 @@
<Compile Include="HQL\BaseFunctionFixture.cs" />
<Compile Include="MappingTest\NonReflectiveBinderFixture.cs" />
<Compile Include="MappingTest\Wicked.cs" />
+ <Compile Include="NHSpecificTest\NH1574\Principal.cs" />
+ <Compile Include="NHSpecificTest\NH1574\SpecializedPrincipal.cs" />
+ <Compile Include="NHSpecificTest\NH1574\SpecializedTeaml.cs" />
+ <Compile Include="NHSpecificTest\NH1574\StatelessTest.cs" />
+ <Compile Include="NHSpecificTest\NH1574\Team.cs" />
<Compile Include="NHSpecificTest\Dates\TimeFixture.cs" />
<Compile Include="NHSpecificTest\DtcFailures\DtcFailuresFixture.cs" />
<Compile Include="NHSpecificTest\DtcFailures\Person.cs" />
@@ -1777,6 +1782,7 @@
<EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" />
<EmbeddedResource Include="Ado\VerySimple.hbm.xml" />
<Content Include="DynamicEntity\package.html" />
+ <EmbeddedResource Include="NHSpecificTest\NH1574\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1776\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1773\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1760\Mappings.hbm.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|