From e71ec9c45e1fbb6c07942fc7eacd2fe15b029c66 Mon Sep 17 00:00:00 2001 From: eeichinger Date: Wed, 29 Oct 2008 14:31:20 +0000 Subject: [PATCH] tests for SPRNET-1077 --- .../PropertyResourceConfigurerTests.xml | 72 +++++++++++-------- .../PropertyPlaceholderConfigurerTests.cs | 13 ++++ .../Spring.Core.Tests.dll-1.1.config | 15 ++++ .../Spring.Core.Tests.dll.config | 15 ++++ 4 files changed, 84 insertions(+), 31 deletions(-) diff --git a/test/Spring/Spring.Core.Tests/Data/Spring/Objects/Factory/Config/PropertyResourceConfigurerTests.xml b/test/Spring/Spring.Core.Tests/Data/Spring/Objects/Factory/Config/PropertyResourceConfigurerTests.xml index 0b687a98..802374d7 100644 --- a/test/Spring/Spring.Core.Tests/Data/Spring/Objects/Factory/Config/PropertyResourceConfigurerTests.xml +++ b/test/Spring/Spring.Core.Tests/Data/Spring/Objects/Factory/Config/PropertyResourceConfigurerTests.xml @@ -1,34 +1,44 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + A ${DefaultName} + + + + + Start Name + + + + - A ${DefaultName} + %{test.name.1} - - - - - Start Name - - - + + + + + %{test.name.2} + + \ No newline at end of file diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs index 97fc4f0d..ff0e91a4 100644 --- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs +++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs @@ -557,6 +557,19 @@ namespace Spring.Objects.Factory.Config Assert.AreEqual("A DefName", to.Name); } + [Test] + public void ViaXMLAndConfigSection() + { + IResource resource = new ReadOnlyXmlTestResource("PropertyResourceConfigurerTests.xml", GetType()); + XmlObjectFactory xbf = new XmlObjectFactory(resource); + PropertyPlaceholderConfigurer ppc = (PropertyPlaceholderConfigurer) xbf.GetObject("ConfigSectionPlaceholderConfigurer"); + Assert.IsNotNull(ppc); + ppc.PostProcessObjectFactory(xbf); + + Assert.AreEqual("name from section", ((TestObject)xbf.GetObject("Test3")).Name); + Assert.AreEqual("name from sectiongroup/section", ((TestObject)xbf.GetObject("Test4")).Name); + } + [Test] public void WithTypes() { diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll-1.1.config b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll-1.1.config index 6424829a..ff0f0a9a 100644 --- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll-1.1.config +++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll-1.1.config @@ -26,6 +26,11 @@ limitations under the License.
+ +
+ +
+
@@ -51,6 +56,16 @@ limitations under the License. + + + + + + + + + + diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config index b3173801..335b224c 100644 --- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config +++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config @@ -27,6 +27,11 @@ limitations under the License.
+
+ +
+ +
@@ -51,6 +56,16 @@ limitations under the License. + + + + + + + + + +