fixed antlr warning

This commit is contained in:
eeichinger
2009-01-10 19:46:45 +00:00
parent fa904ce51d
commit 85ab052d32
9 changed files with 454 additions and 382 deletions

View File

@@ -703,7 +703,6 @@ namespace Spring.Expressions
/// Tests type node
/// </summary>
[Test]
// [Ignore("does not work yet due to parser expecting ID production within T(ID)")]
public void TestTypeNodeWithAssemblyQualifiedName()
{
Assert.AreEqual(typeof(ExpressionEvaluator), ExpressionEvaluator.GetValue(null, string.Format("T({0})", typeof(ExpressionEvaluator).AssemblyQualifiedName)));
@@ -719,6 +718,16 @@ namespace Spring.Expressions
// Assert.AreEqual(typeof(int?), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[System.Int32], mscorlib)"));
// Assert.AreEqual(typeof(int?), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[[System.Int32, mscorlib]], mscorlib)"));
Assert.AreEqual(typeof(int?), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[[int]], mscorlib)"));
Assert.AreEqual(typeof(System.Collections.Generic.Dictionary<string, bool>), ExpressionEvaluator.GetValue(null, "T(System.Collections.Generic.Dictionary`2[System.String,System.Boolean],mscorlib)"));
}
/// <summary>
/// Tests type node
/// </summary>
[Test]
public void TestTypeNodeWithAliasedGenericArguments()
{
Assert.AreEqual(typeof(System.Collections.Generic.Dictionary<string, bool>), ExpressionEvaluator.GetValue(null, "T(System.Collections.Generic.Dictionary`2[string,bool],mscorlib)"));
}
/// <summary>
@@ -1575,20 +1584,20 @@ namespace Spring.Expressions
}
/// <summary>
/// Ensure, e.g. context-names my contain a dot
/// Ensure context-names my contain dots and slashes
/// </summary>
[Test]
public void TestQualifiedNameMayContainDots()
public void TestQualifiedNameMayContainDotsAndSlashes()
{
IApplicationContext ctx =
new XmlApplicationContext(false, "assembly://Spring.Core.Tests/Spring.Context.Support/objects.xml");
ctx.Name = "my.Context";
ctx.Name = @"my.Context/bla\";
ContextRegistry.RegisterContext(ctx);
Assert.AreEqual(typeof(TestObject),
ExpressionEvaluator.GetValue(null, "@(my.Context:goran)").GetType());
Assert.AreEqual(typeof(TestObject),
ExpressionEvaluator.GetValue(null, "@(my\\.Context:goran)").GetType());
ExpressionEvaluator.GetValue(null, @"@(my.Context/bla\:goran)").GetType());
// Assert.AreEqual(typeof(TestObject),
// ExpressionEvaluator.GetValue(null, "@(my\\.Context:goran)").GetType());
}
/// <summary>

View File

@@ -0,0 +1,51 @@
#region License
/*
* Copyright 2002-2009 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 System;
using System.Collections.Generic;
using NUnit.Framework;
namespace Spring.Objects.Factory.Support
{
/// <summary>
/// </summary>
/// <author>Erich Eichinger</author>
[TestFixture]
public class ManagedDictionaryTests
{
#if NET_2_0
[Test]
public void ResolvesGenericTypeNames()
{
ManagedDictionary dict = new ManagedDictionary();
dict.Add("key", "value");
dict.KeyTypeName = "string";
dict.ValueTypeName = "System.Collections.Generic.List<[string]>";
dict.Resolve("somename", new RootObjectDefinition(typeof (object)), "prop",
delegate(string name, RootObjectDefinition definition, string argumentName, object element)
{
return new List<string>();
}
);
}
#endif
}
}

View File

@@ -1,7 +1,7 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.21022</ProductVersion>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{44B16BAA-6DF8-447C-9D7F-3AD3D854D904}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -327,6 +327,7 @@
<Compile Include="Objects\Factory\Config\VariablePlaceholderConfigurerTests.cs" />
<Compile Include="Objects\Factory\DefaultListableObjectFactoryPerfTests.cs" />
<Compile Include="Objects\Factory\DummyConfigurableFactory.cs" />
<Compile Include="Objects\Factory\Support\ManagedDictionaryTests.cs" />
<Compile Include="Objects\Factory\Support\ObjectDefinitionBuilderTests.cs" />
<Compile Include="Objects\Factory\Xml\ArrayCtorDependencyObject.cs" />
<Compile Include="Objects\Factory\Xml\LocaleTests.cs" />