Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit a908918eb35158f44c1c2a62b0f558392ad8f6a3 1 parent fead8e5
@lahma lahma authored
View
2  .gitignore
@@ -14,3 +14,5 @@ buildlog.txt
*.suo
_ReSharper*
*.cache
+
+*.dotCover
View
2  src/Spring.Core.Configuration/Context/Attributes/ConfigurationClassObjectDefinitionReader.cs
@@ -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);
}
View
5 src/Spring.Core.Configuration/Spring.Core.Configuration.2010.csproj
@@ -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">
View
39 ...e.Configuration.Tests/Context/Attributes/ConfigurationClassObjectDefinitionReaderTests.cs
@@ -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);
+ }
+ }
+}
View
1  test/Spring.Core.Configuration.Tests/Spring.Core.Configuration.Tests.2008.csproj
@@ -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" />
View
1  test/Spring.Core.Configuration.Tests/Spring.Core.Configuration.Tests.2010.csproj
@@ -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" />
Please sign in to comment.
Something went wrong with that request. Please try again.