User: johnsimons
Date: 2009/12/22 10:23 PM
Added:
/Facilities/NHibernateIntegration/trunk/lib/mono-3.5/
MySql.Data.dll, log4net.license.txt
/Facilities/NHibernateIntegration/trunk/lib/net-3.5/
log4net.license.txt
Modified:
/Facilities/NHibernateIntegration/trunk/src/
NHibernateIntegration-vs2008.sln
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/
AbstractNHibernateTestCase.cs, App.config, TestConfigurationBuilder.cs,
default.build
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Internals/
CustomConfigurationBuilderTestCase.cs
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/
IssueTestCase.cs
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities102/
facility.xml
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities116/
Fixture.cs
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration/
Castle.Facilities.NHibernateIntegration-vs2008.csproj
Log:
Added support for tests to be configured via nant script
Directory Changes:
Directory: /svn:mime-type/
==========================
+ application/octet-stream
--- Facilities/NHibernateIntegration/trunk/lib/mono-3.5/log4net.license.txt
(rev 0)
+++ Facilities/NHibernateIntegration/trunk/lib/mono-3.5/log4net.license.txt
2009-12-23 05:23:04 UTC (rev 6528)
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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
File Changes:
Directory:
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration/
===============================================================================================
File [modified]: Castle.Facilities.NHibernateIntegration-vs2008.csproj
Delta lines: +8 -9
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/AbstractNHibernateTestCase.cs
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/AbstractNHibernateTestCase.cs
2009-12-23 05:23:04 UTC (rev 6528)
@@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-using System;
-using Rhino.Mocks;
-
namespace Castle.Facilities.NHibernateIntegration.Tests
{
using Castle.Core.Resource;
@@ -23,15 +20,18 @@
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using NUnit.Framework;
+ using Rhino.Mocks;
public abstract class AbstractNHibernateTestCase
{
+ protected IWindsorContainer container;
+ protected MockRepository mockRepository;
+
public AbstractNHibernateTestCase()
{
- mockRepository=new MockRepository();
+ mockRepository = new MockRepository();
}
- protected IWindsorContainer container;
- protected MockRepository mockRepository;
+
protected virtual string ConfigurationFile
{
get { return "DefaultConfiguration.xml"; }
@@ -46,6 +46,7 @@
export.Create(false, true);
}
}
+
protected virtual void DropDatabaseSchema()
{
Configuration[] cfgs =
container.ResolveAll<Configuration>();
@@ -59,7 +60,6 @@
[SetUp]
public void SetUp()
{
-
container = new WindsorContainer(new XmlInterpreter(new
AssemblyResource(GetContainerFile())));
ConfigureContainer();
ExportDatabaseSchema();
@@ -69,7 +69,6 @@
[TearDown]
public virtual void TearDown()
{
-
OnTearDown();
DropDatabaseSchema();
container.Dispose();
@@ -95,4 +94,4 @@
return
ConfigHelper.ResolveResourcePath(ConfigurationFile);
}
}
-}
+}
Directory:
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/
=====================================================================================================
File [modified]: AbstractNHibernateTestCase.cs
Delta lines: +6 -6
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/App.config
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/App.config
2009-12-23 05:23:04 UTC (rev 6528)
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
-
<configuration>
<appSettings>
<add key="tests.src"
value="../Castle.Facilities.NHibernateIntegration.Tests" />
- <add key="ar.dialect"
value="NHibernate.Dialect.MsSql2000Dialect" />
- <add key="ar.connection.driver_class"
value="NHibernate.Driver.SqlClientDriver" />
- <add key="ar.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider" />
- <add key="ar.connection.connection_string"
value="Server=(local);initial catalog=test;Integrated Security=SSPI" />
- <add key="ar.proxyfactory.factory_class"
value="NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle" />
+ <add key="nhf.dialect"
value="NHibernate.Dialect.MsSql2000Dialect" />
+ <add key="nhf.connection.driver_class"
value="NHibernate.Driver.SqlClientDriver" />
+ <add key="nhf.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider" />
+ <add key="nhf.connection.connection_string.1"
value="Server=(local);initial catalog=test;Integrated Security=SSPI" />
+ <add key="nhf.connection.connection_string.2"
value="Server=(local);initial catalog=test2;Integrated Security=SSPI" />
+ <add key="nhf.proxyfactory.factory_class"
value="NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle" />
</appSettings>
File [modified]: App.config
Delta lines: +34 -25
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Internals/CustomConfigurationBuilderTestCase.cs
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Internals/CustomConfigurationBuilderTestCase.cs
2009-12-23 05:23:04 UTC (rev 6528)
@@ -12,18 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+using System.Configuration;
+using Castle.Core.Configuration;
+using Castle.Facilities.NHibernateIntegration.Builders;
+using NHibernate;
+using NUnit.Framework;
+using Configuration = NHibernate.Cfg.Configuration;
+
namespace Castle.Facilities.NHibernateIntegration.Tests.Internals
{
- using Builders;
- using Castle.Core.Configuration;
- using Castle.Core.Resource;
- using Castle.Windsor.Configuration.Interpreters;
- using NHibernate;
- using NHibernate.Cfg;
- using NUnit.Framework;
- using Windsor;
-
- public partial class CustomConfigurationBuilder : IConfigurationBuilder
+ public class CustomConfigurationBuilder : IConfigurationBuilder
{
private int _configurationsCreated;
@@ -32,11 +30,28 @@
get { return _configurationsCreated; }
}
+ #region IConfigurationBuilder Members
+
public Configuration GetConfiguration(IConfiguration config)
{
_configurationsCreated++;
- return new
DefaultConfigurationBuilder().GetConfiguration(config);
+
+ Configuration nhConfig = new
DefaultConfigurationBuilder().GetConfiguration(config);
+ nhConfig.Properties["dialect"] =
ConfigurationManager.AppSettings["nhf.dialect"];
+ nhConfig.Properties["connection.driver_class"] =
ConfigurationManager.AppSettings["nhf.connection.driver_class"];
+ nhConfig.Properties["connection.provider"] =
ConfigurationManager.AppSettings["nhf.connection.provider"];
+ nhConfig.Properties["connection.connection_string"] =
+
ConfigurationManager.AppSettings["nhf.connection.connection_string.1"];
+ if (config.Attributes["id"] != "sessionFactory1")
+ {
+
nhConfig.Properties["connection.connection_string"] =
+
ConfigurationManager.AppSettings["nhf.connection.connection_string.2"];
+ }
+ nhConfig.Properties["proxyfactory.factory_class"] =
ConfigurationManager.AppSettings["nhf.proxyfactory.factory_class"];
+ return nhConfig;
}
+
+ #endregion
}
public class CustomNHibernateFacility : NHibernateFacility
@@ -47,40 +62,34 @@
}
}
- public abstract class
AbstractCusomConfigurationBuilderTestCase:AbstractNHibernateTestCase
+ public abstract class AbstractCustomConfigurationBuilderTestCase :
AbstractNHibernateTestCase
{
-
[Test]
public void Invoked()
{
ISession session =
container.Resolve<ISessionManager>().OpenSession();
- CustomConfigurationBuilder configurationBuilder =
(CustomConfigurationBuilder) container.Resolve<IConfigurationBuilder>();
+ CustomConfigurationBuilder configurationBuilder =
+ (CustomConfigurationBuilder)
container.Resolve<IConfigurationBuilder>();
Assert.AreEqual(1,
configurationBuilder.ConfigurationsCreated);
session.Close();
}
}
[TestFixture]
- public class CustomConfigurationBuilderTestCase :
AbstractCusomConfigurationBuilderTestCase
+ public class CustomConfigurationBuilderTestCase :
AbstractCustomConfigurationBuilderTestCase
{
protected override string ConfigurationFile
{
- get
- {
- return "customConfigurationBuilder.xml";
- }
+ get { return "customConfigurationBuilder.xml"; }
}
}
[TestFixture]
- public class CustomConfigurationBulderRegressionTestCase :
AbstractCusomConfigurationBuilderTestCase
+ public class CustomConfigurationBulderRegressionTestCase :
AbstractCustomConfigurationBuilderTestCase
{
protected override string ConfigurationFile
{
- get
- {
- return "configurationBuilderRegression.xml";
- }
+ get { return "configurationBuilderRegression.xml"; }
}
}
-}
+}
File [modified]: TestConfigurationBuilder.cs
Delta lines: +10 -1
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/default.build
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/default.build
2009-12-23 05:23:04 UTC (rev 6528)
@@ -7,9 +7,12 @@
<property name="common.scripts.dir" value="../../buildscripts/" />
<include buildfile="${common.scripts.dir}/common-project.xml" />
+
<property name="nhf.dialect"
value="NHibernate.Dialect.MsSql2005Dialect" overwrite="false"/>
<property name="nhf.connection.driver_class"
value="NHibernate.Driver.SqlClientDriver" overwrite="false"/>
<property name="nhf.connection.connection_string.1"
value="Server=(local);initial catalog=test;Integrated Security=SSPI"
overwrite="false"/>
+ <property name="nhf.connection.connection_string.2"
value="Server=(local);initial catalog=test2;Integrated Security=SSPI"
overwrite="false"/>
+
<target name="init" depends="common.init">
<assemblyfileset id="project.references" basedir="${build.dir}">
<include name="nunit.framework.dll"/>
@@ -25,6 +28,7 @@
<include name="System.Configuration.dll" />
<include name="log4net.dll" />
<include name="System.Data.dll" />
+ <include name="MySql.Data.dll" if="${common.mono}" />
</assemblyfileset>
<resourcefileset id="project.resources"
prefix="${project::get-name()}" dynamicprefix="true">
@@ -49,9 +53,14 @@
/>
<xmlpoke
file="${app.config}"
-
xpath="/configuration/appSettings/a...@key='nhf.connection.connection_string']/@value"
+
xpath="/configuration/appSettings/a...@key='nhf.connection.connection_string.1']/@value"
value="${nhf.connection.connection_string.1}"
/>
+ <xmlpoke
+ file="${app.config}"
+
xpath="/configuration/appSettings/a...@key='nhf.connection.connection_string.2']/@value"
+ value="${nhf.connection.connection_string.2}"
+ />
</target>
File [modified]: default.build
Delta lines: +0 -1
===================================================================
--- Facilities/NHibernateIntegration/trunk/src/NHibernateIntegration-vs2008.sln
2009-12-23 04:34:55 UTC (rev 6527)
+++ Facilities/NHibernateIntegration/trunk/src/NHibernateIntegration-vs2008.sln
2009-12-23 05:23:04 UTC (rev 6528)
@@ -3,7 +3,6 @@
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items",
"Solution Items", "{4850DCAD-4122-4D91-A33C-31ED7B3006BF}"
ProjectSection(SolutionItems) = preProject
Changes.txt = Changes.txt
- default.build = default.build
License.txt = License.txt
Readme.txt = Readme.txt
Directory:
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities102/
==========================================================================================================================
File [modified]: facility.xml
Delta lines: +43 -27
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities116/Fixture.cs
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities116/Fixture.cs
2009-12-23 05:23:04 UTC (rev 6528)
@@ -1,62 +1,62 @@
-using NUnit.Framework;
-using System.IO;
-using Castle.Core.Configuration;
-using System.Xml;
-using Castle.Core.Configuration.Xml;
-using System.Runtime.Serialization.Formatters.Binary;
-using Castle.Core.Resource;
-using Castle.MicroKernel.SubSystems.Configuration;
-using Castle.Windsor.Configuration.Interpreters;
-using NHibernate.Cfg;
+using System.Configuration;
namespace Castle.Facilities.NHibernateIntegration.Tests.Issues.Facilities116
{
using System;
+ using System.IO;
+ using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
- using Builders;
+ using Castle.Core.Configuration;
+ using Castle.Core.Resource;
+ using Castle.Facilities.NHibernateIntegration.Builders;
+ using Castle.MicroKernel.SubSystems.Configuration;
+ using Castle.Windsor.Configuration.Interpreters;
+ using NHibernate.Cfg;
+ using NUnit.Framework;
-
[TestFixture]
public class Fixture : IssueTestCase
{
protected override string ConfigurationFile
{
- get
- {
- return "EmptyConfiguration.xml";
- }
+ get { return "EmptyConfiguration.xml"; }
}
- private const string filename="myconfig.dat";
+
+ private const string filename = "myconfig.dat";
private IConfiguration configuration;
private IConfigurationBuilder configurationBuilder;
+
public override void OnSetUp()
{
var configurationStore = new
DefaultConfigurationStore();
var resource = new
AssemblyResource("Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities116/facility.xml");
var xmlInterpreter = new XmlInterpreter(resource);
xmlInterpreter.ProcessResource(resource,
configurationStore);
- this.configuration =
configurationStore.GetFacilityConfiguration("nhibernatefacility").Children["factory"];
- this.configurationBuilder = new
PersistentConfigurationBuilder();
+ configuration =
configurationStore.GetFacilityConfiguration("nhibernatefacility").Children["factory"];
+ configurationBuilder = new
PersistentConfigurationBuilder();
}
+
public override void OnTearDown()
{
File.Delete(filename);
}
-
[Test]
public void Can_create_serialized_file_in_the_disk()
{
Assert.IsFalse(File.Exists(filename));
- Configuration cfg=
configurationBuilder.GetConfiguration(configuration);
+ Configuration cfg =
configurationBuilder.GetConfiguration(configuration);
Assert.IsTrue(File.Exists(filename));
BinaryFormatter bf = new BinaryFormatter();
Configuration nhConfig;
- using(var fileStream=new
FileStream(filename,FileMode.Open))
+ using (var fileStream = new FileStream(filename,
FileMode.Open))
{
nhConfig = bf.Deserialize(fileStream) as
Configuration;
}
Assert.IsNotNull(nhConfig);
+
+ ConfigureConnectionSettings(nhConfig);
+
nhConfig.BuildSessionFactory();
}
@@ -64,13 +64,16 @@
public void Can_deserialize_file_from_the_disk_if_new_enough()
{
Assert.IsFalse(File.Exists(filename));
- Configuration nhConfig =
configurationBuilder.GetConfiguration(this.configuration);
+ Configuration nhConfig =
configurationBuilder.GetConfiguration(configuration);
Assert.IsTrue(File.Exists(filename));
DateTime dateTime = File.GetLastWriteTime(filename);
Thread.Sleep(1000);
- nhConfig =
configurationBuilder.GetConfiguration(this.configuration);
+ nhConfig =
configurationBuilder.GetConfiguration(configuration);
Assert.AreEqual(File.GetLastWriteTime(filename),
dateTime);
Assert.IsNotNull(configuration);
+
+ ConfigureConnectionSettings(nhConfig);
+
nhConfig.BuildSessionFactory();
}
@@ -78,17 +81,30 @@
public void
Can_deserialize_file_from_the_disk_if_one_of_the_dependencies_is_newer()
{
Assert.IsFalse(File.Exists(filename));
- Configuration nhConfig =
configurationBuilder.GetConfiguration(this.configuration);
+ Configuration nhConfig =
configurationBuilder.GetConfiguration(configuration);
Assert.IsTrue(File.Exists(filename));
DateTime dateTime = File.GetLastWriteTime(filename);
Thread.Sleep(1000);
DateTime dateTime2 = DateTime.Now;
File.Create("SampleDllFile").Dispose();
File.SetLastWriteTime("SampleDllFile", dateTime2);
- nhConfig =
configurationBuilder.GetConfiguration(this.configuration);
+ nhConfig =
configurationBuilder.GetConfiguration(configuration);
Assert.Greater(File.GetLastWriteTime(filename),
dateTime2);
Assert.IsNotNull(configuration);
+
+ ConfigureConnectionSettings(nhConfig);
+
nhConfig.BuildSessionFactory();
}
+
+ private static void ConfigureConnectionSettings(Configuration
nhConfig)
+ {
+ nhConfig.Properties["dialect"] =
ConfigurationManager.AppSettings["nhf.dialect"];
+ nhConfig.Properties["connection.driver_class"] =
ConfigurationManager.AppSettings["nhf.connection.driver_class"];
+ nhConfig.Properties["connection.provider"] =
ConfigurationManager.AppSettings["nhf.connection.provider"];
+ nhConfig.Properties["connection.connection_string"] =
+
ConfigurationManager.AppSettings["nhf.connection.connection_string.1"];
+ nhConfig.Properties["proxyfactory.factory_class"] =
ConfigurationManager.AppSettings["nhf.proxyfactory.factory_class"];
+ }
}
-}
+}
Directory:
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities116/
==========================================================================================================================
File [modified]: Fixture.cs
Delta lines: +1 -8
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/IssueTestCase.cs
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/IssueTestCase.cs
2009-12-23 05:23:04 UTC (rev 6528)
@@ -1,7 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace Castle.Facilities.NHibernateIntegration.Tests.Issues
{
public class IssueTestCase : AbstractNHibernateTestCase
@@ -17,10 +13,7 @@
protected override string ConfigurationFile
{
- get
- {
- return "Issues/" + BugNumber + "/facility.xml";
- }
+ get { return "Issues/" + BugNumber + "/facility.xml"; }
}
}
}
Directory:
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Internals/
===============================================================================================================
File [modified]: CustomConfigurationBuilderTestCase.cs
Delta lines: +2 -1
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities102/facility.xml
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/Facilities102/facility.xml
2009-12-23 05:23:04 UTC (rev 6528)
@@ -10,7 +10,8 @@
<facility
id="nhibernatefacility"
-
type="Castle.Facilities.NHibernateIntegration.NHibernateFacility,
Castle.Facilities.NHibernateIntegration">
+
type="Castle.Facilities.NHibernateIntegration.NHibernateFacility,
Castle.Facilities.NHibernateIntegration"
+
configurationBuilder="Castle.Facilities.NHibernateIntegration.Tests.TestConfigurationBuilder,
Castle.Facilities.NHibernateIntegration.Tests">
<factory id="sessionFactory1">
Directory:
/Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/Issues/
============================================================================================================
File [modified]: IssueTestCase.cs
Delta lines: +34 -15
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/TestConfigurationBuilder.cs
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration.Tests/TestConfigurationBuilder.cs
2009-12-23 05:23:04 UTC (rev 6528)
@@ -1,33 +1,52 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Text;
+// Copyright 2004-2009 Castle Project - http://www.castleproject.org/
+//
+// 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.
namespace Castle.Facilities.NHibernateIntegration.Tests
{
- using Builders;
+ using System.Configuration;
+ using Castle.Core.Configuration;
+ using Castle.Facilities.NHibernateIntegration.Builders;
+ using Configuration = NHibernate.Cfg.Configuration;
public class TestConfigurationBuilder : IConfigurationBuilder
{
+ private readonly IConfigurationBuilder
defaultConfigurationBuilder;
+
public TestConfigurationBuilder()
{
- this.defaultConfigurationBuilder = new
DefaultConfigurationBuilder();
+ defaultConfigurationBuilder = new
DefaultConfigurationBuilder();
}
- private readonly IConfigurationBuilder
defaultConfigurationBuilder;
#region IConfigurationBuilder Members
- public NHibernate.Cfg.Configuration
GetConfiguration(Castle.Core.Configuration.IConfiguration config)
+ public Configuration GetConfiguration(IConfiguration config)
{
- NHibernate.Cfg.Configuration nhConfig =
defaultConfigurationBuilder.GetConfiguration(config);
- nhConfig.Properties["dialect"] =
ConfigurationManager.AppSettings["ar.dialect"];
- nhConfig.Properties["connection.driver_class"] =
ConfigurationManager.AppSettings["ar.connection.driver_class"];
- nhConfig.Properties["connection.provider"] =
ConfigurationManager.AppSettings["ar.connection.provider"];
- nhConfig.Properties["connection.connection_string"] =
ConfigurationManager.AppSettings["ar.connection.connection_string"];
- nhConfig.Properties["proxyfactory.factory_class"] =
ConfigurationManager.AppSettings["ar.proxyfactory.factory_class"];
+ Configuration nhConfig =
defaultConfigurationBuilder.GetConfiguration(config);
+ nhConfig.Properties["dialect"] =
ConfigurationManager.AppSettings["nhf.dialect"];
+ nhConfig.Properties["connection.driver_class"] =
ConfigurationManager.AppSettings["nhf.connection.driver_class"];
+ nhConfig.Properties["connection.provider"] =
ConfigurationManager.AppSettings["nhf.connection.provider"];
+ nhConfig.Properties["connection.connection_string"] =
+
ConfigurationManager.AppSettings["nhf.connection.connection_string.1"];
+ if (config.Attributes["id"] != "sessionFactory1")
+ {
+
nhConfig.Properties["connection.connection_string"] =
+
ConfigurationManager.AppSettings["nhf.connection.connection_string.2"];
+ }
+ nhConfig.Properties["proxyfactory.factory_class"] =
ConfigurationManager.AppSettings["nhf.proxyfactory.factory_class"];
return nhConfig;
}
#endregion
}
-}
+}
Directory: /Facilities/NHibernateIntegration/trunk/lib/mono-3.5/
================================================================
File [added]: MySql.Data.dll
Delta lines: +0 -0
===================================================================
Property changes on:
Facilities/NHibernateIntegration/trunk/lib/mono-3.5/MySql.Data.dll
___________________________________________________________________
File [added]: log4net.license.txt
Delta lines: +200 -0
===================================================================
--- Facilities/NHibernateIntegration/trunk/lib/net-3.5/log4net.license.txt
(rev 0)
+++ Facilities/NHibernateIntegration/trunk/lib/net-3.5/log4net.license.txt
2009-12-23 05:23:04 UTC (rev 6528)
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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
Directory: /Facilities/NHibernateIntegration/trunk/lib/net-3.5/
===============================================================
File [added]: log4net.license.txt
Delta lines: +0 -3
===================================================================
---
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration/Castle.Facilities.NHibernateIntegration-vs2008.csproj
2009-12-23 04:34:55 UTC (rev 6527)
+++
Facilities/NHibernateIntegration/trunk/src/Castle.Facilities.NHibernateIntegration/Castle.Facilities.NHibernateIntegration-vs2008.csproj
2009-12-23 05:23:04 UTC (rev 6528)
@@ -133,9 +133,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="AssemblyInfo.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Components\Dao\DataException.cs">
<SubType>Code</SubType>
Directory: /Facilities/NHibernateIntegration/trunk/src/
=======================================================
File [modified]: NHibernateIntegration-vs2008.sln
Delta lines: +0 -0
===================================================================
--
You received this message because you are subscribed to the Google Groups
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-commits?hl=en.