User: xtoff
Date: 2009/12/04 12:27 AM
Added:
/InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_169/
IoC_169.cs
Modified:
/InversionOfControl/trunk/src/Castle.MicroKernel/
DefaultKernel_Events.cs
/InversionOfControl/trunk/src/Castle.Windsor.Tests/
Castle.Windsor.Tests-vs2008.csproj
/InversionOfControl/trunk/src/Castle.Windsor/
Castle.Windsor-vs2008.csproj
Log:
- fixed IOC-ISSUE-169 Fluent registration that results in 0 new handlers does
not allow future registrations to cause HandlersChanged event to fire with
patch from Alex Henderson
File Changes:
Directory: /InversionOfControl/trunk/src/Castle.MicroKernel/
============================================================
File [modified]: DefaultKernel_Events.cs
Delta lines: +2 -2
===================================================================
--- InversionOfControl/trunk/src/Castle.Windsor/Castle.Windsor-vs2008.csproj
2009-12-03 19:59:37 UTC (rev 6380)
+++ InversionOfControl/trunk/src/Castle.Windsor/Castle.Windsor-vs2008.csproj
2009-12-04 07:27:00 UTC (rev 6381)
@@ -91,9 +91,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\net-3.5\Castle.Core.dll</HintPath>
</Reference>
- <Reference Include="Castle.DynamicProxy2, Version=2.1.0.0,
Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.DynamicProxy, Version=2.1.0.0, Culture=neutral,
PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\net-3.5\Castle.DynamicProxy2.dll</HintPath>
+ <HintPath>..\..\lib\net-3.5\Castle.DynamicProxy.dll</HintPath>
</Reference>
<Reference Include="System">
Directory: /InversionOfControl/trunk/src/Castle.Windsor/
========================================================
File [modified]: Castle.Windsor-vs2008.csproj
Delta lines: +90 -0
===================================================================
--- InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_169/IoC_169.cs
(rev 0)
+++ InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_169/IoC_169.cs
2009-12-04 07:27:00 UTC (rev 6381)
@@ -0,0 +1,90 @@
+// 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.Windsor.Tests.Bugs.IoC_169
+{
+ using Castle.Core;
+ using Castle.Facilities.Startable;
+ using Castle.MicroKernel.Registration;
+ using Castle.Windsor;
+
+ using NUnit.Framework;
+
+ public interface IBlackboard
+ {
+ }
+
+ public interface IChalk
+ {
+ }
+
+ public class Chalk : IChalk
+ {
+ }
+
+ public abstract class AbstractBlackboard : IBlackboard, IStartable
+ {
+ public static bool Started;
+
+ public void Start()
+ {
+ Started = true;
+ }
+
+ public void Stop()
+ {
+ }
+
+ public static void PrepareForTest()
+ {
+ Started = false;
+ }
+ }
+
+ public class Blackboard : AbstractBlackboard
+ {
+ public Blackboard(IChalk chalk)
+ {
+ }
+ }
+
+ public interface IServiceWithoutImplementation
+ {
+ }
+
+ [TestFixture]
+ public class IoC_169
+ {
+ [Test]
+ public void
BulkRegistrations_WhenRegistrationMatchesNoInstancesOfService_StopsStartableFacilityFromWorking()
+ {
+ AbstractBlackboard.PrepareForTest();
+
+ var container = new WindsorContainer();
+
+ container.AddFacility("startable.facility", new
StartableFacility());
+
+ container.AddComponent("blackboard",
typeof(IBlackboard), typeof(Blackboard));
+
+ BasedOnDescriptor registrations =
AllTypes.Of<IServiceWithoutImplementation>().
+ FromAssembly(GetType().Assembly).Unless(t =>
container.Kernel.HasComponent(t));
+
+ container.Register(registrations);
+
+ container.Kernel.AddComponentInstance("chalk",
typeof(IChalk), new Chalk());
+
+ Assert.True(AbstractBlackboard.Started); // fails here,
service is never started
+ }
+ }
+}
Directory: /InversionOfControl/trunk/src/Castle.Windsor.Tests/
==============================================================
File [modified]: Castle.Windsor.Tests-vs2008.csproj
Delta lines: +0 -0
===================================================================
Directory: /InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_169/
===========================================================================
File [added]: IoC_169.cs
Delta lines: +3 -2
===================================================================
---
InversionOfControl/trunk/src/Castle.Windsor.Tests/Castle.Windsor.Tests-vs2008.csproj
2009-12-03 19:59:37 UTC (rev 6380)
+++
InversionOfControl/trunk/src/Castle.Windsor.Tests/Castle.Windsor.Tests-vs2008.csproj
2009-12-04 07:27:00 UTC (rev 6381)
@@ -97,9 +97,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\net-3.5\Castle.Core.dll</HintPath>
</Reference>
- <Reference Include="Castle.DynamicProxy2, Version=2.1.0.0,
Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.DynamicProxy, Version=2.1.0.0, Culture=neutral,
PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\net-3.5\Castle.DynamicProxy2.dll</HintPath>
+ <HintPath>..\..\lib\net-3.5\Castle.DynamicProxy.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.5.0.9122, Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -160,6 +160,7 @@
<Compile Include="Bugs\IoC_120.cs" />
<Compile Include="Bugs\IoC_142.cs" />
<Compile Include="Bugs\IoC_147.cs" />
+ <Compile Include="Bugs\IoC_169\IoC_169.cs" />
<Compile Include="Bugs\IoC_92.cs" />
<Compile Include="ChildContainerSupportTestCase.cs">
--
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.