SPRNET-1239 - Check for package cycles with NDepend

This commit is contained in:
markpollack
2009-11-24 18:24:03 +00:00
parent 25cd70952f
commit d0989221f9
14 changed files with 29 additions and 22 deletions

View File

@@ -20,7 +20,6 @@
using System;
using System.Reflection;
using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Config {
@@ -38,7 +37,7 @@ namespace Spring.Objects.Factory.Config {
/// injection.
/// </para>
/// <para>
/// NOTE: This interface is a special purpose interface, mainly for internal use within the framework.
/// This interface is a special purpose interface, mainly for internal use within the framework.
/// It is recommended to implement the plain <see cref="IObjectPostProcessor"/> interface as far as
/// possible, or to derive from <see cref="IInstantiationAwareObjectPostProcessor"/> in order to be shielded
/// from extension to this interface.
@@ -90,7 +89,7 @@ namespace Spring.Objects.Factory.Config {
/// In the case of any errors.
/// </exception>
/// <seealso cref="Spring.Objects.Factory.Support.AbstractObjectDefinition.HasObjectType"/>
/// <seealso cref="IConfigurableObjectDefinition.FactoryMethodName"/>
/// <seealso cref="Spring.Objects.Factory.Support.IConfigurableObjectDefinition.FactoryMethodName"/>
object PostProcessBeforeInstantiation(Type objectType, string objectName);

View File

@@ -26,7 +26,7 @@ using Spring.Objects.Factory.Config;
#endregion
namespace Spring.Objects.Factory.Support
namespace Spring.Objects.Factory.Config
{
/// <summary>
/// Denotes a special placeholder collection that may contain

View File

@@ -21,7 +21,6 @@
#region Imports
using System;
using Spring.Objects.Factory.Support;
#endregion

View File

@@ -20,7 +20,6 @@
using System;
using System.Reflection;
using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Config
{
@@ -114,7 +113,7 @@ namespace Spring.Objects.Factory.Config
/// In the case of any errors.
/// </exception>
/// <seealso cref="Spring.Objects.Factory.Support.AbstractObjectDefinition.HasObjectType"/>
/// <seealso cref="IConfigurableObjectDefinition.FactoryMethodName"/>
/// <seealso cref="Spring.Objects.Factory.Support.IConfigurableObjectDefinition.FactoryMethodName"/>
public virtual object PostProcessBeforeInstantiation(Type objectType, string objectName)
{
return null;

View File

@@ -36,7 +36,7 @@ using Spring.Util;
#endregion
namespace Spring.Objects.Factory.Support
namespace Spring.Objects.Factory.Config
{
/// <summary>
/// Tag subclass used to hold a dictionary of managed elements.

View File

@@ -30,12 +30,11 @@ using System.Globalization;
using Spring.Core;
using Spring.Core.TypeConversion;
using Spring.Core.TypeResolution;
using Spring.Objects.Factory.Config;
using Spring.Util;
#endregion
namespace Spring.Objects.Factory.Support
namespace Spring.Objects.Factory.Config
{
/// <summary>
/// Tag subclass used to hold a list of managed elements.

View File

@@ -19,10 +19,9 @@
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;
namespace Spring.Objects.Factory.Support
namespace Spring.Objects.Factory.Config
{
/// <summary>
/// Tag class which represent a Spring-managed <see cref="NameValueCollection"/> instance that

View File

@@ -26,13 +26,12 @@ using System.Collections;
using Spring.Collections;
using Spring.Core;
using Spring.Core.TypeConversion;
using Spring.Core.TypeResolution;
using Spring.Objects.Factory.Config;
using Spring.Core.TypeResolution;
using Spring.Util;
#endregion
namespace Spring.Objects.Factory.Support
namespace Spring.Objects.Factory.Config
{
/// <summary>
/// Tag subclass used to hold a set of managed elements.

View File

@@ -26,7 +26,6 @@ using System.Collections.Specialized;
using Spring.Collections;
using Spring.Util;
using Spring.Objects.Factory.Support;
#endregion
@@ -55,6 +54,7 @@ namespace Spring.Objects.Factory.Config
/// <param name="resolveHandler">The handler to be called for resolving variables contained in a string.</param>
public ObjectDefinitionVisitor(ResolveHandler resolveHandler)
{
AssertUtils.ArgumentNotNull(resolveHandler, "ResovleHandler");
this.resolveHandler = resolveHandler;
}
@@ -248,7 +248,7 @@ namespace Spring.Objects.Factory.Config
/// calls <see cref="ResolveValue"/> for list element.
/// </summary>
protected virtual void VisitManagedList(ManagedList listVal)
{
{
string elementTypeName = listVal.ElementTypeName;
if (elementTypeName != null)
{

View File

@@ -693,7 +693,7 @@
<Compile Include="Objects\Factory\Support\DefaultObjectNameGenerator.cs" />
<Compile Include="Objects\Factory\Support\IConfigurableObjectDefinition.cs" />
<Compile Include="Objects\Factory\Support\IObjectNameGenerator.cs" />
<Compile Include="Objects\Factory\Support\ManagedNameValueCollection.cs" />
<Compile Include="Objects\Factory\Config\ManagedNameValueCollection.cs" />
<Compile Include="Objects\Factory\Support\ObjectDefinitionBuilder.cs" />
<Compile Include="Objects\Factory\Support\ObjectDefinitionValueResolver.cs" />
<Compile Include="Objects\Factory\Support\SimpleAutowireCandidateResolver.cs" />
@@ -918,7 +918,7 @@
<Compile Include="Objects\Factory\Support\IInstantiationStrategy.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Objects\Factory\Support\IManagedCollection.cs">
<Compile Include="Objects\Factory\Config\IManagedCollection.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Objects\Factory\Support\IMethodReplacer.cs">
@@ -936,13 +936,13 @@
<Compile Include="Objects\Factory\Support\LookupMethodReplacer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Objects\Factory\Support\ManagedDictionary.cs">
<Compile Include="Objects\Factory\Config\ManagedDictionary.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Objects\Factory\Support\ManagedList.cs">
<Compile Include="Objects\Factory\Config\ManagedList.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Objects\Factory\Support\ManagedSet.cs">
<Compile Include="Objects\Factory\Config\ManagedSet.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Objects\Factory\Support\MethodInjectingInstantiationStrategy.cs">

View File

@@ -18,6 +18,7 @@
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;
using NUnit.Framework;
@@ -50,6 +51,13 @@ namespace Spring.Objects.Factory.Config
return rawText;
}
[Test]
[ExpectedException(typeof(ArgumentNullException))]
public void BadConstructorCall()
{
ObjectDefinitionVisitor visitor = new ObjectDefinitionVisitor(null);
}
[Test]
public void VisitObjectTypeName()
{
@@ -89,6 +97,8 @@ namespace Spring.Objects.Factory.Config
ManagedList list = od.PropertyValues.GetPropertyValue("PropertyName").Value as ManagedList;
Assert.IsNotNull(list, "Property value is not of type ManagedList. Type = [" +
od.PropertyValues.GetPropertyValue("PropertyName").Value.GetType() + "]");
Assert.AreEqual("Value", list.ElementTypeName);
Assert.AreEqual("Value", list[0]);
}

View File

@@ -21,6 +21,7 @@
using System;
using System.Collections;
using NUnit.Framework;
using Spring.Objects.Factory.Config;
namespace Spring.Objects.Factory.Support
{

View File

@@ -22,6 +22,7 @@ using System;
using System.Collections;
using System.Collections.Specialized;
using NUnit.Framework;
using Spring.Objects.Factory.Config;
namespace Spring.Objects.Factory.Support
{

View File

@@ -22,6 +22,7 @@ using System;
using System.Collections;
using NUnit.Framework;
using Spring.Collections;
using Spring.Objects.Factory.Config;
namespace Spring.Objects.Factory.Support
{