Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moving things around. Everything is broken right now, this will proba…

…bly take a few revisions.
  • Loading branch information...
commit 3cdbd07c119baf0bd9a42116cac770279192cf9a 1 parent 454a3e7
@aaronjensen aaronjensen authored
Showing with 12 additions and 5,877 deletions.
  1. +0 −44 ...ferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/AttributedBasedRegistererTests.cs
  2. +0 −86 .../Castle.Facilities.DeferredServiceResolution.Tests/Castle.Facilities.DeferredServiceResolution.Tests.csproj
  3. +0 −5 ...le.Facilities.DeferredServiceResolution.Tests/Castle.Facilities.DeferredServiceResolution.Tests.csproj.user
  4. +0 −98 ...e.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/ComponentModels.cs
  5. +0 −73 ...ities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/DeferredContainerTests.cs
  6. +0 −88 ...rviceResolution/Castle.Facilities.DeferredServiceResolution.Tests/DeferredServiceResolutionFacilityTests.cs
  7. +0 −50 ...DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/DeferredServiceResolverTests.cs
  8. +0 −36 ...ties.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/Properties/AssemblyInfo.cs
  9. +0 −55 ...eferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/ServiceInterfaceResolverTests.cs
  10. +0 −29 ...e.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/StandardFixture.cs
  11. +0 −26 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.sln
  12. +0 −86 ...acilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/AttributeBasedRegisterer.cs
  13. +0 −87 ...ceResolution/Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.csproj
  14. BIN  ...rviceResolution/Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.snk
  15. +0 −23 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredContainer.cs
  16. +0 −61 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredKernel.cs
  17. +0 −69 ....DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredServiceResolutionFacility.cs
  18. +0 −55 ...Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredServiceResolver.cs
  19. +0 −20 ...ies.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/IComponentModelAndKernelSource.cs
  20. +0 −13 ...cilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/IServiceInterfaceResolver.cs
  21. +0 −14 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/IServiceResolver.cs
  22. +0 −9 ...DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/ManualWindsorRegistrationAttribute.cs
  23. +0 −36 ...Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/Properties/AssemblyInfo.cs
  24. +0 −89 ...acilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/ServiceInterfaceResolver.cs
  25. +0 −16 ...ilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/ServiceResolutionException.cs
  26. +0 −39 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/ServiceResolver.cs
  27. +0 −31 ...Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/WindsorServiceAttribute.cs
  28. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Core.dll
  29. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Core.pdb
  30. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.DynamicProxy2.dll
  31. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.DynamicProxy2.pdb
  32. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.MicroKernel.dll
  33. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.MicroKernel.pdb
  34. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Windsor.dll
  35. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Windsor.pdb
  36. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Testing/Rhino.Mocks.dll
  37. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Testing/nunit.framework.dll
  38. BIN  Castle.Facilities.DeferredServiceResolution/Libraries/log4net.dll
  39. +0 −65 Castle.Facilities.DeferredServiceResolution/rakefile.rb
  40. +0 −97 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Machine.BackgroundJobs.Tests.csproj
  41. +0 −36 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Properties/AssemblyInfo.cs
  42. +0 −55 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/QueuedJobTests.cs
  43. +0 −17 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Sample/LongRunningJob.cs
  44. +0 −39 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Sample/LongRunningJobHandler.cs
  45. +0 −10 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Sample/LongRunningJobRepository.cs
  46. +0 −33 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/BackgroundJobQueuerTests.cs
  47. +0 −48 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/BackgroundJobSpawnerTests.cs
  48. +0 −92 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/JobManagerTests.cs
  49. +0 −40 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/SimpleJobRepositoryLocatorTests.cs
  50. +0 −106 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/SimpleJobRepositoryTests.cs
  51. +0 −33 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/WindsorJobHandlerLocatorTests.cs
  52. +0 −38 Machine.BackgroundJobs/Machine.BackgroundJobs.sln
  53. +0 −32 Machine.BackgroundJobs/Machine.BackgroundJobs/BackgroundJobAttribute.cs
  54. +0 −39 Machine.BackgroundJobs/Machine.BackgroundJobs/IBackgroundJob.cs
  55. +0 −92 Machine.BackgroundJobs/Machine.BackgroundJobs/Machine.BackgroundJobs.csproj
  56. +0 −36 Machine.BackgroundJobs/Machine.BackgroundJobs/Properties/AssemblyInfo.cs
  57. +0 −57 Machine.BackgroundJobs/Machine.BackgroundJobs/QueuedJob.cs
  58. +0 −10 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/IBackgroundJobHandler.cs
  59. +0 −10 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/IBackgroundJobQueuer.cs
  60. +0 −10 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/IBackgroundJobSpawner.cs
  61. +0 −9 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/IJobHandlerLocator.cs
  62. +0 −20 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/IJobManager.cs
  63. +0 −14 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/IJobRepository.cs
  64. +0 −9 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/IJobRepositoryLocator.cs
  65. +0 −22 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/AbstractBackgroundJobHandler.cs
  66. +0 −45 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/AttributeAwareJobServicesLocator.cs
  67. +0 −28 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/BackgroundJobQueuer.cs
  68. +0 −36 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/BackgroundJobSpawner.cs
  69. +0 −81 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/JobManager.cs
  70. +0 −100 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/SimpleJobRepository.cs
  71. +0 −32 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/SimpleJobRepositoryLocator.cs
  72. +0 −24 Machine.BackgroundJobs/Machine.BackgroundJobs/Services/Impl/WindsorJobHandlerLocator.cs
  73. +0 −50 Machine.BackgroundJobs/Machine.BackgroundJobs/SimpleBackgroundJob.cs
  74. +0 −93 Machine.Core/Machine.Core.Tests/Machine.Core.Tests.csproj
  75. +0 −36 Machine.Core/Machine.Core.Tests/Properties/AssemblyInfo.cs
  76. +0 −23 Machine.Core/Machine.Core.Tests/Services/Impl/ClockTests.cs
  77. +0 −62 Machine.Core/Machine.Core.Tests/Services/Impl/DotNetObjectActivatorTests.cs
  78. +0 −128 Machine.Core/Machine.Core.Tests/Services/Impl/FileSystemTests.cs
  79. +0 −34 Machine.Core/Machine.Core.Tests/Services/Impl/NamerTests.cs
  80. +0 −75 Machine.Core/Machine.Core.Tests/Services/Impl/ThreadManagerTests.cs
  81. +0 −56 Machine.Core/Machine.Core.Tests/StandardFixture.cs
  82. +0 −30 Machine.Core/Machine.Core.Tests/Utility/ListHelperTests.cs
  83. +0 −32 Machine.Core/Machine.Core.Tests/Utility/TimeSpanHelperTests.cs
  84. +0 −107 Machine.Core/Machine.Core.Tests/ValueTypes/SampleTypes.cs
  85. +0 −36 Machine.Core/Machine.Core.Tests/ValueTypes/ValueTypeHelperTests_TypeHasNoState.cs
  86. +0 −70 Machine.Core/Machine.Core.Tests/ValueTypes/ValueTypeHelperTests_TypeHasOneField.cs
  87. +0 −38 Machine.Core/Machine.Core.Tests/ValueTypes/ValueTypeHelperTests_TypeHasThreeFieldsOneIsAlsoValuedClassType.cs
  88. +0 −61 Machine.Core/Machine.Core.Tests/ValueTypes/ValueTypeHelperTests_TypeHasTwoFields.cs
  89. +0 −50 Machine.Core/Machine.Core.Tests/ValueTypes/ValueTypeHelperTests_TypeWithOnlyEnum.cs
  90. +0 −56 Machine.Core/Machine.Core.Tests/ValueTypes/ValueTypeHelperTests_VeryComplexType.cs
  91. +0 −44 Machine.Core/Machine.Core.sln
  92. +0 −23 Machine.Core/Machine.Core/Aspects/BackgroundInvokeAttribute.cs
  93. +0 −68 Machine.Core/Machine.Core/Aspects/BackgroundInvokeInterceptor.cs
  94. +0 −8 Machine.Core/Machine.Core/Aspects/SynchronizeInvokeIgnoreAttribute.cs
  95. +0 −60 Machine.Core/Machine.Core/Aspects/SynchronizeInvokeInterceptor.cs
  96. +0 −18 Machine.Core/Machine.Core/Aspects/ViewProxyGenerator.cs
  97. +0 −23 Machine.Core/Machine.Core/LoggingUtilities/Log4NetNdc.cs
  98. +0 −86 Machine.Core/Machine.Core/Machine.Core.Silverlight.csproj
  99. +0 −93 Machine.Core/Machine.Core/Machine.Core.csproj
  100. +0 −44 Machine.Core/Machine.Core/MsBuildUtilities/Log4NetMsBuildAppender.cs
  101. +0 −36 Machine.Core/Machine.Core/Properties/AssemblyInfo.cs
  102. +0 −13 Machine.Core/Machine.Core/Services/IClock.cs
  103. +0 −110 Machine.Core/Machine.Core/Services/IFileSystem.cs
  104. +0 −11 Machine.Core/Machine.Core/Services/INamer.cs
  105. +0 −13 Machine.Core/Machine.Core/Services/IObjectActivator.cs
  106. +0 −31 Machine.Core/Machine.Core/Services/IThreadManager.cs
  107. +0 −15 Machine.Core/Machine.Core/Services/Impl/Clock.cs
  108. +0 −40 Machine.Core/Machine.Core/Services/Impl/DotNetObjectActivator.cs
  109. +0 −98 Machine.Core/Machine.Core/Services/Impl/FileSystem.cs
  110. +0 −41 Machine.Core/Machine.Core/Services/Impl/Namer.cs
  111. +0 −101 Machine.Core/Machine.Core/Services/Impl/ThreadManager.cs
  112. +0 −28 Machine.Core/Machine.Core/Services/TemporaryDirectoryHandle.cs
  113. +0 −13 Machine.Core/Machine.Core/Utility/ListHelper.cs
  114. +0 −35 Machine.Core/Machine.Core/Utility/LockingHelpers.cs
  115. +0 −27 Machine.Core/Machine.Core/Utility/ReflectionHelper.cs
  116. +0 −54 Machine.Core/Machine.Core/Utility/TimeSpanHelper.cs
  117. +0 −24 Machine.Core/Machine.Core/Utility/XmlSerializationHelper.cs
  118. +0 −52 Machine.Core/Machine.Core/ValueTypes/AbstractValueTypeInspector.cs
  119. +0 −74 Machine.Core/Machine.Core/ValueTypes/CalculateHashCodeFunctionFactory.cs
  120. +0 −23 Machine.Core/Machine.Core/ValueTypes/ClassTypeAsValueType.cs
  121. +0 −71 Machine.Core/Machine.Core/ValueTypes/ObjectEqualityFunctionFactory.cs
  122. +0 −94 Machine.Core/Machine.Core/ValueTypes/ToStringFunctionFactory.cs
  123. +0 −80 Machine.Core/Machine.Core/ValueTypes/ValueTypeHelper.cs
  124. +0 −32 Machine.Testing/AutoMocking/AutoMockingContainer.cs
  125. +0 −52 Machine.Testing/AutoMocking/MockingDependencyResolver.cs
  126. +0 −59 Machine.Testing/FluentFixtures/BaseCreator.cs
  127. +0 −41 Machine.Testing/FluentFixtures/CurrentService.cs
  128. +0 −34 Machine.Testing/FluentFixtures/FixtureContext.cs
  129. +0 −37 Machine.Testing/FluentFixtures/FixtureContextAware.cs
  130. +0 −6 Machine.Testing/FluentFixtures/IExistingService.cs
  131. +0 −11 Machine.Testing/FluentFixtures/IFixtureContext.cs
  132. +0 −9 Machine.Testing/FluentFixtures/NewService.cs
  133. +0 −73 Machine.Testing/Machine.Testing.csproj
  134. +0 −36 Machine.Testing/Properties/AssemblyInfo.cs
  135. +0 −234 Machine.Testing/TestsFor.cs
  136. 0  { → Source}/Build.proj
  137. 0  { → Source}/Machine.All.4.0.resharper
  138. 0  { → Source}/Machine.All.sln
  139. 0  { → Source}/Machine.Container/Machine.Container.Tests/Activators/DefaultActivatorTests.cs
  140. 0  { → Source}/Machine.Container/Machine.Container.Tests/Activators/LifestyleActivatorTests.cs
  141. 0  { → Source}/Machine.Container/Machine.Container.Tests/Activators/StaticActivatorTests.cs
  142. 0  { → Source}/Machine.Container/Machine.Container.Tests/IoCTests.cs
  143. 0  { → Source}/Machine.Container/Machine.Container.Tests/Lifestyles/SingletonLifestyleTests.cs
  144. 0  { → Source}/Machine.Container/Machine.Container.Tests/Lifestyles/TransientLifestyleTests.cs
  145. +4 −4 { → Source}/Machine.Container/Machine.Container.Tests/Machine.Container.Tests.csproj
  146. 0  { → Source}/Machine.Container/Machine.Container.Tests/MachineContainerTests.cs
  147. 0  { → Source}/Machine.Container/Machine.Container.Tests/MachineContainerTestsFixture.cs
  148. 0  { → Source}/Machine.Container/Machine.Container.Tests/Model/ServiceEntryTests.cs
  149. 0  { → Source}/Machine.Container/Machine.Container.Tests/Properties/AssemblyInfo.cs
  150. 0  { → Source}/Machine.Container/Machine.Container.Tests/ScaffoldTests.cs
  151. 0  { → Source}/Machine.Container/Machine.Container.Tests/ServiceEntryHelper.cs
  152. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/ActivatorStoreTests.cs
  153. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/DefaultActivatorStrategyTests.cs
  154. 0  ...rce}/Machine.Container/Machine.Container.Tests/Services/Impl/DefaultLifestyleAwareActivatorResolverTests.cs
  155. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/DotNetObjectFactoryTests.cs
  156. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/EmptyOverridesTests.cs
  157. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/LifestyleFactoryTests.cs
  158. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/RootActivatorResolverTests.cs
  159. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/ServiceDependencyInspectorTests.cs
  160. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/ServiceEntryFactoryTests.cs
  161. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/ServiceEntryResolverTests.cs
  162. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/ServiceGraphTests.cs
  163. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/StaticLookupActivatorResolverTests.cs
  164. 0  { → Source}/Machine.Container/Machine.Container.Tests/Services/Impl/StaticOverrideLookupTests.cs
  165. 0  ...arr; Source}/Machine.Container/Machine.Container.Tests/Services/Impl/ThrowsPendingActivatorResolverTests.cs
  166. 0  { → Source}/Machine.Container/Machine.Container.Tests/Utility/StackPopperTests.cs
  167. 0  { → Source}/Machine.Container/Machine.Container/Activators/DefaultActivator.cs
  168. 0  { → Source}/Machine.Container/Machine.Container/Activators/LifestyleActivator.cs
  169. 0  { → Source}/Machine.Container/Machine.Container/Activators/StaticActivator.cs
  170. 0  { → Source}/Machine.Container/Machine.Container/ContainerRegistrationHelper.cs
  171. 0  { → Source}/Machine.Container/Machine.Container/IoC.cs
  172. 0  { → Source}/Machine.Container/Machine.Container/Lifestyles/SingletonLifestyle.cs
  173. 0  { → Source}/Machine.Container/Machine.Container/Lifestyles/TransientLifestyle.cs
  174. 0  { → Source}/Machine.Container/Machine.Container/Machine.Container.Silverlight.csproj
  175. 0  { → Source}/Machine.Container/Machine.Container/Machine.Container.csproj
  176. 0  { → Source}/Machine.Container/Machine.Container/MachineContainer.cs
  177. 0  { → Source}/Machine.Container/Machine.Container/Model/ConstructorCandidate.cs
  178. 0  { → Source}/Machine.Container/Machine.Container/Model/DependencyType.cs
  179. 0  { → Source}/Machine.Container/Machine.Container/Model/LifestyleType.cs
  180. 0  { → Source}/Machine.Container/Machine.Container/Model/ResolvedServiceEntry.cs
  181. 0  { → Source}/Machine.Container/Machine.Container/Model/ServiceDependency.cs
  182. 0  { → Source}/Machine.Container/Machine.Container/Model/ServiceEntry.cs
  183. 0  { → Source}/Machine.Container/Machine.Container/Model/ServiceRegistration.cs
  184. 0  { → Source}/Machine.Container/Machine.Container/Model/ServiceState.cs
  185. 0  { → Source}/Machine.Container/Machine.Container/Properties/AssemblyInfo.cs
  186. 0  { → Source}/Machine.Container/Machine.Container/ServiceResolutionException.cs
  187. 0  { → Source}/Machine.Container/Machine.Container/Services/IActivator.cs
  188. 0  { → Source}/Machine.Container/Machine.Container/Services/IActivatorResolver.cs
  189. 0  { → Source}/Machine.Container/Machine.Container/Services/IActivatorStore.cs
  190. 0  { → Source}/Machine.Container/Machine.Container/Services/IActivatorStrategy.cs
  191. 0  { → Source}/Machine.Container/Machine.Container/Services/ICreationServices.cs
  192. 0  { → Source}/Machine.Container/Machine.Container/Services/IHighLevelContainer.cs
  193. 0  { → Source}/Machine.Container/Machine.Container/Services/ILifestyle.cs
  194. 0  { → Source}/Machine.Container/Machine.Container/Services/ILifestyleFactory.cs
  195. 0  { → Source}/Machine.Container/Machine.Container/Services/IObjectFactory.cs
  196. 0  { → Source}/Machine.Container/Machine.Container/Services/IOverrideLookup.cs
  197. 0  { → Source}/Machine.Container/Machine.Container/Services/IServiceDependencyInspector.cs
  198. 0  { → Source}/Machine.Container/Machine.Container/Services/IServiceEntryFactory.cs
  199. 0  { → Source}/Machine.Container/Machine.Container/Services/IServiceEntryResolver.cs
  200. 0  { → Source}/Machine.Container/Machine.Container/Services/IServiceGraph.cs
  201. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/ActivatorStore.cs
  202. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/CreationServices.cs
  203. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/DefaultActivatorStrategy.cs
  204. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/DefaultLifestyleAwareActivatorResolver.cs
  205. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/DotNetObjectFactory.cs
  206. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/EmptyOverrides.cs
  207. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/LifestyleFactory.cs
  208. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/ResolutionMessageBuilder.cs
  209. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/RootActivatorResolver.cs
  210. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/ServiceDependencyInspector.cs
  211. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/ServiceEntryFactory.cs
  212. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/ServiceEntryResolver.cs
  213. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/ServiceGraph.cs
  214. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/StaticLookupActivatorResolver.cs
  215. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/StaticOverrideLookup.cs
  216. 0  { → Source}/Machine.Container/Machine.Container/Services/Impl/ThrowsPendingActivatorResolver.cs
  217. 0  { → Source}/Machine.Container/Machine.Container/SilverlightHacks.cs
  218. 0  { → Source}/Machine.Container/Machine.Container/Utility/StackPopper.cs
  219. 0  { → Source}/Machine.Migrations/Example.proj
  220. +3 −3 { → Source}/Machine.Migrations/Machine.Migrations.NHibernate/Machine.Migrations.NHibernate.csproj
  221. 0  { → Source}/Machine.Migrations/Machine.Migrations.NHibernate/Properties/AssemblyInfo.cs
  222. 0  { → Source}/Machine.Migrations/Machine.Migrations.NHibernate/Services/INHibernateSessionProvider.cs
  223. 0  ...arr; Source}/Machine.Migrations/Machine.Migrations.NHibernate/Services/Impl/NHibernateConnectionProvider.cs
  224. 0  ...rr; Source}/Machine.Migrations/Machine.Migrations.NHibernate/Services/Impl/NHibernateTransactionProvider.cs
  225. 0  ...arr; Source}/Machine.Migrations/Machine.Migrations.NHibernate/Services/Impl/NHibernateTransactionWrapper.cs
  226. 0  ...; Source}/Machine.Migrations/Machine.Migrations.NHibernate/Services/Impl/StaticNHibernateSessionProvider.cs
  227. 0  ...rr; Source}/Machine.Migrations/Machine.Migrations.Tests/DatabaseProviders/SqlServerDatabaseProviderTests.cs
  228. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Machine.Migrations.Tests.csproj
  229. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/MigrationStepTests.cs
  230. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Properties/AssemblyInfo.cs
  231. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/SchemaProviders/SqlServerSchemaProviderTests.cs
  232. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/CSharpMigrationFactoryTests.cs
  233. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/CommonTransformationsTests.cs
  234. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/ConnectionProviderTests.cs
  235. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/MigrationFactoryChooserTests.cs
  236. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/MigrationFinderTests.cs
  237. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/MigrationInitializerTests.cs
  238. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/MigrationRunnerTests.cs
  239. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/MigrationSelectorTests.cs
  240. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/MigratorTests.cs
  241. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/SchemaStateManagerTests.cs
  242. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/VersionStateFactoryTests.cs
  243. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/Services/Impl/WorkingDirectoryManagerTests.cs
  244. 0  { → Source}/Machine.Migrations/Machine.Migrations.Tests/SimpleMigrationTests.cs
  245. 0  { → Source}/Machine.Migrations/Machine.Migrations.sln
  246. 0  { → Source}/Machine.Migrations/Machine.Migrations.targets
  247. 0  { → Source}/Machine.Migrations/Machine.Migrations/Column.cs
  248. 0  { → Source}/Machine.Migrations/Machine.Migrations/DatabaseProviders/IDatabaseProvider.cs
  249. 0  { → Source}/Machine.Migrations/Machine.Migrations/DatabaseProviders/SqlServerDatabaseProvider.cs
  250. 0  { → Source}/Machine.Migrations/Machine.Migrations/IDatabaseMigration.cs
  251. +5 −5 { → Source}/Machine.Migrations/Machine.Migrations/Machine.Migrations.csproj
  252. 0  { → Source}/Machine.Migrations/Machine.Migrations/MigrationReference.cs
  253. 0  { → Source}/Machine.Migrations/Machine.Migrations/MigrationStep.cs
  254. 0  { → Source}/Machine.Migrations/Machine.Migrations/MigratorTask.cs
  255. 0  { → Source}/Machine.Migrations/Machine.Migrations/Properties/AssemblyInfo.cs
  256. 0  { → Source}/Machine.Migrations/Machine.Migrations/SchemaProviders/ISchemaProvider.cs
  257. 0  { → Source}/Machine.Migrations/Machine.Migrations/SchemaProviders/SqlServerCeSchemaProvider.cs
  258. 0  { → Source}/Machine.Migrations/Machine.Migrations/SchemaProviders/SqlServerSchemaProvider.cs
  259. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/ICommonTransformations.cs
  260. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IConfiguration.cs
  261. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IConnectionProvider.cs
  262. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigrationFactory.cs
  263. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigrationFactoryChooser.cs
  264. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigrationFinder.cs
  265. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigrationInitializer.cs
  266. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigrationRunner.cs
  267. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigrationSelector.cs
  268. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigrator.cs
  269. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IMigratorContainerFactory.cs
  270. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/ISchemaStateManager.cs
  271. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/ITransactionProvider.cs
  272. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IVersionStateFactory.cs
  273. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/IWorkingDirectoryManager.cs
  274. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/AbstractConnectionProvider.cs
  275. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/AbstractMigrationCompilerFactory.cs
  276. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/BooMigrationFactory.cs
  277. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/CSharpMigrationFactory.cs
  278. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/CommonTransformations.cs
  279. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/MigrationFactoryChooser.cs
  280. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/MigrationFinder.cs
  281. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/MigrationInitializer.cs
  282. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/MigrationRunner.cs
  283. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/MigrationSelector.cs
  284. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/Migrator.cs
  285. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/MigratorContainerFactory.cs
  286. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/SchemaStateManager.cs
  287. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/SqlServerConnectionProvider.cs
  288. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/StaticMigratorConfiguration.cs
  289. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/TransactionProvider.cs
  290. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/VersionStateFactory.cs
  291. 0  { → Source}/Machine.Migrations/Machine.Migrations/Services/Impl/WorkingDirectoryManager.cs
  292. 0  { → Source}/Machine.Migrations/Machine.Migrations/SimpleMigration.cs
  293. 0  { → Source}/Machine.Migrations/Machine.Migrations/Table.cs
  294. 0  { → Source}/Machine.Migrations/Machine.Migrations/VersionState.cs
  295. 0  { → Source}/Machine.Migrations/Migrations/001_first_migration.cs
  296. 0  { → Source}/Machine.Migrations/Migrations/002_second_migration.cs
  297. 0  { → Source}/Machine.Migrations/Migrations/003_third_migration.boo
  298. 0  { → Source}/Machine.MonoRail.Extensions/Libraries/Castle/Boo.Lang.CodeDom.dll
  299. 0  { → Source}/Machine.MonoRail.Extensions/Libraries/Castle/Boo.Lang.Compiler.dll
  300. 0  { → Source}/Machine.MonoRail.Extensions/Libraries/Castle/Boo.Lang.Interpreter.dll
Sorry, we could not display the entire diff because too many files (602) changed.
View
44 ...redServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/AttributedBasedRegistererTests.cs
@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using NUnit.Framework;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- [TestFixture]
- public class AttributedBasedRegistererTests : StandardFixture<AttributeBasedRegisterer>
- {
- [Test]
- public void Register_ThisAssembly_RegistersOurExampleTypes()
- {
- using (_mocks.Record())
- {
- _kernel.AddComponent(typeof(Service1And2).FullName, typeof(Service1And2));
- _kernel.AddComponent(typeof(Service1).FullName, typeof(Service1));
- _kernel.AddComponent(typeof(Service2).FullName, typeof(Service2));
- _kernel.AddComponent(typeof(Service3).FullName, typeof(Service3));
- }
- _target.RegisterAssembly(_kernel, GetType().Assembly);
- _mocks.VerifyAll();
- }
-
- [Test]
- [ExpectedException(typeof(InvalidOperationException))]
- public void RegisterType_IsInterface_Throws()
- {
- _target.RegisterType(_kernel, typeof(IService1));
- }
-
- [Test]
- [ExpectedException(typeof(InvalidOperationException))]
- public void RegisterType_IsAbstract_Throws()
- {
- _target.RegisterType(_kernel, typeof(SomethingAbstract));
- }
-
- public override AttributeBasedRegisterer Create()
- {
- return new AttributeBasedRegisterer();
- }
- }
-}
View
86 ...stle.Facilities.DeferredServiceResolution.Tests/Castle.Facilities.DeferredServiceResolution.Tests.csproj
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21004</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{3636D7C8-B960-40E9-BC20-EAEC0E72964B}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Castle.Facilities.DeferredServiceResolution</RootNamespace>
- <AssemblyName>Castle.Facilities.DeferredServiceResolution.Tests</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\Build\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\Build\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.Core.dll</HintPath>
- </Reference>
- <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.DynamicProxy2.dll</HintPath>
- </Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.MicroKernel.dll</HintPath>
- </Reference>
- <Reference Include="Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.Windsor.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework, Version=2.4.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Testing\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="Rhino.Mocks, Version=3.1.0.584, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Testing\Rhino.Mocks.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AttributedBasedRegistererTests.cs" />
- <Compile Include="ComponentModels.cs" />
- <Compile Include="DeferredContainerTests.cs" />
- <Compile Include="DeferredServiceResolutionFacilityTests.cs" />
- <Compile Include="DeferredServiceResolverTests.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ServiceInterfaceResolverTests.cs" />
- <Compile Include="StandardFixture.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Castle.Facilities.DeferredServiceResolution\Castle.Facilities.DeferredServiceResolution.csproj">
- <Project>{FD223B74-1AE9-4F5A-B476-B823A3FE3997}</Project>
- <Name>Castle.Facilities.DeferredServiceResolution</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
5 ...Facilities.DeferredServiceResolution.Tests/Castle.Facilities.DeferredServiceResolution.Tests.csproj.user
@@ -1,5 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectView>ProjectFiles</ProjectView>
- </PropertyGroup>
-</Project>
View
98 ...acilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/ComponentModels.cs
@@ -1,98 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Castle.Core;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public static class ComponentModels
- {
- public static bool UseInterfacesAsServiceType = false;
- public static ComponentModel Service1Model = MakeModel("1", typeof(Service1), typeof(Service1));
- public static ComponentModel Service2Model = MakeModel("2", typeof(Service2), typeof(Service2));
- public static ComponentModel Service3Model = MakeModel("3", typeof(Service3), typeof(Service3));
- public static ComponentModel NoServicesModel = MakeModel("NoServices", typeof(NoServices), typeof(NoServices));
- public static ComponentModel Service1And2Model = MakeModel("1And2", typeof(Service1And2), typeof(Service1And2));
-
- public static List<ComponentModel> WithService1And2()
- {
- List<ComponentModel> models = WithNoServices();
- models.Add(Service1Model);
- models.Add(Service2Model);
- return models;
- }
- public static List<ComponentModel> WithService1And2And3()
- {
- List<ComponentModel> models = WithService1And2();
- models.Add(Service3Model);
- return models;
- }
- public static List<ComponentModel> WithDuplicateService1()
- {
- List<ComponentModel> models = Empty();
- models.Add(Service1And2Model);
- models.Add(Service1Model);
- return models;
- }
- public static List<ComponentModel> Empty()
- {
- return new List<ComponentModel>();
- }
- public static List<ComponentModel> WithNoServices()
- {
- List<ComponentModel> models = Empty();
- models.Add(NoServicesModel);
- return models;
- }
- public static ComponentModel MakeModel(string name, Type serviceType, Type implementationType)
- {
- if (UseInterfacesAsServiceType)
- {
- return new ComponentModel(name, serviceType, implementationType);
- }
- return new ComponentModel(name, implementationType, implementationType);
- }
- }
- [Singleton]
- public class Service1And2 : IService1, IService2
- {
- }
- [Transient]
- public class Service2 : IService2
- {
- }
- [PerThread]
- public class Service1 : IService1
- {
- }
- public interface IService1
- {
- }
- public interface IService2
- {
- }
- public class NoServices
- {
- }
- public interface IService3
- {
- }
- [Singleton]
- public class Service3 : IService3
- {
- }
- public abstract class SomethingAbstract
- {
- }
- public class Service2DependsOnService1 : IService2
- {
- public Service2DependsOnService1(IService1 s1) { }
- }
- public class Service3DependsOnService1 : IService3
- {
- public Service3DependsOnService1(IService1 s1) { }
- }
- public class Service3DependsOnService1And2 : IService3
- {
- public Service3DependsOnService1And2(IService1 s1, IService2 s2) { }
- }
-}
View
73 ...es.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/DeferredContainerTests.cs
@@ -1,73 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Castle.Core;
-using Castle.MicroKernel;
-using NUnit.Framework;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- [TestFixture]
- public class DeferredContainerTests : StandardFixture<DeferredContainer>
- {
- [Test]
- public void Resolve_JustService1ByImplementation_GetsService()
- {
- _target.AddComponent("Service1", typeof(Service1));
- Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<Service1>());
- }
-
- [Test]
- public void Resolve_JustService1ByInterface_GetsService()
- {
- _target.AddComponent("Service1", typeof(Service1));
- Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<IService1>());
- }
-
- [Test]
- public void Resolve_Service2DependsOnService1ByImplementation_GetsService()
- {
- _target.AddComponent("Service1", typeof(Service1));
- _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
- Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<Service2DependsOnService1>());
- Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<Service1>());
- }
-
- [Test]
- public void Resolve_Service2DependsOnService1ByInterface_GetsService()
- {
- _target.AddComponent("Service1", typeof(Service1));
- _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
- Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<IService2>());
- Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<IService1>());
- }
-
- [Test]
- public void Resolve_TwoService1DependentsThatMightCauseItToNotCheckAgainAndResolveByImplementation_GetsService()
- {
- _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
- _target.AddComponent("Service3DependsOnService1And2", typeof(Service3DependsOnService1And2));
- _target.AddComponent("Service1", typeof(Service1));
- Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<Service2DependsOnService1>());
- Assert.IsInstanceOfType(typeof(Service3DependsOnService1And2), _target.Resolve<Service3DependsOnService1And2>());
- Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<Service1>());
- }
-
- [Test]
- public void Resolve_TwoService1DependentsThatMightCauseItToNotCheckAgainAndResolveByInterface_GetsService()
- {
- _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
- _target.AddComponent("Service3DependsOnService1And2", typeof(Service3DependsOnService1And2));
- _target.AddComponent("Service1", typeof(Service1));
- Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<IService2>());
- Assert.IsInstanceOfType(typeof(Service3DependsOnService1And2), _target.Resolve<IService3>());
- Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<IService1>());
- }
-
- public override DeferredContainer Create()
- {
- DeferredContainer container = new DeferredContainer();
- container.AddDeferredFacility();
- return container;
- }
- }
-}
View
88 ...ceResolution/Castle.Facilities.DeferredServiceResolution.Tests/DeferredServiceResolutionFacilityTests.cs
@@ -1,88 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-using Castle.Core.Configuration;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-using Rhino.Mocks.Interfaces;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- [TestFixture]
- public class DeferredServiceResolutionFacilityTests : StandardFixture<DeferredServiceResolutionFacility>
- {
- private IEventRaiser _componentModelCreated;
-
- [Test]
- public void Init_Always_SetsKernel()
- {
- IConfiguration configuration = _mocks.DynamicMock<IConfiguration>();
- using (_mocks.Record())
- {
- SetupInit();
- }
- _target.Init(_kernel, configuration);
- Assert.AreEqual(_kernel, _target.Kernel);
- }
-
- [Test]
- public void Init_Always_RegisteredComponentModelCreatedListeners()
- {
- IConfiguration configuration = _mocks.DynamicMock<IConfiguration>();
- using (_mocks.Record())
- {
- SetupInit();
- }
- _target.Init(_kernel, configuration);
- _mocks.VerifyAll();
- }
-
- [Test]
- public void Init_Always_AddsSubResolver()
- {
- IConfiguration configuration = _mocks.DynamicMock<IConfiguration>();
- using (_mocks.Record())
- {
- SetupInit();
- _dependencyResolver.AddSubResolver(_target.DeferredServiceResolver);
- }
- _target.Init(_kernel, configuration);
- _mocks.VerifyAll();
- }
-
- [Test]
- public void CreatingComponentModel_Always_RemembersTheModel()
- {
- ComponentModel model = new ComponentModel("Model", typeof(Random), typeof(Random));
- IConfiguration configuration = _mocks.DynamicMock<IConfiguration>();
- using (_mocks.Record())
- {
- SetupInit();
- }
- _target.Init(_kernel, configuration);
- _componentModelCreated.Raise(model);
- _mocks.VerifyAll();
- CollectionAssert.AreEqual(new ComponentModel[] { model }, _target.Models);
- }
-
- [Test]
- public void Terminate_Always_DoesNothing()
- {
- _target.Terminate();
- }
-
- public void SetupInit()
- {
- SetupResult.For(_kernel.Resolver).Return(_dependencyResolver);
- _kernel.ComponentModelCreated += null;
- _componentModelCreated = LastCall.IgnoreArguments().GetEventRaiser();
- }
-
- public override DeferredServiceResolutionFacility Create()
- {
- return new DeferredServiceResolutionFacility();
- }
- }
-}
View
50 ...erredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/DeferredServiceResolverTests.cs
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-using Castle.MicroKernel;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- [TestFixture]
- public class DeferredServiceResolverTests : StandardFixture<DeferredServiceResolver>
- {
- private IComponentModelAndKernelSource _componentModelSource;
- private IServiceInterfaceResolver _serviceInterfaceResolver;
- private List<ComponentModel> _models;
- private CreationContext _context;
- private ISubDependencyResolver _parentResolver;
- private ComponentModel _model;
- private DependencyModel _dependency;
-
- [Test]
- public void CanResolve__()
- {
- using (_mocks.Record())
- {
- SetupModelSource();
- }
- Assert.IsFalse(_target.CanResolve(_context, _parentResolver, _model, _dependency));
- }
-
- public override DeferredServiceResolver Create()
- {
- _componentModelSource = _mocks.DynamicMock<IComponentModelAndKernelSource>();
- _serviceInterfaceResolver = _mocks.DynamicMock<IServiceInterfaceResolver>();
- _models = new List<ComponentModel>();
- _context = new CreationContext(new DependencyModel[0]);
- _model = new ComponentModel("TargetModel", typeof(Random), typeof(Random));
- _parentResolver = null;
- _dependency = new DependencyModel(DependencyType.Service, "ServiceProvider", typeof(IServiceProvider), false);
- return new DeferredServiceResolver(_componentModelSource, _serviceInterfaceResolver);
- }
-
- public void SetupModelSource()
- {
- SetupResult.For(_componentModelSource.Models).Return(_models);
- }
- }
-}
View
36 ...s.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/Properties/AssemblyInfo.cs
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 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("Castle.Facilities.DeferredServiceResolution.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("N/A")]
-[assembly: AssemblyProduct("Castle.Facilities.DeferredServiceResolution.Tests")]
-[assembly: AssemblyCopyright("Copyright © N/A 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("54a1da60-1cf2-47dd-814c-9a80ad40edc2")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
55 ...rredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/ServiceInterfaceResolverTests.cs
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- [TestFixture]
- public class ServiceInterfaceResolverTests : StandardFixture<ServiceInterfaceResolver>
- {
- [Test]
- public void Resolve_Service1WithNoServices_Fails()
- {
- Assert.IsNull(_target.Resolve(typeof(IService1), ComponentModels.WithNoServices(), false));
- }
-
- [Test]
- public void Resolve_Service1WithService1_IsRightModel()
- {
- Assert.AreEqual(ComponentModels.Service1Model, _target.Resolve(typeof(IService1), ComponentModels.WithService1And2(), false));
- }
-
- [Test]
- public void Resolve_Service3WithoutService3ButHasOther_Fails()
- {
- Assert.IsNull(_target.Resolve(typeof(IService3), ComponentModels.WithService1And2(), false));
- }
-
- [Test]
- public void Resolve_Service1WhenHasDuplicateImplementors_Fails()
- {
- Assert.IsNull(_target.Resolve(typeof(IService1), ComponentModels.WithDuplicateService1(), false));
- }
-
- [Test]
- public void Resolve_Service2WhenItsOneOfTwoImplementations_IsRightModel()
- {
- Assert.AreEqual(ComponentModels.Service1And2Model, _target.Resolve(typeof(IService2), ComponentModels.WithDuplicateService1(), false));
- }
-
- [Test]
- public void Resolve_ServiceByClassImplementationNotServiceAndIsThere_IsRightModel()
- {
- Assert.AreEqual(ComponentModels.NoServicesModel, _target.Resolve(typeof(NoServices), ComponentModels.WithService1And2And3(), false));
- }
-
- public override ServiceInterfaceResolver Create()
- {
- return new ServiceInterfaceResolver();
- }
- }
-}
View
29 ...acilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.Tests/StandardFixture.cs
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.MicroKernel;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public abstract class StandardFixture<TClass>
- {
- protected TClass _target;
- protected MockRepository _mocks;
- protected IKernel _kernel;
- protected IDependencyResolver _dependencyResolver;
-
- [SetUp]
- public virtual void Setup()
- {
- _mocks = new MockRepository();
- _kernel = _mocks.DynamicMock<IKernel>();
- _dependencyResolver = _mocks.DynamicMock<IDependencyResolver>();
- _target = Create();
- }
-
- public abstract TClass Create();
- }
-}
View
26 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.sln
@@ -1,26 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Castle.Facilities.DeferredServiceResolution", "Castle.Facilities.DeferredServiceResolution\Castle.Facilities.DeferredServiceResolution.csproj", "{FD223B74-1AE9-4F5A-B476-B823A3FE3997}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Castle.Facilities.DeferredServiceResolution.Tests", "Castle.Facilities.DeferredServiceResolution.Tests\Castle.Facilities.DeferredServiceResolution.Tests.csproj", "{3636D7C8-B960-40E9-BC20-EAEC0E72964B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {FD223B74-1AE9-4F5A-B476-B823A3FE3997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FD223B74-1AE9-4F5A-B476-B823A3FE3997}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FD223B74-1AE9-4F5A-B476-B823A3FE3997}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FD223B74-1AE9-4F5A-B476-B823A3FE3997}.Release|Any CPU.Build.0 = Release|Any CPU
- {3636D7C8-B960-40E9-BC20-EAEC0E72964B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3636D7C8-B960-40E9-BC20-EAEC0E72964B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3636D7C8-B960-40E9-BC20-EAEC0E72964B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3636D7C8-B960-40E9-BC20-EAEC0E72964B}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
View
86 ...lities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/AttributeBasedRegisterer.cs
@@ -1,86 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-using Castle.Core;
-using Castle.MicroKernel;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class AttributeBasedRegisterer
- {
- #region Logging
- private static readonly log4net.ILog _log = log4net.LogManager.GetLogger(typeof(AttributeBasedRegisterer));
- #endregion
-
- public void RegisterAssembly(IKernel kernel, Assembly assembly)
- {
- foreach (Type type in assembly.GetTypes())
- {
- if (HasAttribute(type))
- {
- RegisterType(kernel, type);
- }
- }
- }
-
- public void RegisterType(IKernel kernel, Type type)
- {
- if (type.IsAbstract || type.IsInterface)
- {
- throw new InvalidOperationException("Can't register abstract type: " + type);
- }
- if (!kernel.HasComponent(type) && !IsManualRegistered(type))
- {
- WindsorServiceAttribute details = GetWindsorServiceAttribute(type);
- string key = CreateKey(type);
- if (details != null && !String.IsNullOrEmpty(details.Name))
- {
- key = details.Name;
- }
- if (details != null && details.ServiceType != null)
- {
- _log.DebugFormat("Registering {0} as {1} providing {2}", type, key, details.ServiceType);
- kernel.AddComponent(key, details.ServiceType, type);
- }
- else
- {
- _log.DebugFormat("Registering {0} as {1}", type, key);
- kernel.AddComponent(key, type);
- }
- }
- }
-
- private static bool IsManualRegistered(Type type)
- {
- return AttributeHelper.GetSingleUseAttribute<ManualWindsorRegistrationAttribute>(type) != null;
- }
-
- private static bool HasAttribute(Type type)
- {
- return AttributeHelper.GetSingleUseAttribute<LifestyleAttribute>(type) != null;
- }
-
- private static WindsorServiceAttribute GetWindsorServiceAttribute(Type type)
- {
- return AttributeHelper.GetSingleUseAttribute<WindsorServiceAttribute>(type);
- }
-
- private static string CreateKey(Type serviceType)
- {
- return serviceType.FullName;
- }
- }
- public static class AttributeHelper
- {
- public static T GetSingleUseAttribute<T>(Type type) where T : Attribute
- {
- T[] attributes = (T[]) type.GetCustomAttributes(typeof(T), true);
- if (attributes.Length == 0)
- {
- return null;
- }
- return attributes[0];
- }
- }
-}
View
87 ...esolution/Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.csproj
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21004</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{FD223B74-1AE9-4F5A-B476-B823A3FE3997}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Castle.Facilities.DeferredServiceResolution</RootNamespace>
- <AssemblyName>Castle.Facilities.DeferredServiceResolution</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SignAssembly>true</SignAssembly>
- <AssemblyOriginatorKeyFile>Castle.Facilities.DeferredServiceResolution.snk</AssemblyOriginatorKeyFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\Build\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\Build\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.Core.dll</HintPath>
- </Reference>
- <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.DynamicProxy2.dll</HintPath>
- </Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.MicroKernel.dll</HintPath>
- </Reference>
- <Reference Include="Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\Castle\Castle.Windsor.dll</HintPath>
- </Reference>
- <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libraries\log4net.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AttributeBasedRegisterer.cs" />
- <Compile Include="DeferredContainer.cs" />
- <Compile Include="DeferredKernel.cs" />
- <Compile Include="DeferredServiceResolutionFacility.cs" />
- <Compile Include="DeferredServiceResolver.cs" />
- <Compile Include="IComponentModelAndKernelSource.cs" />
- <Compile Include="IServiceInterfaceResolver.cs" />
- <Compile Include="IServiceResolver.cs" />
- <Compile Include="ManualWindsorRegistrationAttribute.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ServiceInterfaceResolver.cs" />
- <Compile Include="ServiceResolutionException.cs" />
- <Compile Include="ServiceResolver.cs" />
- <Compile Include="WindsorServiceAttribute.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Castle.Facilities.DeferredServiceResolution.snk" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
BIN  ...ceResolution/Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution.snk
Binary file not shown
View
23 ...le.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredContainer.cs
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Windsor;
-using Castle.Windsor.Installer;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class DeferredContainer : WindsorContainer
- {
- #region DeferredContainer()
- public DeferredContainer()
- : base(new DeferredKernel(), new DefaultComponentInstaller())
- {
- }
- #endregion
-
- public virtual void AddDeferredFacility()
- {
- AddFacility("DeferredServiceResolutionFacility", new DeferredServiceResolutionFacility());
- }
- }
-}
View
61 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredKernel.cs
@@ -1,61 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-using Castle.MicroKernel;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class DeferredKernel : DefaultKernel
- {
- private DeferredServiceResolutionFacility _facility;
-
- public DeferredServiceResolutionFacility DeferredFacility
- {
- get { return _facility; }
- }
-
- public override void AddFacility(string key, IFacility facility)
- {
- if (facility is DeferredServiceResolutionFacility)
- {
- _facility = facility as DeferredServiceResolutionFacility;
- }
- base.AddFacility(key, facility);
- }
-
- public override IHandler GetHandler(Type service)
- {
- IHandler handler = base.GetHandler(service);
- if (handler == null)
- {
- ComponentModel model = _facility.ServiceResolver.ResolveModel(service);
- if (model != null)
- {
- handler = GetHandler(model.Name);
- }
- }
- return handler;
- }
-
- public override IHandler[] GetHandlers(Type service)
- {
- List<IHandler> handlers = new List<IHandler>(base.GetHandlers(service));
- ComponentModel model = _facility.ServiceResolver.ResolveModel(service);
- if (model != null)
- {
- handlers.Add(GetHandler(model.Name));
- }
- return handlers.ToArray();
- }
-
- public override bool HasComponent(Type serviceType)
- {
- if (base.HasComponent(serviceType))
- {
- return true;
- }
- return _facility.ServiceResolver.CanResolve(serviceType);
- }
- }
-}
View
69 ...ferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredServiceResolutionFacility.cs
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-using Castle.Core.Configuration;
-using Castle.MicroKernel;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class DeferredServiceResolutionFacility : IFacility, IComponentModelAndKernelSource
- {
- private readonly List<ComponentModel> _models;
- private readonly DeferredServiceResolver _deferredServiceResolver;
- private readonly IServiceInterfaceResolver _serviceInterfaceResolver;
- private readonly IServiceResolver _serviceResolver;
- private IKernel _kernel;
-
- public List<ComponentModel> Models
- {
- get { return _models; }
- }
-
- public IKernel Kernel
- {
- get { return _kernel; }
- }
-
- public DeferredServiceResolver DeferredServiceResolver
- {
- get { return _deferredServiceResolver; }
- }
-
- public IServiceInterfaceResolver ServiceInterfaceResolver
- {
- get { return _serviceInterfaceResolver; }
- }
-
- public IServiceResolver ServiceResolver
- {
- get { return _serviceResolver; }
- }
-
- public DeferredServiceResolutionFacility()
- {
- _models = new List<ComponentModel>();
- _serviceInterfaceResolver = new ServiceInterfaceResolver();
- _deferredServiceResolver = new DeferredServiceResolver(this, _serviceInterfaceResolver);
- _serviceResolver = new ServiceResolver(this, _serviceInterfaceResolver);
- }
-
- #region IFacility Members
- public void Init(IKernel kernel, IConfiguration facilityConfig)
- {
- _kernel = kernel;
- kernel.ComponentModelCreated += OnComponentModelCreated;
- kernel.Resolver.AddSubResolver(_deferredServiceResolver);
- }
-
- public void Terminate()
- {
- }
- #endregion
-
- private void OnComponentModelCreated(ComponentModel model)
- {
- _models.Add(model);
- }
- }
-}
View
55 ...ilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/DeferredServiceResolver.cs
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-using Castle.MicroKernel;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class DeferredServiceResolver : ISubDependencyResolver
- {
- #region Logging
- private static readonly log4net.ILog _log = log4net.LogManager.GetLogger(typeof(DeferredServiceResolver));
- #endregion
-
- #region Member Data
- private readonly IComponentModelAndKernelSource _componentModelSource;
- private readonly IServiceInterfaceResolver _serviceInterfaceResolver;
- #endregion
-
- #region DeferredServiceResolver()
- public DeferredServiceResolver(IComponentModelAndKernelSource componentModelSource, IServiceInterfaceResolver serviceInterfaceResolver)
- {
- _componentModelSource = componentModelSource;
- _serviceInterfaceResolver = serviceInterfaceResolver;
- }
- #endregion
-
- #region ISubDependencyResolver Members
- public bool CanResolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency)
- {
- try
- {
- return _serviceInterfaceResolver.AttemptResolve(dependency.TargetType, _componentModelSource.Models) != null;
- }
- catch (Exception error)
- {
- throw new ServiceResolutionException(String.Format("Error resolving {0}", model.Name), error);
- }
- }
-
- public object Resolve(CreationContext context, ISubDependencyResolver parentResolver, ComponentModel model, DependencyModel dependency)
- {
- try
- {
- ComponentModel resolved = _serviceInterfaceResolver.Resolve(dependency.TargetType, _componentModelSource.Models);
- return _componentModelSource.Kernel[resolved.Service];
- }
- catch (Exception error)
- {
- throw new ServiceResolutionException(String.Format("Error resolving {0}", model.Name), error);
- }
- }
- #endregion
- }
-}
View
20 ....DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/IComponentModelAndKernelSource.cs
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-using Castle.MicroKernel;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public interface IComponentModelAndKernelSource
- {
- List<ComponentModel> Models
- {
- get;
- }
- IKernel Kernel
- {
- get;
- }
- }
-}
View
13 ...ities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/IServiceInterfaceResolver.cs
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public interface IServiceInterfaceResolver
- {
- ComponentModel AttemptResolve(Type serviceType, ICollection<ComponentModel> models);
- ComponentModel Resolve(Type serviceType, ICollection<ComponentModel> models);
- }
-}
View
14 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/IServiceResolver.cs
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Core;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public interface IServiceResolver
- {
- T Resolve<T>();
- ComponentModel ResolveModel(Type type);
- bool CanResolve(Type type);
- }
-}
View
9 ...erredServiceResolution/Castle.Facilities.DeferredServiceResolution/ManualWindsorRegistrationAttribute.cs
@@ -1,9 +0,0 @@
-using System;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)]
- public class ManualWindsorRegistrationAttribute : Attribute
- {
- }
-}
View
36 ...ilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/Properties/AssemblyInfo.cs
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 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("Castle.Facilities.DeferredServiceResolution")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("N/A")]
-[assembly: AssemblyProduct("Castle.Facilities.DeferredServiceResolution")]
-[assembly: AssemblyCopyright("Copyright © N/A 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("2460c08e-ad16-4b80-b838-424f8b8f8cbc")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
89 ...lities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/ServiceInterfaceResolver.cs
@@ -1,89 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-using Castle.Core;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class ServiceInterfaceResolver : IServiceInterfaceResolver
- {
- private static readonly log4net.ILog _log = log4net.LogManager.GetLogger(typeof(ServiceInterfaceResolver));
-
- private readonly Dictionary<Type, ComponentModel> _cache = new Dictionary<Type, ComponentModel>();
-
- public ComponentModel Resolve(Type serviceType, ICollection<ComponentModel> models, bool throwOnError)
- {
- List<ComponentModel> candidates = new List<ComponentModel>();
- foreach (ComponentModel model in models)
- {
- if (IsImplementationOf(serviceType, model.Implementation))
- {
- candidates.Add(model);
- }
- }
- if (candidates.Count == 0)
- {
- if (!throwOnError) return null;
- ThrowZeroCandidates(serviceType);
- }
- if (candidates.Count > 1)
- {
- StringBuilder sb = new StringBuilder();
- foreach (ComponentModel candidate in candidates) sb.AppendFormat(" {0}", candidate.Name);
- _log.InfoFormat("Resolving {0} yielded {1} candidates ({2})", serviceType, candidates.Count, sb);
- if (!throwOnError) return null;
- ThrowTooManyCandidates(serviceType, candidates);
- }
- return candidates[0];
- }
-
- public ComponentModel AttemptResolve(Type serviceType, ICollection<ComponentModel> models)
- {
- if (_cache.ContainsKey(serviceType))
- {
- return _cache[serviceType];
- }
- ComponentModel model = Resolve(serviceType, models, false);
- if (model != null)
- {
- _cache[serviceType] = model;
- }
- return model;
- }
-
- public ComponentModel Resolve(Type serviceType, ICollection<ComponentModel> models)
- {
- if (_cache.ContainsKey(serviceType))
- {
- return _cache[serviceType];
- }
- ComponentModel model = Resolve(serviceType, models, true);
- if (model != null)
- {
- _cache[serviceType] = model;
- }
- return model;
- }
-
- private static bool IsImplementationOf(Type serviceType, Type implementation)
- {
- return serviceType.IsAssignableFrom(implementation);
- }
-
- private static void ThrowZeroCandidates(Type serviceType)
- {
- throw new ServiceResolutionException(String.Format("Can't resolve {0}, no candidates were found!", serviceType));
- }
-
- private static void ThrowTooManyCandidates(Type serviceType, IEnumerable<ComponentModel> candidates)
- {
- StringBuilder sb = new StringBuilder();
- foreach (ComponentModel candidate in candidates)
- {
- sb.AppendFormat(" {0}", candidate.Name);
- }
- throw new ServiceResolutionException(String.Format("Can't resolve {0}, too many candidates are found:\n{1}", serviceType, sb));
- }
- }
-}
View
16 ...ties.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/ServiceResolutionException.cs
@@ -1,16 +0,0 @@
-using System;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class ServiceResolutionException : Exception
- {
- public ServiceResolutionException(string message)
- : base(message)
- {
- }
- public ServiceResolutionException(string message, Exception innerException)
- : base(message, innerException)
- {
- }
- }
-}
View
39 Castle.Facilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/ServiceResolver.cs
@@ -1,39 +0,0 @@
-using System;
-using Castle.Core;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- public class ServiceResolver : IServiceResolver
- {
- #region Member Data
- private readonly IComponentModelAndKernelSource _componentModelAndKernelSource;
- private readonly IServiceInterfaceResolver _serviceInterfaceResolver;
- #endregion
-
- #region ServiceResolver()
- public ServiceResolver(IComponentModelAndKernelSource componentModelAndKernelSource, IServiceInterfaceResolver serviceInterfaceResolver)
- {
- _componentModelAndKernelSource = componentModelAndKernelSource;
- _serviceInterfaceResolver = serviceInterfaceResolver;
- }
- #endregion
-
- #region IServiceResolver Members
- public T Resolve<T>()
- {
- ComponentModel resolved = ResolveModel(typeof(T));
- return (T)_componentModelAndKernelSource.Kernel[resolved.Service];
- }
-
- public ComponentModel ResolveModel(Type type)
- {
- return _serviceInterfaceResolver.AttemptResolve(type, _componentModelAndKernelSource.Models);
- }
-
- public bool CanResolve(Type type)
- {
- return _serviceInterfaceResolver.AttemptResolve(type, _componentModelAndKernelSource.Models) != null;
- }
- #endregion
- }
-}
View
31 ...ilities.DeferredServiceResolution/Castle.Facilities.DeferredServiceResolution/WindsorServiceAttribute.cs
@@ -1,31 +0,0 @@
-using System;
-
-namespace Castle.Facilities.DeferredServiceResolution
-{
- [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)]
- public class WindsorServiceAttribute : Attribute
- {
- private readonly string _name;
- private readonly Type _serviceType;
-
- public WindsorServiceAttribute(string name, Type serviceType)
- {
- _name = name;
- _serviceType = serviceType;
- }
- public WindsorServiceAttribute(Type serviceType)
- {
- _serviceType = serviceType;
- }
-
- public string Name
- {
- get { return _name; }
- }
-
- public Type ServiceType
- {
- get { return _serviceType; }
- }
- }
-}
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Core.dll
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Core.pdb
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.DynamicProxy2.dll
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.DynamicProxy2.pdb
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.MicroKernel.dll
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.MicroKernel.pdb
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Windsor.dll
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Castle/Castle.Windsor.pdb
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Testing/Rhino.Mocks.dll
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/Testing/nunit.framework.dll
Binary file not shown
View
BIN  Castle.Facilities.DeferredServiceResolution/Libraries/log4net.dll
Binary file not shown
View
65 Castle.Facilities.DeferredServiceResolution/rakefile.rb
@@ -1,65 +0,0 @@
-#
-# $Id$
-#
-
-require 'pathname'
-
-$ProjectKey = :deferred_service_resolution
-
-class Projects
- def initialize
- end
-
- def self.get_framework(version='2.0.50727')
- Pathname.new("C:/WINDOWS/Microsoft.NET/Framework/v#{version}")
- end
-
- def self.get_msbuild
- directory = get_framework('3.5')
- if !directory.directory? then
- directory = get_framework()
- end
- directory.join("MsBuild.exe")
- end
-
- def self.get_map
- dir = Pathname.new(Dir.pwd)
- while dir do
- if dir.join("pathing.rb").file? then
- break
- end
- if dir == dir.dirname then
- dir = nil
- break
- end
- dir = dir.dirname
- end
- if dir.nil? then
- raise "Unable to locate pathing.rb!"
- end
- require dir.join("pathing.rb")
- $Copies[$ProjectKey] || []
- end
-
- def self.get_home
- end
-end
-
-def msbuild(project, target=nil)
- path = Projects.get_msbuild
- sh "#{path} #{project}" unless target
- sh "#{path} #{project} /t:#{target}" if target
-end
-
-task :default do
- msbuild("Castle.Facilities.DeferredServiceResolution.sln", "Rebuild")
-end
-
-task :copy => [ :default ] do
- Projects.get_map.each do |destiny|
- cp "Build/Debug/Castle.Facilities.DeferredServiceResolution.dll", destiny
- cp "Build/Debug/Castle.Facilities.DeferredServiceResolution.pdb", destiny
- end
-end
-
-# EOF
View
97 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Machine.BackgroundJobs.Tests.csproj
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21004</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{D51F5063-688D-4A1E-9C69-E780923660C4}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Machine.BackgroundJobs</RootNamespace>
- <AssemblyName>Machine.BackgroundJobs.Tests</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\..\Build\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\..\Build\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\Libraries\Castle\Castle.Core.dll</HintPath>
- </Reference>
- <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\Libraries\Testing\Castle.DynamicProxy2.dll</HintPath>
- </Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\Libraries\Castle\Castle.MicroKernel.dll</HintPath>
- </Reference>
- <Reference Include="Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\Libraries\Castle\Castle.Windsor.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework, Version=2.4.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\Libraries\Testing\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="Rhino.Mocks, Version=3.1.0.584, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\Libraries\Testing\Rhino.Mocks.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="QueuedJobTests.cs" />
- <Compile Include="Sample\LongRunningJob.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Sample\LongRunningJobHandler.cs" />
- <Compile Include="Sample\LongRunningJobRepository.cs" />
- <Compile Include="Services\Impl\BackgroundJobQueuerTests.cs" />
- <Compile Include="Services\Impl\BackgroundJobSpawnerTests.cs" />
- <Compile Include="Services\Impl\JobManagerTests.cs" />
- <Compile Include="Services\Impl\SimpleJobRepositoryLocatorTests.cs" />
- <Compile Include="Services\Impl\SimpleJobRepositoryTests.cs" />
- <Compile Include="Services\Impl\WindsorJobHandlerLocatorTests.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\Machine.Core\Machine.Core.Tests\Machine.Core.Tests.csproj">
- <Project>{AA05C128-39BA-41D0-A627-A5B20F8A79FF}</Project>
- <Name>Machine.Core.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\Machine.Core\Machine.Core\Machine.Core.csproj">
- <Project>{CC4332BD-DC7F-4B89-8C38-F8B51CADC991}</Project>
- <Name>Machine.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\Machine.BackgroundJobs\Machine.BackgroundJobs.csproj">
- <Project>{93E29839-10C4-4C32-B3FD-4DFEB4F44B9B}</Project>
- <Name>Machine.BackgroundJobs</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
36 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Properties/AssemblyInfo.cs
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 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("Machine.BackgroundJobs.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("N/A")]
-[assembly: AssemblyProduct("Machine.BackgroundJobs.Tests")]
-[assembly: AssemblyCopyright("Copyright © N/A 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("a3e006b9-4bbb-402f-8a5d-ecaf927b98e7")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
55 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/QueuedJobTests.cs
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Machine.BackgroundJobs.Services;
-using Machine.Core;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Machine.BackgroundJobs
-{
- [TestFixture]
- public class QueuedJobTests : StandardFixture<QueuedJob>
- {
- public override QueuedJob Create()
- {
- return new QueuedJob(GetNormal<IBackgroundJob>(), GetNormal<IBackgroundJobHandler>());
- }
-
- [Test]
- public void Run_Always_StartsAndCompletes()
- {
- using (_mocks.Ordered())
- {
- Get<IBackgroundJob>().IsStarted = true;
- Get<IBackgroundJob>().PercentageComplete = 0.0;
- Get<IBackgroundJobHandler>().HandleJob(Get<IBackgroundJob>());
- Get<IBackgroundJob>().IsComplete = true;
- Get<IBackgroundJob>().PercentageComplete = 100.0;
- }
- _mocks.ReplayAll();
- _target.Run();
- _mocks.VerifyAll();
- }
-
- [Test]
- public void Run_Exception_SwallowsButSavesInJob()
- {
- ArgumentException error = new ArgumentException();
- using (_mocks.Ordered())
- {
- Get<IBackgroundJob>().IsStarted = true;
- Get<IBackgroundJob>().PercentageComplete = 0.0;
- Get<IBackgroundJobHandler>().HandleJob(Get<IBackgroundJob>());
- LastCall.Throw(error);
- Get<IBackgroundJob>().Error = error;
- Get<IBackgroundJob>().IsComplete = true;
- Get<IBackgroundJob>().PercentageComplete = 100.0;
- }
- _mocks.ReplayAll();
- _target.Run();
- _mocks.VerifyAll();
- }
- }
-}
View
17 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Sample/LongRunningJob.cs
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Machine.BackgroundJobs.Sample
-{
- [BackgroundJob(typeof(LongRunningJobHandler), typeof(LongRunningJobRepository))]
- public class LongRunningJob : SimpleBackgroundJob
- {
- private TimeSpan _runFor;
-
- public TimeSpan RunFor
- {
- get { return _runFor; }
- set { _runFor = value; }
- }
- }
-}
View
39 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Sample/LongRunningJobHandler.cs
@@ -1,39 +0,0 @@
-using System;
-using Machine.BackgroundJobs.Services;
-using Machine.BackgroundJobs.Services.Impl;
-using Machine.Core.Services;
-
-namespace Machine.BackgroundJobs.Sample
-{
- public class LongRunningJobHandler : AbstractBackgroundJobHandler<LongRunningJob>
- {
- #region Member Data
- private readonly IThreadManager _threadManager;
- private readonly IJobRepository _jobRepository;
- #endregion
-
- #region LongRunningJobHandler()
- public LongRunningJobHandler(IThreadManager threadManager, IJobRepository jobRepository)
- {
- _threadManager = threadManager;
- _jobRepository = jobRepository;
- }
- #endregion
-
- #region IBackgroundJobHandler Members
- public override void HandleJob(LongRunningJob job)
- {
- DateTime started = DateTime.Now;
- while (true)
- {
- if (DateTime.Now - started > job.RunFor)
- {
- break;
- }
- _threadManager.Sleep(TimeSpan.FromSeconds(1.0));
- _jobRepository.SaveJob(job);
- }
- }
- #endregion
- }
-}
View
10 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Sample/LongRunningJobRepository.cs
@@ -1,10 +0,0 @@
-using System.Collections.Generic;
-
-using Machine.BackgroundJobs.Services.Impl;
-
-namespace Machine.BackgroundJobs.Sample
-{
- public class LongRunningJobRepository : SimpleJobRepository
- {
- }
-}
View
33 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/BackgroundJobQueuerTests.cs
@@ -1,33 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Machine.BackgroundJobs.Sample;
-using Machine.Core;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Machine.BackgroundJobs.Services.Impl
-{
- [TestFixture]
- public class BackgroundJobQueuerTests : StandardFixture<BackgroundJobQueuer>
- {
- public override BackgroundJobQueuer Create()
- {
- return new BackgroundJobQueuer(Get<IJobRepositoryLocator>());
- }
-
- [Test]
- public void QueueJob_Always_LocatesRepositoryAndSaves()
- {
- LongRunningJob job = new LongRunningJob();
- using (_mocks.Record())
- {
- SetupResult.For(Get<IJobRepositoryLocator>().LocateJobRepository(typeof(LongRunningJob))).Return(Get<IJobRepository>());
- Get<IJobRepository>().SaveJob(job);
- }
- Assert.AreEqual(job, _target.QueueJob(job));
- _mocks.VerifyAll();
- }
- }
-}
View
48 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/BackgroundJobSpawnerTests.cs
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Machine.Core;
-using Machine.Core.Services;
-using Machine.BackgroundJobs.Sample;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-using Rhino.Mocks.Constraints;
-
-namespace Machine.BackgroundJobs.Services.Impl
-{
- [TestFixture]
- public class BackgroundJobSpawnerTests : StandardFixture<BackgroundJobSpawner>
- {
- public override BackgroundJobSpawner Create()
- {
- return new BackgroundJobSpawner(Get<IThreadManager>(), Get<IJobHandlerLocator>());
- }
-
- [Test]
- public void Spawn_Always_LocatesHandlerAndCreatesThreadWithQeuedJob()
- {
- LongRunningJob job = new LongRunningJob();
- job.JobNumber = 1;
- using (_mocks.Record())
- {
- SetupResult.For(Get<IJobHandlerLocator>().LocateJobHandler(typeof(LongRunningJob))).Return(Get<IBackgroundJobHandler>());
- Expect.Call(Get<IThreadManager>().CreateThread(Get<IRunnable>())).Constraints(Is.TypeOf(typeof(QueuedJob))).Return(Get<IThread>());
- Get<IThread>().Start();
- }
- _target.SpawnJob(job);
- _mocks.VerifyAll();
- }
-
- [Test]
- [ExpectedException(typeof(ArgumentException))]
- public void Spawn_NotSavedNoNumber_Throws()
- {
- LongRunningJob job = new LongRunningJob();
- using (_mocks.Record())
- {
- }
- _target.SpawnJob(job);
- }
- }
-}
View
92 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/JobManagerTests.cs
@@ -1,92 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Machine.BackgroundJobs.Sample;
-using Machine.Core;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Machine.BackgroundJobs.Services.Impl
-{
- [TestFixture]
- public class JobManagerTests : StandardFixture<JobManager>
- {
- private readonly List<IBackgroundJob> _jobs = new List<IBackgroundJob>();
-
- public override JobManager Create()
- {
- GetNormal<IJobRepository>();
- return new JobManager(Get<IJobRepositoryLocator>(), Get<IBackgroundJobQueuer>(), Get<IBackgroundJobSpawner>());
- }
-
- [Test]
- public void FindActiveJobs_Always_GetsFromRepository()
- {
- using (_mocks.Record())
- {
- SetupResult.For(Get<IJobRepositoryLocator>().LocateJobRepository(typeof(LongRunningJob))).Return(Get<IJobRepository>());
- SetupResult.For(Get<IJobRepository>().FindActiveJobs()).Return(_jobs);
- }
- Assert.AreEqual(_jobs, _target.FindActiveJobs(typeof(LongRunningJob)));
- }
-
- [Test]
- public void FindCompletedJobs_Always_GetsFromRepository()
- {
- using (_mocks.Record())
- {
- SetupResult.For(Get<IJobRepositoryLocator>().LocateJobRepository(typeof(LongRunningJob))).Return(Get<IJobRepository>());
- SetupResult.For(Get<IJobRepository>().FindCompletedJobs()).Return(_jobs);
- }
- Assert.AreEqual(_jobs, _target.FindCompletedJobs(typeof(LongRunningJob)));
- }
-
- [Test]
- public void FindJobs_Always_GetsFromRepository()
- {
- using (_mocks.Record())
- {
- SetupResult.For(Get<IJobRepositoryLocator>().LocateJobRepository(typeof(LongRunningJob))).Return(Get<IJobRepository>());
- SetupResult.For(Get<IJobRepository>().FindJobs()).Return(_jobs);
- }
- Assert.AreEqual(_jobs, _target.FindJobs(typeof(LongRunningJob)));
- }
-
- [Test]
- public void FindJob_Always_AsksRepository()
- {
- LongRunningJob job = new LongRunningJob();
- using (_mocks.Record())
- {
- SetupResult.For(Get<IJobRepositoryLocator>().LocateJobRepository(typeof(LongRunningJob))).Return(Get<IJobRepository>());
- SetupResult.For(Get<IJobRepository>().FindJob(1)).Return(job);
- }
- Assert.AreEqual(job, _target.FindJob(typeof(LongRunningJob), 1));
- }
-
- [Test]
- public void QueueJob_Always_Queues()
- {
- LongRunningJob job = new LongRunningJob();
- using (_mocks.Record())
- {
- Expect.Call(Get<IBackgroundJobQueuer>().QueueJob(job)).Return(job);
- }
- _target.QueueJob(job);
- _mocks.VerifyAll();
- }
-
- [Test]
- public void StartJob_Always_Spawns()
- {
- LongRunningJob job = new LongRunningJob();
- using (_mocks.Record())
- {
- Get<IBackgroundJobSpawner>().SpawnJob(job);
- }
- _target.StartJob(job);
- _mocks.VerifyAll();
- }
- }
-}
View
40 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/SimpleJobRepositoryLocatorTests.cs
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Machine.BackgroundJobs.Sample;
-using Machine.Core;
-
-using NUnit.Framework;
-
-namespace Machine.BackgroundJobs.Services.Impl
-{
- [TestFixture]
- public class SimpleJobRepositoryLocatorTests : StandardFixture<SimpleJobRepositoryLocator>
- {
- public override SimpleJobRepositoryLocator Create()
- {
- return new SimpleJobRepositoryLocator();
- }
-
- [Test]
- public void LocateJobRepository_FirstCall_IsRepository()
- {
- using (_mocks.Record())
- {
- }
- Assert.IsNotNull(_target.LocateJobRepository(typeof(LongRunningJob)));
- _mocks.VerifyAll();
- }
-
- [Test]
- public void LocateJobRepository_SecondCall_IsSameRepository()
- {
- using (_mocks.Record())
- {
- }
- IJobRepository repository = _target.LocateJobRepository(typeof(LongRunningJob));
- Assert.AreEqual(repository, _target.LocateJobRepository(typeof(LongRunningJob)));
- _mocks.VerifyAll();
- }
- }
-}
View
106 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/SimpleJobRepositoryTests.cs
@@ -1,106 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Machine.BackgroundJobs.Sample;
-using Machine.Core;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Machine.BackgroundJobs.Services.Impl
-{
- [TestFixture]
- public class SimpleJobRepositoryTests : StandardFixture<SimpleJobRepository>
- {
- private LongRunningJob _job1;
- private LongRunningJob _job2;
- private LongRunningJob _job3;
-
- public override SimpleJobRepository Create()
- {
- _job1 = new LongRunningJob();
- _job2 = new LongRunningJob();
- _job3 = new LongRunningJob();
- return new SimpleJobRepository();
- }
-
- [Test]
- public void FindCompletedJobs_Always_ReturnsOnlyThoseCompleted()
- {
- using (_mocks.Record())
- {
- _job2.IsComplete = true;
- }
- _target.AddJob(_job1);
- _target.AddJob(_job2);
- _target.AddJob(_job3);
- CollectionAssert.AreEqual(new IBackgroundJob[] { _job2 }, new List<IBackgroundJob>(_target.FindCompletedJobs()));
- _mocks.VerifyAll();
- }
-
- [Test]
- public void FindActiveJobs_Always_ReturnsOnlyThoseNotCompleted()
- {
- using (_mocks.Record())
- {
- _job2.IsComplete = true;
- }
- _target.AddJob(_job1);
- _target.AddJob(_job2);
- _target.AddJob(_job3);
- CollectionAssert.AreEqual(new IBackgroundJob[] { _job1, _job3 }, new List<IBackgroundJob>(_target.FindActiveJobs()));
- _mocks.VerifyAll();
- }
-
- [Test]
- public void FindJobs_Always_ReturnsAll()
- {
- using (_mocks.Record())
- {
- _job2.IsComplete = true;
- }
- _target.AddJob(_job1);
- _target.AddJob(_job2);
- _target.AddJob(_job3);
- CollectionAssert.AreEqual(new IBackgroundJob[] { _job1, _job2, _job3 }, new List<IBackgroundJob>(_target.FindJobs()));
- _mocks.VerifyAll();
- }
-
- [Test]
- public void FindJob_IsThere_ReturnsThatJob()
- {
- using (_mocks.Record())
- {
- }
- LongRunningJob job;
- _target.AddJob(new LongRunningJob());
- _target.AddJob(job = new LongRunningJob());
- _target.AddJob(new LongRunningJob());
- Assert.AreEqual(job, _target.FindJob(2));
- _mocks.VerifyAll();
- }
-
- [Test]
- public void AddJob_NewJob_SetsJobNumber()
- {
- using (_mocks.Record())
- {
- }
- LongRunningJob job = new LongRunningJob();
- _target.AddJob(job);
- Assert.AreEqual(1, job.JobNumber);
- _mocks.VerifyAll();
- }
-
- [Test]
- [ExpectedException(typeof(InvalidOperationException))]
- public void AddJob_OldJob_Throws()
- {
- using (_mocks.Record())
- {
- }
- LongRunningJob job;
- _target.AddJob(job = new LongRunningJob());
- _target.AddJob(job);
- }
- }
-}
View
33 Machine.BackgroundJobs/Machine.BackgroundJobs.Tests/Services/Impl/WindsorJobHandlerLocatorTests.cs
@@ -1,33 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Castle.Windsor;
-
-using Machine.Core;
-using Machine.BackgroundJobs.Sample;
-
-using NUnit.Framework;
-using Rhino.Mocks;
-
-namespace Machine.BackgroundJobs.Services.Impl
-{
- [TestFixture]
- public class WindsorJobHandlerLocatorTests : StandardFixture<WindsorJobHandlerLocator>
- {
- public override WindsorJobHandlerLocator Create()
- {
- return new WindsorJobHandlerLocator(Get<IWindsorContainer>());
- }
-
- [Test]
- public void LocateJobHandler_Always_GetsFromContainer()
- {
- using (_mocks.Record())
- {
- Expect.Call(Get<IWindsorContainer>().Resolve(typeof(LongRunningJobHandler))).Return(Get<IBackgroundJobHandler>());
- }
- Assert.AreEqual(Get<IBackgroundJobHandler>(), _target.LocateJobHandler(typeof(LongRunningJob)));
- _mocks.VerifyAll();
- }
- }
-}
View
38 Machine.BackgroundJobs/Machine.BackgroundJobs.sln
@@ -1,38 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Machine.BackgroundJobs", "Machine.BackgroundJobs\Machine.BackgroundJobs.csproj", "{93E29839-10C4-4C32-B3FD-4DFEB4F44B9B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Machine.BackgroundJobs.Tests", "Machine.BackgroundJobs.Tests\Machine.BackgroundJobs.Tests.csproj", "{D51F5063-688D-4A1E-9C69-E780923660C4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Machine.Core", "..\Machine.Core\Machine.Core\Machine.Core.csproj", "{CC4332BD-DC7F-4B89-8C38-F8B51CADC991}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Machine.Core.Tests", "..\Machine.Core\Machine.Core.Tests\Machine.Core.Tests.csproj", "{AA05C128-39BA-41D0-A627-A5B20F8A79FF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {93E29839-10C4-4C32-B3FD-4DFEB4F44B9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {93E29839-10C4-4C32-B3FD-4DFEB4F44B9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {93E29839-10C4-4C32-B3FD-4DFEB4F44B9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {93E29839-10C4-4C32-B3FD-4DFEB4F44B9B}.Release|Any CPU.Build.0 = Release|Any CPU
- {D51F5063-688D-4A1E-9C69-E780923660C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D51F5063-688D-4A1E-9C69-E780923660C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D51F5063-688D-4A1E-9C69-E780923660C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D51F5063-688D-4A1E-9C69-E780923660C4}.Release|Any CPU.Build.0 = Release|Any CPU
- {CC4332BD-DC7F-4B89-8C38-F8B51CADC991}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CC4332BD-DC7F-4B89-8C38-F8B51CADC991}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CC4332BD-DC7F-4B89-8C38-F8B51CADC991}.Release|Any CPU.ActiveCfg = Release|Any CPU