SPRNET-1124
-added direct support for specifying a collection of IResource instances to configure the container -introduced various ApplicationContextArgs classes to encapsulate ever-expanding constructor params for ApplicationContexts -revise constructors chaining to fall over to ApplicationContextArgs-based constructors. -move codifation of differnt ApplicationContext 'defaults' (caseSensitive, Refresh, etc.) from ApplicationContext constructors into ApplicationContextArgs classes
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Spring.Context.Support
|
||||
{
|
||||
[TestFixture]
|
||||
public class XmlApplicationContentArgsTests
|
||||
{
|
||||
[Test]
|
||||
public void Default_CaseSensitivity_isTrue()
|
||||
{
|
||||
XmlApplicationContextArgs args = new XmlApplicationContextArgs();
|
||||
Assert.True(args.CaseSensitive);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Default_AutoRefresh_isTrue()
|
||||
{
|
||||
XmlApplicationContextArgs args = new XmlApplicationContextArgs();
|
||||
Assert.True(args.Refresh);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,15 +74,15 @@ namespace Spring.Core.IO
|
||||
[Test]
|
||||
public void ThrowsIoExceptionIfConfigSectionDoesNotExist()
|
||||
{
|
||||
IResource res = new ConfigSectionResource("DOES NOT EXIST");
|
||||
IResource res = new ConfigSectionResource(Guid.NewGuid().ToString());
|
||||
|
||||
try
|
||||
{
|
||||
Stream istm = res.InputStream;
|
||||
Assert.Fail();
|
||||
Assert.Fail("Did not receive expected IOException!");
|
||||
}
|
||||
catch(IOException ioex)
|
||||
{
|
||||
Console.WriteLine(ioex);
|
||||
catch(IOException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,7 @@
|
||||
<Compile Include="Context\Support\TypeAliasesSectionHandlerTests.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Context\Support\XmlApplicationContentArgsTests.cs" />
|
||||
<Compile Include="Context\Support\XmlApplicationContextTests.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -61,6 +61,11 @@ namespace Spring.Transaction.Config
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
protected override IResource[] ConfigurationResources
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
}
|
||||
|
||||
private const string APPCTXCFG_PROLOG = @"<?xml version='1.0' encoding='utf-8' ?>";
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Spring.Context.Support
|
||||
{
|
||||
[TestFixture]
|
||||
public class WebApplicationContextArgsTests
|
||||
{
|
||||
[Test]
|
||||
public void Default_CaseSensitivity_isFalse()
|
||||
{
|
||||
WebApplicationContextArgs args = new WebApplicationContextArgs();
|
||||
Assert.False(args.CaseSensitive);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Caching\AspNetCacheTests.cs" />
|
||||
<Compile Include="Context\Support\HttpApplicationConfigurerTests.cs" />
|
||||
<Compile Include="Context\Support\WebApplicationContextArgsTests.cs" />
|
||||
<Compile Include="Context\Support\WebApplicationContextTests.cs" />
|
||||
<Compile Include="Core\IO\WebResourceTests.cs" />
|
||||
<Compile Include="Data\Spring\Objects\Factory\Support\TestForm.aspx.cs">
|
||||
|
||||
Reference in New Issue
Block a user