upgraded Spring.Data.NHibernate20.Integration.Tests to test.integration.data
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("Spring.Data.Integration Tests")]
|
||||
[assembly: AssemblyDescription("Integration tests for Spring.Data assembly")]
|
||||
@@ -117,7 +117,6 @@
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Data\AccountCreditDao.cs" />
|
||||
<Compile Include="Data\AccountDebitDao.cs" />
|
||||
<Compile Include="Data\AccountManager.cs" />
|
||||
@@ -179,6 +178,7 @@
|
||||
<EmbeddedResource Include="Data\templateTests.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Spring.Data.Integration.Tests.build" />
|
||||
<None Include="Spring.Data.Integration.Tests.dll.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -1,44 +1,39 @@
|
||||
<?xml version="1.0" ?>
|
||||
<project name="Spring.Data.Integration.Tests" default="test" xmlns="http://nant.sf.net/schemas/nant.xsd">
|
||||
|
||||
<include buildfile="${spring.basedir}/common-project.include" />
|
||||
|
||||
<!--
|
||||
Required properties:
|
||||
* current.bin.dir - (path) root level to build to
|
||||
* current.build.debug - (true|false) debug build?
|
||||
* current.build.defines.csc - framework-specific build defines for C# compiler
|
||||
-->
|
||||
<target name="build">
|
||||
<!-- build Spring.Data.Integration.Tests -->
|
||||
<csc target="library" define="${current.build.defines.csc}"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
output="${current.bin.dir}/${project::get-name()}.dll"
|
||||
doc="${current.bin.dir}/${project::get-name()}.xml">
|
||||
<nowarn>
|
||||
<warning number="${nowarn.numbers.test}" />
|
||||
</nowarn>
|
||||
<sources failonempty="true">
|
||||
<include name="**/*.cs" />
|
||||
<include name="../CommonAssemblyInfo.cs" />
|
||||
</sources>
|
||||
<resources basedir="Resources">
|
||||
<include name="**/*" />
|
||||
</resources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<include name="*.dll" />
|
||||
<include name="System.Data.OracleClient.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
<exclude name="CloverRuntime.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
<target name="test" depends="build">
|
||||
<!-- skipping running of tests for now
|
||||
<nunit2outproc>
|
||||
<formatter type="Plain" />
|
||||
<formatter type="Xml" usefile="true" extension=".xml"
|
||||
outputdir="${current.bin.dir}/results" />
|
||||
<test assemblyname="${current.bin.dir}/${project::get-name()}.dll" />
|
||||
</nunit2outproc>
|
||||
-->
|
||||
</target>
|
||||
<target name="build">
|
||||
<!-- build Spring.Data.Integration.Tests -->
|
||||
<csc target="library" define="${current.build.defines.csc}"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
output="${current.bin.dir}/${project::get-name()}.dll"
|
||||
doc="${current.bin.dir}/${project::get-name()}.xml">
|
||||
<nowarn>
|
||||
<warning number="${nowarn.numbers.test}" />
|
||||
</nowarn>
|
||||
<sources failonempty="true">
|
||||
<include name="**/*.cs" />
|
||||
</sources>
|
||||
<resources basedir="Resources">
|
||||
<include name="**/*" />
|
||||
</resources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<include name="*.dll" />
|
||||
<include name="System.Data.OracleClient.dll" />
|
||||
<exclude name="${project::get-name()}.dll" />
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
<target name="test" depends="build">
|
||||
<!-- skipping running of tests for now -->
|
||||
<!-- call target="common.run-tests" if="${test.integration.data}" / -->
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle("Spring.Data.NHibernate20 Integration Tests")]
|
||||
[assembly: AssemblyDescription("Integration tests for Spring.Data.NHibernate20 assembly")]
|
||||
@@ -2,13 +2,13 @@
|
||||
<objects xmlns='http://www.springframework.net'
|
||||
xmlns:db="http://www.springframework.net/database">
|
||||
|
||||
<db:provider id="DbProvider1"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
<db:provider id="DbProvider1"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=SPRINGQA;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
|
||||
<db:provider id="DbProvider2"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
<db:provider id="DbProvider2"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=SPRINGQA;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
|
||||
<object id="SessionFactory1" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate20">
|
||||
|
||||
@@ -72,9 +72,9 @@
|
||||
<property name="SessionFactory" ref="SessionFactory2"/>
|
||||
</object>
|
||||
|
||||
|
||||
|
||||
<!-- The DAO object that performs multiple data access operations -->
|
||||
<object id="accountManagerTarget"
|
||||
<object id="accountManagerTarget"
|
||||
type="Spring.Data.NHibernate.AccountManager, Spring.Data.NHibernate20.Integration.Tests">
|
||||
<property name="AccountCreditDao" ref="AccountCreditDao"/>
|
||||
<property name="AccountDebitDao" ref="AccountDebitDao"/>
|
||||
@@ -105,7 +105,7 @@
|
||||
-->
|
||||
|
||||
<!-- Transactional Proxy for TestObjectManager using the ProxyFactoryObject -->
|
||||
<object id="accountManager"
|
||||
<object id="accountManager"
|
||||
type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
|
||||
|
||||
<property name="Target" ref="accountManagerTarget"/>
|
||||
@@ -117,7 +117,7 @@
|
||||
</object>
|
||||
|
||||
<!-- Transaction Interceptor based on attribute [Transaction()] -->
|
||||
<object id="transactionInterceptor"
|
||||
<object id="transactionInterceptor"
|
||||
type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
|
||||
<property name="TransactionManager" ref="transactionManager"/>
|
||||
<!-- note do not have converter from string to this property type registered -->
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<objects xmlns='http://www.springframework.net'
|
||||
xmlns:db="http://www.springframework.net/database">
|
||||
|
||||
<db:provider id="DbProvider"
|
||||
provider="System.Data.SqlClient"
|
||||
connectionString="Data Source=MARKT60\SQL2005;Initial Catalog=CreditsAndDebits;User ID=springqa;Password=springqa"/>
|
||||
<db:provider id="DbProvider"
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=SPRINGQA;Initial Catalog=Spring;User ID=springqa;Password=springqa"/>
|
||||
|
||||
|
||||
<object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate20">
|
||||
<property name="DbProvider" ref="DbProvider"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="MappingAssemblies">
|
||||
<list>
|
||||
<value>Spring.Data.NHibernate20.Integration.Tests</value>
|
||||
@@ -24,13 +24,13 @@
|
||||
|
||||
<entry key="dialect"
|
||||
value="NHibernate.Dialect.MsSql2000Dialect"/>
|
||||
|
||||
|
||||
<entry key="connection.driver_class"
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
</dictionary>
|
||||
</property>
|
||||
|
||||
|
||||
</object>
|
||||
|
||||
<object id="AccountCreditDao" type="Spring.Data.NHibernate.AccountCreditDao, Spring.Data.NHibernate20.Integration.Tests">
|
||||
@@ -46,37 +46,37 @@
|
||||
|
||||
|
||||
<!-- The DAO object that performs multiple data access operations -->
|
||||
<object id="accountManagerTarget"
|
||||
<object id="accountManagerTarget"
|
||||
type="Spring.Data.NHibernate.AccountManager, Spring.Data.NHibernate20.Integration.Tests">
|
||||
<property name="AccountCreditDao" ref="AccountCreditDao"/>
|
||||
<property name="AccountDebitDao" ref="AccountDebitDao"/>
|
||||
|
||||
|
||||
<!--
|
||||
<property name="AuditDao" ref="AuditDao"/>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<property name="ThrowException" value="true"/>
|
||||
-->
|
||||
|
||||
|
||||
<!--
|
||||
<property name="ThrowExceptionAtEnd" value="true"/>
|
||||
-->
|
||||
|
||||
</object>
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
|
||||
</object>
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate20">
|
||||
<!-- Comment out DbProvider if you want to have the tx mgr infer the DbProvider from
|
||||
the session factory. -->
|
||||
<!-- Set the DbProvider explicitly if you would like to have ADO.NET and NHibernate
|
||||
<!-- Set the DbProvider explicitly if you would like to have ADO.NET and NHibernate
|
||||
operations take place within the same transaction. -->
|
||||
<property name="DbProvider" ref="DbProvider"/>
|
||||
<property name="sessionFactory" ref="SessionFactory"/>
|
||||
|
||||
</object>
|
||||
|
||||
|
||||
<!-- construct the transaction proxy based on [Transaction()] in DAO class -->
|
||||
<!-- todo condense this xml for attribute usage for ease of use -->
|
||||
<!--
|
||||
@@ -85,27 +85,27 @@
|
||||
interfaces="Spring.NHibernate.ITestObjectDao"
|
||||
transactionManager="hibernateTransactionManager"/>
|
||||
-->
|
||||
|
||||
|
||||
<!-- Transactional Proxy for TestObjectManager using the ProxyFactoryObject -->
|
||||
<object id="accountManager"
|
||||
<object id="accountManager"
|
||||
type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
|
||||
|
||||
|
||||
<property name="Target" ref="accountManagerTarget"/>
|
||||
|
||||
<property name="InterceptorNames">
|
||||
<value>transactionInterceptor</value>
|
||||
</property>
|
||||
|
||||
</property>
|
||||
|
||||
</object>
|
||||
|
||||
|
||||
<!-- Transaction Interceptor based on attribute [Transaction()] -->
|
||||
<object id="transactionInterceptor"
|
||||
<object id="transactionInterceptor"
|
||||
type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
|
||||
<property name="TransactionManager" ref="hibernateTransactionManager"/>
|
||||
<!-- note do not have converter from string to this property type registered -->
|
||||
<property name="TransactionAttributeSource">
|
||||
<object type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data"/>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
<object type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data"/>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
</objects>
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<objects xmlns='http://www.springframework.net'
|
||||
xmlns:db="http://www.springframework.net/database">
|
||||
|
||||
<!--
|
||||
<db:provider id="DbProvider"
|
||||
provider="SqlServer-1.1"
|
||||
<db:provider id="DbProvider"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
-->
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
<property name="Password" value="Password=defaultPass"/>
|
||||
</object>
|
||||
|
||||
<db:provider id="targetDbProvider"
|
||||
<db:provider id="targetDbProvider"
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=MARKT60\SQL2005;Trusted_Connection=False"/>
|
||||
connectionString="Data Source=SPRINGQA;Trusted_Connection=False"/>
|
||||
|
||||
|
||||
<db:provider id="standardDbProvider"
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=MARKT60\SQL2005;Trusted_Connection=False;User ID=springqa;Password=springqa"/>
|
||||
connectionString="Data Source=SPRINGQA;Trusted_Connection=False;User ID=springqa;Password=springqa"/>
|
||||
|
||||
|
||||
|
||||
@@ -41,57 +41,57 @@
|
||||
-->
|
||||
<property name="HibernateProperties">
|
||||
<dictionary>
|
||||
<!-- use connection provided by DbProvider
|
||||
<!-- use connection provided by DbProvider
|
||||
<entry key="hibernate.connection.provider"
|
||||
value="NHibernate.Connection.DriverConnectionProvider"/>
|
||||
-->
|
||||
<entry key="dialect"
|
||||
value="NHibernate.Dialect.MsSql2000Dialect"/>
|
||||
|
||||
|
||||
<entry key="connection.driver_class"
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
<!--
|
||||
<entry key="hibernate.dialect"
|
||||
value="NHibernate.Dialect.Oracle9Dialect"/>
|
||||
-->
|
||||
-->
|
||||
</dictionary>
|
||||
</property>
|
||||
|
||||
|
||||
</object>
|
||||
|
||||
<!--
|
||||
<object id="nativeNHTestObjectDao" type="Spring.Data.NHibernate.NativeNHTestObjectDao, Spring.Data.NHibernate.Integration.Tests">
|
||||
<property name="SessionFactory" ref="SessionFactory"/>
|
||||
</object>
|
||||
|
||||
|
||||
<object id="NHTestObjectDao" type="Spring.Data.NHibernate.NHTestObjectDao, Spring.Data.NHibernate.Integration.Tests">
|
||||
<property name="SessionFactory" ref="SessionFactory"/>
|
||||
</object>
|
||||
-->
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate20">
|
||||
|
||||
|
||||
<property name="DbProvider" ref="DbProvider"/>
|
||||
<property name="sessionFactory" ref="SessionFactory"/>
|
||||
|
||||
</object>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Transactional Proxy for TestObjectDao using the TransactionProxyFactory -->
|
||||
<object id="testObjectDaoTransProxy"
|
||||
<object id="testObjectDaoTransProxy"
|
||||
type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">
|
||||
<property name="PlatformTransactionManager" ref="hibernateTransactionManager"/>
|
||||
<property name="Target">
|
||||
<object type="Spring.Data.NHibernate.NHTestObjectDao, Spring.Data.NHibernate20.Integration.Tests">
|
||||
<property name="SessionFactory" ref="SessionFactory"/>
|
||||
</object>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="ProxyInterfaces" value="Spring.Data.NHibernate.ITestObjectDao"/>
|
||||
|
||||
|
||||
<property name="TransactionAttributes">
|
||||
<name-values>
|
||||
<add key="Create*" value="PROPAGATION_REQUIRED"/>
|
||||
@@ -100,6 +100,6 @@
|
||||
<add key="Find*" value="PROPAGATION_REQUIRED"/>
|
||||
</name-values>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
</object>
|
||||
|
||||
</objects>
|
||||
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<objects xmlns='http://www.springframework.net'
|
||||
xmlns:db="http://www.springframework.net/database">
|
||||
|
||||
|
||||
<db:provider id="DbProvider"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=MARKT60\SQL2005;Initial Catalog=Spring;User ID=springqa; Password=springqa"/>
|
||||
<db:provider id="DbProvider"
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=SPRINGQA;Initial Catalog=Spring;User ID=springqa; Password=springqa"/>
|
||||
<!--
|
||||
connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
-->
|
||||
<!--
|
||||
<db:provider id="DbProvider"
|
||||
provider="OracleODP-2.0"
|
||||
<!--
|
||||
<db:provider id="DbProvider"
|
||||
provider="OracleODP-2.0"
|
||||
connectionString="Data Source=AGORA; User Id=agora_user; Password=welcome_bad"/>
|
||||
-->
|
||||
<!--
|
||||
@@ -46,49 +46,67 @@
|
||||
value="NHibernate.Dialect.Oracle9Dialect"/>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<entry key="dialect"
|
||||
value="NHibernate.Dialect.MsSql2000Dialect"/>
|
||||
|
||||
|
||||
<entry key="connection.driver_class"
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
</dictionary>
|
||||
</property>
|
||||
|
||||
|
||||
</object>
|
||||
|
||||
<object id="nativeNHTestObjectDao" type="Spring.Data.NHibernate.NativeNHTestObjectDao, Spring.Data.NHibernate20.Integration.Tests">
|
||||
<property name="SessionFactory" ref="SessionFactory"/>
|
||||
</object>
|
||||
|
||||
|
||||
<object id="NHTestObjectDao" type="Spring.Data.NHibernate.NHTestObjectDao, Spring.Data.NHibernate20.Integration.Tests">
|
||||
<property name="SessionFactory" ref="SessionFactory"/>
|
||||
</object>
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate20">
|
||||
|
||||
|
||||
<property name="DbProvider" ref="DbProvider"/>
|
||||
<property name="sessionFactory" ref="SessionFactory"/>
|
||||
|
||||
</object>
|
||||
|
||||
|
||||
|
||||
<!-- Transactional Proxy for TestObjectDao using the TransactionProxyFactory -->
|
||||
<object id="testObjectDaoTransProxy"
|
||||
|
||||
|
||||
<!-- Transactional Proxy for TestObjectDao using transaction attributes -->
|
||||
<object id="testObjectDaoViaTxAttributes"
|
||||
type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">
|
||||
|
||||
<property name="PlatformTransactionManager" ref="hibernateTransactionManager"/>
|
||||
<property name="Target">
|
||||
<object type="Spring.Data.NHibernate.NHTestObjectDao">
|
||||
<property name="SessionFactory" ref="SessionFactory"/>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
<property name="ProxyInterfaces" value="Spring.Data.NHibernate.ITestObjectDao"/>
|
||||
|
||||
<property name="TransactionAttributeSource">
|
||||
<object type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource" />
|
||||
</property>
|
||||
</object>
|
||||
|
||||
<!-- Transactional Proxy for TestObjectDao using the TransactionProxyFactory -->
|
||||
<object id="testObjectDaoTransProxy"
|
||||
type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject, Spring.Data">
|
||||
|
||||
|
||||
<property name="PlatformTransactionManager" ref="hibernateTransactionManager"/>
|
||||
<property name="Target">
|
||||
<object type="Spring.Data.NHibernate.NHTestObjectDao, Spring.Data.NHibernate20.Integration.Tests">
|
||||
<property name="SessionFactory" ref="SessionFactory"/>
|
||||
</object>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="ProxyInterfaces" value="Spring.Data.NHibernate.ITestObjectDao"/>
|
||||
|
||||
|
||||
<property name="TransactionAttributes">
|
||||
<name-values>
|
||||
<add key="Create*" value="PROPAGATION_REQUIRED"/>
|
||||
@@ -97,6 +115,6 @@
|
||||
<add key="Find*" value="PROPAGATION_REQUIRED"/>
|
||||
</name-values>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
</object>
|
||||
|
||||
</objects>
|
||||
@@ -0,0 +1,29 @@
|
||||
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'Spring')
|
||||
BEGIN
|
||||
ALTER DATABASE Spring
|
||||
SET SINGLE_USER
|
||||
WITH ROLLBACK IMMEDIATE
|
||||
|
||||
DROP DATABASE Spring
|
||||
END
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'springqa2')
|
||||
DROP LOGIN [springqa2]
|
||||
GO
|
||||
|
||||
CREATE DATABASE Spring
|
||||
GO
|
||||
|
||||
CREATE LOGIN [springqa2] WITH PASSWORD=N'springqa2', DEFAULT_DATABASE=[Spring], DEFAULT_LANGUAGE=[us_english]
|
||||
GO
|
||||
|
||||
USE Spring
|
||||
CREATE USER [springqa2] FOR LOGIN [springqa2] WITH DEFAULT_SCHEMA=[dbo]
|
||||
EXEC sp_addrolemember 'db_owner', 'springqa2'
|
||||
GO
|
||||
|
||||
-- ALTERNATIVELY JUST DROP ALL TABLES:
|
||||
-- EXEC sp_MSforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL';
|
||||
-- EXEC sp_MSforeachtable 'ALTER TABLE ? DISABLE TRIGGER ALL';
|
||||
-- EXEC sp_MSForEachTable 'DROP TABLE ?';
|
||||
@@ -0,0 +1,60 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
using NUnit.Framework;
|
||||
using Spring.Core.IO;
|
||||
using Spring.Data.Common;
|
||||
using Spring.Data.Core;
|
||||
using Spring.Testing.Ado;
|
||||
|
||||
namespace Spring
|
||||
{
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <author>Erich Eichinger</author>
|
||||
[SetUpFixture]
|
||||
public class Setup
|
||||
{
|
||||
private const string DBConnection = "Data Source=SPRINGQA;Database=$DATABASE$;Trusted_Connection=False;User ID=springqa;Password=springqa";
|
||||
private readonly IResourceLoader resourceLoader = new ConfigurableResourceLoader();
|
||||
|
||||
private IResource GetResource(object instance, string name)
|
||||
{
|
||||
string resourcePath = TestResourceLoader.GetAssemblyResourceUri(instance, name);
|
||||
return resourceLoader.GetResource(resourcePath);
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void InstallMSSQLDatabase()
|
||||
{
|
||||
IDbProvider dbProvider = DbProviderFactory.GetDbProvider("SqlServer-2.0");
|
||||
AdoTemplate ado = new AdoTemplate(dbProvider);
|
||||
|
||||
// (re-)create database(s)
|
||||
dbProvider.ConnectionString = DBConnection.Replace("$DATABASE$", "master");
|
||||
SimpleAdoTestUtils.ExecuteSqlScript(ado, GetResource(this, "RecreateDatabases.sql"));
|
||||
|
||||
// create tables
|
||||
dbProvider.ConnectionString = DBConnection.Replace("$DATABASE$", "Spring");
|
||||
SimpleAdoTestUtils.ExecuteSqlScript(ado, GetResource(this, "Data.NHibernate/creditdebit.sql"));
|
||||
SimpleAdoTestUtils.ExecuteSqlScript(ado, GetResource(this, "Data.NHibernate/testObject.sql"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4A07E150-ED90-407C-8CAD-4760444DDFD9}</ProjectGuid>
|
||||
<ProjectGuid>{2F09404F-AC31-4AA8-BE8B-C5AF76797221}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Spring</RootNamespace>
|
||||
@@ -28,9 +28,13 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Castle.DynamicProxy, Version=1.1.5.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\NHibernate20\net\2.0\Castle.DynamicProxy.dll</HintPath>
|
||||
<HintPath>..\..\..\lib\NHibernate20\net\2.0\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\NHibernate20\net\2.0\Castle.DynamicProxy2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Common.Logging, Version=1.0.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -114,12 +118,17 @@
|
||||
<Compile Include="..\Spring.Data.NHibernate.Integration.Tests\Data\NHibernate\TestObject.cs">
|
||||
<Link>Data\NHibernate\TestObject.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Setup.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Spring.Data.NHibernate.Integration.Tests\Data\NHibernate\creditdebit.sql">
|
||||
<EmbeddedResource Include="..\Spring.Data.NHibernate.Integration.Tests\Data\NHibernate\creditdebit.sql">
|
||||
<Link>Data\NHibernate\creditdebit.sql</Link>
|
||||
</None>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RecreateDatabases.sql" />
|
||||
<EmbeddedResource Include="..\Spring.Data.NHibernate.Integration.Tests\Data\NHibernate\testObject.sql">
|
||||
<Link>Data\NHibernate\testObject.sql</Link>
|
||||
</EmbeddedResource>
|
||||
<None Include="Spring.Data.NHibernate20.Integration.Tests.build" />
|
||||
<None Include="Spring.Data.NHibernate20.Integration.Tests.dll.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -139,6 +148,14 @@
|
||||
<Project>{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}</Project>
|
||||
<Name>Spring.Data.2008</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Testing.NUnit\Spring.Testing.NUnit.2008.csproj">
|
||||
<Project>{ED204A7B-832F-44C7-BFE3-504AEBE1BCC8}</Project>
|
||||
<Name>Spring.Testing.NUnit.2008</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Spring.Core.Tests\Spring.Core.Tests.2008.csproj">
|
||||
<Project>{44B16BAA-6DF8-447C-9D7F-3AD3D854D904}</Project>
|
||||
<Name>Spring.Core.Tests.2008</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Data\NHibernate\dbProviderTemplateTests.xml" />
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
<include buildfile="${spring.basedir}/common-project.include" />
|
||||
|
||||
<!--
|
||||
Required properties:
|
||||
* current.bin.dir - (path) root level to build to
|
||||
* current.build.debug - (true|false) debug build?
|
||||
* current.build.defines.csc - framework-specific build defines for C# compiler
|
||||
<!--
|
||||
Required properties:
|
||||
* current.bin.dir - (path) root level to build to
|
||||
* current.build.debug - (true|false) debug build?
|
||||
* current.build.defines.csc - framework-specific build defines for C# compiler
|
||||
-->
|
||||
<target name="build">
|
||||
<target name="build">
|
||||
|
||||
<!-- copy nh libs -->
|
||||
<echo message="NH Libs: ${nh20.lib.dir}" />
|
||||
@@ -19,22 +19,21 @@
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- build Spring.Data.NHibernate20.Integration.Tests -->
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
output="${current.bin.dir}/${project::get-name()}.dll"
|
||||
doc="${current.bin.dir}/${project::get-name()}.xml">
|
||||
<nowarn>
|
||||
<warning number="${nowarn.numbers.test}" />
|
||||
</nowarn>
|
||||
<sources failonempty="true">
|
||||
<!-- build Spring.Data.NHibernate20.Integration.Tests -->
|
||||
<csc target="library" define="${current.build.defines.csc},NH_2_0"
|
||||
warnaserror="true"
|
||||
debug="${current.build.debug}"
|
||||
output="${current.bin.dir}/${project::get-name()}.dll"
|
||||
doc="${current.bin.dir}/${project::get-name()}.xml">
|
||||
<nowarn>
|
||||
<warning number="${nowarn.numbers.test}" />
|
||||
</nowarn>
|
||||
<sources failonempty="true">
|
||||
<include name="../Spring.Data.NHibernate.Integration.Tests/**/*.cs" />
|
||||
<include name="**/*.cs" />
|
||||
<exclude name="../Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs" />
|
||||
<exclude name="AssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<include name="System.Data.dll" />
|
||||
<include name="System.EnterpriseServices.dll" />
|
||||
<include name="*.dll" />
|
||||
@@ -43,7 +42,7 @@
|
||||
<exclude name="Spring.Data.NHibernate12*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate21*.dll" />
|
||||
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
|
||||
</references>
|
||||
</references>
|
||||
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
|
||||
<include name="**/*.xml" />
|
||||
<include name="**/*.sql" />
|
||||
@@ -51,13 +50,13 @@
|
||||
<resources prefix="Spring" dynamicprefix="true" basedir="../Spring.Data.NHibernate.Integration.Tests" failonempty="true">
|
||||
<include name="**/*.sql" />
|
||||
</resources>
|
||||
</csc>
|
||||
</csc>
|
||||
|
||||
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
|
||||
tofile="${current.bin.dir}/${project::get-name()}.dll.config"/>
|
||||
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
|
||||
tofile="${current.bin.dir}/${project::get-name()}.dll.config"/>
|
||||
|
||||
</target>
|
||||
<target name="test" depends="build">
|
||||
</target>
|
||||
<target name="test" depends="build">
|
||||
<!-- call target="common.run-tests" if="${test.integration.data}" / -->
|
||||
</target>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
<logging>
|
||||
|
||||
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
|
||||
<arg key="level" value="DEBUG" />
|
||||
|
||||
<arg key="level" value="INFO" />
|
||||
</factoryAdapter>
|
||||
|
||||
</logging>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<objects xmlns='http://www.springframework.net'
|
||||
xmlns:db="http://www.springframework.net/database">
|
||||
|
||||
<db:provider id="DbProvider1"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
<db:provider id="DbProvider1"
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=SPRINGQA;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
|
||||
<db:provider id="DbProvider2"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
<db:provider id="DbProvider2"
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=SPRINGQA;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
|
||||
<object id="SessionFactory1" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate21">
|
||||
|
||||
@@ -71,9 +71,9 @@
|
||||
<property name="SessionFactory" ref="SessionFactory2"/>
|
||||
</object>
|
||||
|
||||
|
||||
|
||||
<!-- The DAO object that performs multiple data access operations -->
|
||||
<object id="accountManagerTarget"
|
||||
<object id="accountManagerTarget"
|
||||
type="Spring.Data.NHibernate.AccountManager, Spring.Data.NHibernate21.Integration.Tests">
|
||||
<property name="AccountCreditDao" ref="AccountCreditDao"/>
|
||||
<property name="AccountDebitDao" ref="AccountDebitDao"/>
|
||||
@@ -104,7 +104,7 @@
|
||||
-->
|
||||
|
||||
<!-- Transactional Proxy for TestObjectManager using the ProxyFactoryObject -->
|
||||
<object id="accountManager"
|
||||
<object id="accountManager"
|
||||
type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
|
||||
|
||||
<property name="Target" ref="accountManagerTarget"/>
|
||||
@@ -116,7 +116,7 @@
|
||||
</object>
|
||||
|
||||
<!-- Transaction Interceptor based on attribute [Transaction()] -->
|
||||
<object id="transactionInterceptor"
|
||||
<object id="transactionInterceptor"
|
||||
type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
|
||||
<property name="TransactionManager" ref="transactionManager"/>
|
||||
<!-- note do not have converter from string to this property type registered -->
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<objects xmlns='http://www.springframework.net'
|
||||
xmlns:db="http://www.springframework.net/database">
|
||||
|
||||
<db:provider id="DbProvider"
|
||||
provider="SqlServer-1.1"
|
||||
connectionString="Data Source=(local);Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=SPRINGQA;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
|
||||
<!--
|
||||
<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.NHibernate21">
|
||||
<property name="DbProvider" ref="DbProvider"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="MappingAssemblies">
|
||||
<list>
|
||||
<value>Spring.Data.NHibernate21.Integration.Tests</value>
|
||||
@@ -29,13 +24,13 @@
|
||||
|
||||
<entry key="dialect"
|
||||
value="NHibernate.Dialect.MsSql2000Dialect"/>
|
||||
|
||||
|
||||
<entry key="connection.driver_class"
|
||||
value="NHibernate.Driver.SqlClientDriver"/>
|
||||
|
||||
</dictionary>
|
||||
</property>
|
||||
|
||||
|
||||
</object>
|
||||
|
||||
<object id="AccountCreditDao" type="Spring.Data.NHibernate.AccountCreditDao, Spring.Data.NHibernate21.Integration.Tests">
|
||||
@@ -51,37 +46,37 @@
|
||||
|
||||
|
||||
<!-- The DAO object that performs multiple data access operations -->
|
||||
<object id="accountManagerTarget"
|
||||
<object id="accountManagerTarget"
|
||||
type="Spring.Data.NHibernate.AccountManager, Spring.Data.NHibernate21.Integration.Tests">
|
||||
<property name="AccountCreditDao" ref="AccountCreditDao"/>
|
||||
<property name="AccountDebitDao" ref="AccountDebitDao"/>
|
||||
|
||||
|
||||
<!--
|
||||
<property name="AuditDao" ref="AuditDao"/>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<property name="ThrowException" value="true"/>
|
||||
-->
|
||||
|
||||
|
||||
<!--
|
||||
<property name="ThrowExceptionAtEnd" value="true"/>
|
||||
-->
|
||||
|
||||
</object>
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
|
||||
</object>
|
||||
|
||||
<object id="hibernateTransactionManager"
|
||||
type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate21">
|
||||
<!-- Comment out DbProvider if you want to have the tx mgr infer the DbProvider from
|
||||
the session factory. -->
|
||||
<!-- Set the DbProvider explicitly if you would like to have ADO.NET and NHibernate
|
||||
<!-- Set the DbProvider explicitly if you would like to have ADO.NET and NHibernate
|
||||
operations take place within the same transaction. -->
|
||||
<property name="DbProvider" ref="DbProvider"/>
|
||||
<property name="sessionFactory" ref="SessionFactory"/>
|
||||
|
||||
</object>
|
||||
|
||||
|
||||
<!-- construct the transaction proxy based on [Transaction()] in DAO class -->
|
||||
<!-- todo condense this xml for attribute usage for ease of use -->
|
||||
<!--
|
||||
@@ -90,27 +85,27 @@
|
||||
interfaces="Spring.NHibernate.ITestObjectDao"
|
||||
transactionManager="hibernateTransactionManager"/>
|
||||
-->
|
||||
|
||||
|
||||
<!-- Transactional Proxy for TestObjectManager using the ProxyFactoryObject -->
|
||||
<object id="accountManager"
|
||||
<object id="accountManager"
|
||||
type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
|
||||
|
||||
|
||||
<property name="Target" ref="accountManagerTarget"/>
|
||||
|
||||
<property name="InterceptorNames">
|
||||
<value>transactionInterceptor</value>
|
||||
</property>
|
||||
|
||||
</property>
|
||||
|
||||
</object>
|
||||
|
||||
|
||||
<!-- Transaction Interceptor based on attribute [Transaction()] -->
|
||||
<object id="transactionInterceptor"
|
||||
<object id="transactionInterceptor"
|
||||
type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
|
||||
<property name="TransactionManager" ref="hibernateTransactionManager"/>
|
||||
<!-- note do not have converter from string to this property type registered -->
|
||||
<property name="TransactionAttributeSource">
|
||||
<object type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data"/>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
<object type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data"/>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
</objects>
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
|
||||
<db:provider id="DbProvider"
|
||||
provider="SqlServer-1.1"
|
||||
provider="SqlServer-2.0"
|
||||
connectionString="Data Source=SPRINGQA;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>
|
||||
<!--
|
||||
connectionString="Data Source=MARKT60\SQL2005;Initial Catalog=Spring;User ID=springqa; Password=springqa"/>
|
||||
-->
|
||||
<!--
|
||||
<db:provider id="DbProvider"
|
||||
provider="OracleODP-2.0"
|
||||
<!--
|
||||
<db:provider id="DbProvider"
|
||||
provider="OracleODP-2.0"
|
||||
connectionString="Data Source=AGORA; User Id=agora_user; Password=welcome_bad"/>
|
||||
-->
|
||||
<!--
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<sources failonempty="true">
|
||||
<include name="../Spring.Data.NHibernate.Integration.Tests/**/*.cs" />
|
||||
<include name="**/*.cs" />
|
||||
<exclude name="AssemblyInfo.cs" />
|
||||
</sources>
|
||||
<references basedir="${current.bin.dir}">
|
||||
<include name="System.Data.dll" />
|
||||
@@ -57,7 +58,6 @@
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
<!-- property name="test.assemblyname" value="${project::get-name()}" / -->
|
||||
<call target="common.run-tests" if="${test.integration.data}" />
|
||||
</target>
|
||||
|
||||
|
||||
@@ -12,10 +12,13 @@
|
||||
|
||||
<common>
|
||||
<logging>
|
||||
|
||||
<!--
|
||||
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
|
||||
<arg key="level" value="DEBUG" />
|
||||
|
||||
<arg key="level" value="INFO" />
|
||||
</factoryAdapter>
|
||||
-->
|
||||
<factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging">
|
||||
<arg key="level" value="INFO" />
|
||||
</factoryAdapter>
|
||||
|
||||
</logging>
|
||||
|
||||
Reference in New Issue
Block a user