Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14693/Data/NHibernate
Modified Files:
Credit.hbm.xml Debit.hbm.xml NHDAOTests.cs NHDAOTests.xml
Log Message:
udpate nh mappings.
Index: Credit.hbm.xml
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/Credit.hbm.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Credit.hbm.xml 31 May 2007 20:25:14 -0000 1.1
--- Credit.hbm.xml 30 May 2008 21:11:55 -0000 1.2
***************
*** 1,6 ****
<?xml version="1.0" encoding="utf-8" ?>
! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Spring.Data.NHibernate.Credit, Spring.Data.NHibernate.Integration.Tests"
! table="Credits">
<id name="CreditID" column="CreditID" type="Int32">
<generator class="identity" />
--- 1,6 ----
<?xml version="1.0" encoding="utf-8" ?>
! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Spring.Data.NHibernate.Credit, Spring.Data.NHibernate.Integration.Tests"
! table="Credits" lazy="false">
<id name="CreditID" column="CreditID" type="Int32">
<generator class="identity" />
Index: NHDAOTests.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/NHDAOTests.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NHDAOTests.cs 31 May 2007 20:25:14 -0000 1.1
--- NHDAOTests.cs 30 May 2008 21:11:55 -0000 1.2
***************
*** 28,31 ****
--- 28,32 ----
using Spring.Context.Support;
using Spring.Data.Common;
+ using Spring.Data.NHibernate.Support;
#endregion
***************
*** 72,75 ****
--- 73,81 ----
ctx =
new XmlApplicationContext("assembly://Spring.Data.NHibernate.Integration.Tests/Spring.Data.NHibernate/NHDAOTests.xml");
+ ctx.Name = AbstractApplicationContext.DefaultRootContextName;
+ if (!ContextRegistry.IsContextRegistered(AbstractApplicationContext.DefaultRootContextName))
+ {
+ ContextRegistry.RegisterContext(ctx);
+ }
}
***************
*** 88,93 ****
--- 94,113 ----
#endif
}
+
[Test]
+ public void SessionScopeOutsideTransaction()
+ {
+ float transferAmount = 113;
+ using (new SessionScope())
+ {
+ IAccountManager mgr = null;
+ mgr = ctx["accountManager"] as IAccountManager;
+ Assert.IsNotNull(mgr, "accountManager not of expected type. Type = " + ctx["accountManager"].GetType().ToString());
+ mgr.DoTransfer(transferAmount, transferAmount);
+ }
+ }
+
+ [Test]
public void DeclarativeWithAttributes()
{
***************
*** 109,116 ****
Assert.IsTrue(DoesNotContainNewData(transferAmount));
}
- else
- {
- Assert.Fail("Should have thrown an exception in DAO layer");
- }
}
}
--- 129,132 ----
Index: NHDAOTests.xml
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/NHDAOTests.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NHDAOTests.xml 7 Aug 2007 19:50:49 -0000 1.2
--- NHDAOTests.xml 30 May 2008 21:11:55 -0000 1.3
***************
*** 4,17 ****
<db:provider id="DbProvider"
! provider="SqlServer-1.1"
! connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
! <object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate">
! <!-- TODO Provide dedicated NHibernate Schema -->
- <!-- If you specify DbProvider then don't specify the connection string below.
- <property name="DbProvider" ref="DbProvider"/>
- -->
<property name="MappingAssemblies">
--- 4,14 ----
<db:provider id="DbProvider"
! provider="System.Data.SqlClient"
! connectionString="Data Source=MARKT60\SQL2005;Initial Catalog=CreditsAndDebits;User ID=springqa;Password=springqa"/>
! <object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate12">
! <property name="DbProvider" ref="DbProvider"/>
<property name="MappingAssemblies">
***************
*** 25,32 ****
<entry key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"/>
!
! <entry key="hibernate.connection.connection_string"
! value="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
!
<entry key="hibernate.dialect"
value="NHibernate.Dialect.MsSql2000Dialect"/>
--- 22,26 ----
<entry key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"/>
!
<entry key="hibernate.dialect"
value="NHibernate.Dialect.MsSql2000Dialect"/>
***************
*** 74,78 ****
<object id="hibernateTransactionManager"
! type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate">
<!-- Comment out DbProvider if you want to have the tx mgr infer the DbProvider from
the session factory. -->
--- 68,72 ----
<object id="hibernateTransactionManager"
! type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate12">
<!-- Comment out DbProvider if you want to have the tx mgr infer the DbProvider from
the session factory. -->
Index: Debit.hbm.xml
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/Debit.hbm.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Debit.hbm.xml 31 May 2007 20:25:14 -0000 1.1
--- Debit.hbm.xml 30 May 2008 21:11:55 -0000 1.2
***************
*** 1,6 ****
<?xml version="1.0" encoding="utf-8" ?>
! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Spring.Data.NHibernate.Debit, Spring.Data.NHibernate.Integration.Tests"
! table="Debits">
<id name="DebitID" column="DebitID" type="Int32">
<generator class="identity" />
--- 1,6 ----
<?xml version="1.0" encoding="utf-8" ?>
! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Spring.Data.NHibernate.Debit, Spring.Data.NHibernate.Integration.Tests"
! table="Debits" lazy="false">
<id name="DebitID" column="DebitID" type="Int32">
<generator class="identity" />
|