resolved SPRNET-944
synced 2003, 2005 & 2008 solutions
This commit is contained in:
@@ -124,12 +124,15 @@
|
||||
</Compile>
|
||||
<Compile Include="Aop\Framework\AutoProxy\AdvisorAutoProxyCreatorCircularReferencesTests.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\AdvisorAutoProxyCreatorTests.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\AttributeAutoProxyCreatorTests.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\LogicalThreadContextAdvice.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\NoSetterProperties.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\ObjectNameAutoProxyCreatorTests.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\OrderedLogicalThreadContextCheckAdvisor.cs" />
|
||||
<Compile Include="Aop\Framework\AbstractMethodInvocationTests.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\CreatesTestObject.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\PointcutFilteringAutoProxyCreatorTests.cs" />
|
||||
<Compile Include="Aop\Framework\AutoProxy\TypeNameAutoProxyCreatorTests.cs" />
|
||||
<Compile Include="Aop\Framework\DynamicMethodInvocationTests.cs" />
|
||||
<Compile Include="Aop\Framework\CountingAfterReturningAdvice.cs" />
|
||||
<Compile Include="Aop\Framework\CountingBeforeAdvice.cs">
|
||||
|
||||
@@ -42,6 +42,14 @@ namespace Spring
|
||||
/// </remarks>
|
||||
public abstract class ExceptionsTest : StandardsComplianceTest
|
||||
{
|
||||
// sorry folks, but this is really a special case - default ctor policy doesn't apply here
|
||||
private bool ExcludeFromConstructorPolicyCheck(Type t)
|
||||
{
|
||||
//TODO: uncomment when making SyntaxErrorException public:
|
||||
if (t.FullName == "Spring.Expressions.SyntaxErrorException") return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected ExceptionsTest()
|
||||
{
|
||||
CheckedType = typeof (Exception);
|
||||
@@ -74,15 +82,21 @@ namespace Spring
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Does the exception have the 3 standard constructors?
|
||||
// Default constructor
|
||||
CheckPublicConstructor(t, "()");
|
||||
// Constructor with a single string parameter
|
||||
CheckPublicConstructor(t, "(string message)", typeof (String));
|
||||
// Constructor with a string and an inner exception
|
||||
CheckPublicConstructor(t, "(string message, Exception inner)",
|
||||
typeof (String), typeof (Exception));
|
||||
// check to see if the serialization constructor is present
|
||||
|
||||
if (!ExcludeFromConstructorPolicyCheck(t))
|
||||
{
|
||||
// Does the exception have the 3 standard constructors?
|
||||
// Default constructor
|
||||
CheckPublicConstructor(t, "()");
|
||||
// Constructor with a single string parameter
|
||||
CheckPublicConstructor(t, "(string message)", typeof (String));
|
||||
// Constructor with a string and an inner exception
|
||||
CheckPublicConstructor(t, "(string message, Exception inner)",
|
||||
typeof (String), typeof (Exception));
|
||||
}
|
||||
|
||||
|
||||
// check to see if the serialization constructor is present
|
||||
// if exception is sealed, constructor should be private
|
||||
// if exception is not sealed, constructor should be protected
|
||||
if (t.IsSealed)
|
||||
@@ -121,9 +135,10 @@ namespace Spring
|
||||
Assert.Fail(t.Name + " does not implement GetObjectData but has private fields.");
|
||||
}
|
||||
}
|
||||
if (!t.IsAbstract)
|
||||
if (!t.IsAbstract
|
||||
&& !ExcludeFromConstructorPolicyCheck(t))
|
||||
{
|
||||
CheckInstantiation(t);
|
||||
CheckInstantiation(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ using System.Runtime.Serialization.Formatters.Soap;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Web.Services;
|
||||
using antlr;
|
||||
using antlr.collections;
|
||||
using NUnit.Framework;
|
||||
using Spring.Collections;
|
||||
@@ -134,14 +135,6 @@ namespace Spring.Expressions
|
||||
|
||||
#endregion
|
||||
|
||||
[Test]
|
||||
[Ignore("SPRNET-944")]
|
||||
public void DateTests()
|
||||
{
|
||||
string dateLiteral = (string)ExpressionEvaluator.GetValue(null, "'date'");
|
||||
Assert.AreEqual("date", dateLiteral);
|
||||
}
|
||||
|
||||
#region Serialization Tests
|
||||
|
||||
/// <summary>
|
||||
@@ -279,6 +272,26 @@ namespace Spring.Expressions
|
||||
#endregion Serialization Tests
|
||||
|
||||
|
||||
[Test(Description="SPRNET-944")]
|
||||
public void DateTests()
|
||||
{
|
||||
string dateLiteral = (string)ExpressionEvaluator.GetValue(null, "'date'");
|
||||
Assert.AreEqual("date", dateLiteral);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ThrowsSyntaxErrorException()
|
||||
{
|
||||
try
|
||||
{
|
||||
ExpressionEvaluator.GetValue(null, "'date"); // unclose string literal
|
||||
Assert.Fail();
|
||||
}
|
||||
catch (RecognitionException ex)
|
||||
{
|
||||
Assert.AreEqual("Syntax Error on line 1, column 6: expecting ''', found '<EOF>' in expression"+Environment.NewLine+"''date'", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Should throw exception for null root object
|
||||
|
||||
@@ -44,9 +44,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Testing\NUnit\BaseTestAppContextTests.cs" />
|
||||
<Compile Include="Testing\NUnit\AnotherTest\LoadAppContextTests.cs" />
|
||||
<Compile Include="Testing\NUnit\CachedAppContextTests.cs" />
|
||||
<Compile Include="Testing\NUnit\AbstractDependencyInjectionSpringContextTestsTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2005.csproj">
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
/>
|
||||
<File
|
||||
RelPath = "Web\Support\ControlInterceptionTests.cs"
|
||||
SubType = "ASPXCodeBehind"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
|
||||
@@ -87,26 +87,31 @@
|
||||
<Compile Include="Objects\Factory\Support\WebObjectFactoryTests.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestSupport\DictionaryModelPersistenceMedium.cs" />
|
||||
<Compile Include="TestSupport\NUnitAdapter.cs" />
|
||||
<Compile Include="TestSupport\SessionMock.cs" />
|
||||
<Compile Include="TestSupport\TestPage.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestSupport\TestUserControl.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestSupport\TestWebContext.cs" />
|
||||
<Compile Include="TestSupport\TestWebContextTests.cs" />
|
||||
<Compile Include="TestSupport\VirtualEnvironmentMock.cs" />
|
||||
<Compile Include="TestSupport\VoidDelegate.cs" />
|
||||
<Compile Include="Threading\HttpContextStorageTests.cs" />
|
||||
<Compile Include="Threading\HybridContextStorageTests.cs" />
|
||||
<Compile Include="Util\ControlInterceptionTests.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Util\WebDIPerformanceTests.cs" />
|
||||
<Compile Include="Util\WebUtilsTests.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Web\Services\WebServiceExporterTests.cs" />
|
||||
<Compile Include="Web\Support\AbstractHandlerFactoryTests.cs" />
|
||||
<Compile Include="Web\Support\ControlInterceptionTests.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Web\Support\LocalResourceManagerTests.cs" />
|
||||
<Compile Include="Web\Support\MimeMediaTypeTests.cs" />
|
||||
<Compile Include="Web\Support\PageHandlerFactoryTests.cs" />
|
||||
<Compile Include="Web\Support\ResultFactoryRegistryTests.cs" />
|
||||
@@ -119,15 +124,13 @@
|
||||
<Compile Include="Web\UI\Controls\ValidationSummaryTests.cs" />
|
||||
<Compile Include="Web\UI\PageTests.cs">
|
||||
</Compile>
|
||||
<Compile Include="Web\UI\SessionModelPersistenceMediumTests.cs" />
|
||||
<Compile Include="Web\UI\UserControlTests.cs" />
|
||||
<None Include="Data\Spring\Context\Support\WebApplicationContextTests\Web.Config" />
|
||||
<None Include="Data\Spring\Web\Support\PageHandlerFactoryTests\Web.Config.net-1.1" />
|
||||
<None Include="Data\Spring\Web\Support\PageHandlerFactoryTests\Web.Config.net-2.0" />
|
||||
<None Include="Spring.Web.Tests.build" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Util\ControlInterceptionTests.objects.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Context\Support\HttpApplicationConfigurerTests.xml" />
|
||||
<Content Include="Data\Spring\Context\Support\WebApplicationContextTests\Dummy.aspx" />
|
||||
@@ -138,6 +141,7 @@
|
||||
<Content Include="Data\Spring\Web\Support\PageHandlerFactoryTests\MaintainsSession2.aspx" />
|
||||
<Content Include="Data\Spring\Web\Support\PageHandlerFactoryTests\DisablesSession.aspx" />
|
||||
<Content Include="Data\Spring\Web\Support\PageHandlerFactoryTests\TransferAfterSetResultSave.aspx" />
|
||||
<EmbeddedResource Include="Web\Support\ControlInterceptionTests.objects.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
|
||||
|
||||
Reference in New Issue
Block a user