Permalink
Browse files

SPRNETCODECONFIG-6 ConfigurationClassObjectDefinitionReader tries to …

…resolve abstract object definitions

Also fixed output path to be net-40 for Spring.Core.Configuration.2010.csproj
  • Loading branch information...
1 parent fead8e5 commit a908918eb35158f44c1c2a62b0f558392ad8f6a3 @lahma lahma committed Apr 15, 2012
View
@@ -14,3 +14,5 @@ buildlog.txt
*.suo
_ReSharper*
*.cache
+
+*.dotCover
@@ -127,7 +127,7 @@ public static bool CheckConfigurationClassCandidate(IObjectDefinition objectDefi
}
else
{
- if (definition.ObjectTypeName != null)
+ if (definition.ObjectTypeName != null && !definition.IsAbstract)
{
objectType = TypeResolutionUtils.ResolveType(definition.ObjectTypeName);
}
@@ -18,7 +18,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>..\..\build\net-2.0\</OutputPath>
+ <OutputPath>..\..\build\net-4.0\</OutputPath>
<DefineConstants>DEBUG;TRACE;$(DefineExtraConstants)</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -30,11 +30,12 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>..\..\build\net-2.0\</OutputPath>
+ <OutputPath>..\..\build\net-4.0\</OutputPath>
<DefineConstants>TRACE;$(DefineExtraConstants)</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\build\net-2.0\Spring.Core.Configuration.XML</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging">
@@ -0,0 +1,39 @@
+#region License
+
+/*
+ * Copyright © 2010-2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#endregion
+
+using NUnit.Framework;
+
+using Spring.Objects.Factory.Support;
+
+namespace Spring.Context.Attributes
+{
+ [TestFixture]
+ public class ConfigurationClassObjectDefinitionReaderTests
+ {
+ [Test]
+ public void ShouldNotTryToResolveAbstractDefinitionsToType()
+ {
+ GenericObjectDefinition definition = new GenericObjectDefinition();
+ definition.ObjectTypeName = "~/Default.aspx";
+ definition.IsAbstract = true;
+ Assert.That(ConfigurationClassObjectDefinitionReader.CheckConfigurationClassCandidate(definition), Is.False);
+ }
+ }
+}
@@ -51,6 +51,7 @@
<Compile Include="Context\Attributes\AssemblyObjectDefinitionScannerTests.cs" />
<Compile Include="Context\Attributes\AssemblyTypeScannerTests.cs" />
<Compile Include="Context\Attributes\CodeConfigApplicationContextTests.cs" />
+ <Compile Include="Context\Attributes\ConfigurationClassObjectDefinitionReaderTests.cs" />
<Compile Include="Context\Attributes\ConfigurationClassParserTests.cs" />
<Compile Include="Context\Attributes\ScanningConfigurationClassPostProcessorTests.cs" />
<Compile Include="Context\Attributes\AbstractConfigurationClassPostProcessorTests.cs" />
@@ -51,6 +51,7 @@
<Compile Include="Context\Attributes\AssemblyObjectDefinitionScannerTests.cs" />
<Compile Include="Context\Attributes\AssemblyTypeScannerTests.cs" />
<Compile Include="Context\Attributes\CodeConfigApplicationContextTests.cs" />
+ <Compile Include="Context\Attributes\ConfigurationClassObjectDefinitionReaderTests.cs" />
<Compile Include="Context\Attributes\ConfigurationClassParserTests.cs" />
<Compile Include="Context\Attributes\ScanningConfigurationClassPostProcessorTests.cs" />
<Compile Include="Context\Attributes\AbstractConfigurationClassPostProcessorTests.cs" />

0 comments on commit a908918

Please sign in to comment.