This is an automated email from the ASF dual-hosted git repository. dkulp pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/avro.git
commit b9409b3bee5a45e8ffc67430e6a878be564569ce Author: Daniel Kulp <[email protected]> AuthorDate: Mon Dec 10 13:31:23 2018 -0500 Cleanup csharp tests a bit --- .../src/apache/main/Specific/SpecificReader.cs | 8 +------ .../src/apache/test/Specific/SpecificTests.cs | 26 +++++++++++----------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/lang/csharp/src/apache/main/Specific/SpecificReader.cs b/lang/csharp/src/apache/main/Specific/SpecificReader.cs index 384465b..cc8c594 100644 --- a/lang/csharp/src/apache/main/Specific/SpecificReader.cs +++ b/lang/csharp/src/apache/main/Specific/SpecificReader.cs @@ -1,4 +1,4 @@ -/** +/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -81,12 +81,6 @@ namespace Avro.Specific public class SpecificDefaultReader : DefaultReader { /// <summary> - /// Static dictionary of type names and its corresponding assembly type. - /// This is used to prevent multiple reflection for the same type name. - /// </summary> - private static IDictionary<string, Type> TypeName = new Dictionary<string, Type>(); - - /// <summary> /// Constructor /// </summary> /// <param name="writerSchema">schema of the object that wrote the data</param> diff --git a/lang/csharp/src/apache/test/Specific/SpecificTests.cs b/lang/csharp/src/apache/test/Specific/SpecificTests.cs index a39168d..aedf8f2 100644 --- a/lang/csharp/src/apache/test/Specific/SpecificTests.cs +++ b/lang/csharp/src/apache/test/Specific/SpecificTests.cs @@ -1,4 +1,4 @@ -/** +/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -30,14 +30,14 @@ namespace Avro.Test { [TestFixture] class SpecificTests - { - // The dynamically created assembly used in the test below can only be created - // once otherwise repeated tests will fail as the same type name will exist in - // multiple assemblies and so the type in the test and the type found by ObjectCreator - // will differ. This single CompilerResults only works so long as there is only one test. - // If additional tests are added then each test will need its own CompilerResults. - private static CompilerResults compres; - + { + // The dynamically created assembly used in the test below can only be created + // once otherwise repeated tests will fail as the same type name will exist in + // multiple assemblies and so the type in the test and the type found by ObjectCreator + // will differ. This single CompilerResults only works so long as there is only one test. + // If additional tests are added then each test will need its own CompilerResults. + private static CompilerResults compres; + [TestCase(@"{ ""protocol"" : ""MyProtocol"", ""namespace"" : ""com.foo"", @@ -94,9 +94,9 @@ namespace Avro.Test }" , new object[] {3, // index of the schema to serialize "com.foo.Z", // name of the schema to serialize -@"Console.WriteLine(""Constructing com.foo.Z..."");", // Empty Constructor. +@"// Console.WriteLine(""Constructing com.foo.Z..."");", // Empty Constructor. @" - Console.WriteLine(""Populating com.foo.Z...""); + // Console.WriteLine(""Populating com.foo.Z...""); string bytes = ""bytes sample text""; System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); @@ -195,7 +195,7 @@ namespace Avro.Test comparam.GenerateInMemory = true; var ccp = new Microsoft.CSharp.CSharpCodeProvider(); var units = new CodeCompileUnit[] { compileUnit }; - compres = ccp.CompileAssemblyFromDom(comparam, units); + compres = ccp.CompileAssemblyFromDom(comparam, units); Assert.IsNotNull(compres); if (compres.Errors.Count > 0) { @@ -375,4 +375,4 @@ namespace Avro.Test enumType = (EnumType)fieldValue; } } -} \ No newline at end of file +}
