context: ///////////////////////////////////////////////////////////////////////////////////////
  // Copyright (C) 2006-2015 Esper Team. All rights reserved.                           /
  // http://esper.codehaus.org                                                          /
  // ---------------------------------------------------------------------------------- /
  // The software in this package is published under the terms of the GPL license       /
  // a copy of which has been included with this distribution in the license.txt file.  /
  ///////////////////////////////////////////////////////////////////////////////////////
  
  using System;
  using System.Collections.Generic;
  using System.Data;
  using System.Linq;
  using System.Net;
  using System.Xml.XPath;
  
  using com.espertech.esper.common.client.configuration.common;
  using com.espertech.esper.common.client.configuration.compiler;
  using com.espertech.esper.common.client.configuration.runtime;
  using com.espertech.esper.common.client.scopetest;
  using com.espertech.esper.common.client.soda;
  using com.espertech.esper.common.client.util;
  using com.espertech.esper.common.@internal.db;
  using com.espertech.esper.common.@internal.@event.bean.core;
  using com.espertech.esper.common.@internal.type;
  using com.espertech.esper.common.@internal.util;
  using com.espertech.esper.compat;
  using com.espertech.esper.compat.collections;
  using com.espertech.esper.container;
  
  using NUnit.Framework;
  
  namespace com.espertech.esper.common.client.configuration
  {
      public class TestConfigurationParser : AbstractCommonTest
      {
          [Test]
          public void TestRegressionFileConfig()
          {
              var config = new Configuration(container);
              var url = container.ResourceManager().ResolveResourceURL(TestConfiguration.ESPER_TEST_CONFIG);
              using (var client = new WebClient()) {
                  using (var stream = client.OpenRead(url)) {
                      ConfigurationParser.DoConfigure(config, stream, url.ToString());
                      AssertFileConfig(config);
                  }
              }
          }
  
          [Test]
          public void TestConfigurationDefaults()
          {
              var config = new Configuration(container);
  
              var common = config.Common;
              Assert.AreEqual(PropertyResolutionStyle.CASE_SENSITIVE, common.EventMeta.ClassPropertyResolutionStyle);
              Assert.AreEqual(AccessorStyle.NATIVE, common.EventMeta.DefaultAccessorStyle);
              Assert.AreEqual(EventUnderlyingType.MAP, common.EventMeta.DefaultEventRepresentation);
              Assert.IsTrue(common.EventMeta.AvroSettings.IsEnableAvro);
              Assert.IsTrue(common.EventMeta.AvroSettings.IsEnableNativeString);
              Assert.IsTrue(common.EventMeta.AvroSettings.IsEnableSchemaDefaultNonNull);
              Assert.IsNull(common.EventMeta.AvroSettings.ObjectValueTypeWidenerFactoryClass);
              Assert.IsNull(common.EventMeta.AvroSettings.TypeRepresentationMapperClass);
              Assert.IsFalse(common.Logging.IsEnableQueryPlan);
              Assert.IsFalse(common.Logging.IsEnableADO);
              Assert.AreEqual(TimeUnit.MILLISECONDS, common.TimeSource.TimeUnit);
              Assert.AreEqual(ThreadingProfile.NORMAL, common.Execution.ThreadingProfile);
  
              var compiler = config.Compiler;
              Assert.IsFalse(compiler.ViewResources.IsIterableUnbound);
              Assert.IsTrue(compiler.ViewResources.IsOutputLimitOpt);
              Assert.IsFalse(compiler.Logging.IsEnableCode);
              Assert.IsFalse(compiler.Logging.IsEnableFilterPlan);
              Assert.AreEqual(16, compiler.Execution.FilterServiceMaxFilterWidth);
              Assert.AreEqual(ConfigurationCompilerExecution.FilterIndexPlanningEnum.ADVANCED, compiler.Execution.FilterIndexPlanning);
              Assert.IsTrue(compiler.Execution.IsEnabledDeclaredExprValueCache);
              var byteCode = compiler.ByteCode;
              Assert.IsFalse(byteCode.IsIncludeComments);
              Assert.IsFalse(byteCode.IsIncludeDebugSymbols);
              Assert.IsTrue(byteCode.IsAttachEPL);
              Assert.IsFalse(byteCode.IsAttachModuleEPL);
              Assert.IsFalse(byteCode.IsAttachPatternEPL);
              Assert.IsFalse(byteCode.IsInstrumented);
              Assert.IsFalse(byteCode.IsAllowSubscriber);
              Assert.AreEqual(NameAccessModifier.PRIVATE, byteCode.AccessModifierContext);
              Assert.AreEqual(NameAccessModifier.PRIVATE, byteCode.AccessModifierEventType);
              Assert.AreEqual(NameAccessModifier.PRIVATE, byteCode.AccessModifierExpression);
              Assert.AreEqual(NameAccessModifier.PRIVATE, byteCode.AccessModifierNamedWindow);
              Assert.AreEqual(NameAccessModifier.PRIVATE, byteCode.AccessModifierScript);
              Assert.AreEqual(NameAccessModifier.PRIVATE, byteCode.AccessModifierTable);
              Assert.AreEqual(NameAccessModifier.PRIVATE, byteCode.AccessModifierVariable);
              Assert.AreEqual(EventTypeBusModifier.NONBUS, byteCode.BusModifierEventType);
              Assert.AreEqual(8, byteCode.ThreadPoolCompilerNumThreads);
              Assert.IsNull(byteCode.ThreadPoolCompilerCapacity);
              Assert.AreEqual(16*1024, byteCode.MaxMethodsPerClass);
              Assert.IsTrue(byteCode.IsAllowInlinedClass);
              Assert.AreEqual(StreamSelector.ISTREAM_ONLY, compiler.StreamSelection.DefaultStreamSelector);
              Assert.IsFalse(compiler.Language.IsSortUsingCollator);
              Assert.IsFalse(compiler.Expression.IsIntegerDivision);
              Assert.IsFalse(compiler.Expression.IsDivisionByZeroReturnsNull);
              Assert.IsTrue(compiler.Expression.IsUdfCache);
              Assert.IsTrue(compiler.Expression.IsExtendedAggregation);
              Assert.IsFalse(compiler.Expression.IsDuckTyping);
              Assert.IsNull(compiler.Expression.MathContext);
              Assert.AreEqual("js", compiler.Scripts.DefaultDialect);
              Assert.IsTrue(compiler.Scripts.IsEnabled);
              Assert.IsTrue(compiler.Serde.IsEnableExtendedBuiltin);
              Assert.IsFalse(compiler.Serde.IsEnableExternalizable);
              Assert.IsFalse(compiler.Serde.IsEnableSerializable);
              Assert.IsFalse(compiler.Serde.IsEnableSerializationFallback);
              Assert.IsTrue(compiler.Serde.SerdeProviderFactories.IsEmpty());
              
              var runtime = config.Runtime;
              Assert.IsTrue(runtime.Threading.IsInsertIntoDispatchPreserveOrder);
              Assert.AreEqual(100, runtime.Threading.InsertIntoDispatchTimeout);
              Assert.IsTrue(runtime.Threading.IsListenerDispatchPreserveOrder);
              Assert.AreEqual(1000, runtime.Threading.ListenerDispatchTimeout);
              Assert.IsTrue(runtime.Threading.IsInternalTimerEnabled);
              Assert.AreEqual(100, runtime.Threading.InternalTimerMsecResolution);
              Assert.AreEqual(Locking.SPIN, runtime.Threading.InsertIntoDispatchLocking);
              Assert.AreEqual(Locking.SPIN, runtime.Threading.ListenerDispatchLocking);
              Assert.IsFalse(runtime.Threading.IsThreadPoolInbound);
              Assert.IsFalse(runtime.Threading.IsThreadPoolOutbound);
              Assert.IsFalse(runtime.Threading.IsThreadPoolRouteExec);
              Assert.IsFalse(runtime.Threading.IsThreadPoolTimerExec);
              Assert.AreEqual(2, runtime.Threading.ThreadPoolInboundNumThreads);
              Assert.AreEqual(2, runtime.Threading.ThreadPoolOutboundNumThreads);
              Assert.AreEqual(2, runtime.Threading.ThreadPoolRouteExecNumThreads);
              Assert.AreEqual(2, runtime.Threading.ThreadPoolTimerExecNumThreads);
              Assert.IsNull(runtime.Threading.ThreadPoolInboundCapacity);
              Assert.IsNull(runtime.Threading.ThreadPoolOutboundCapacity);
              Assert.IsNull(runtime.Threading.ThreadPoolRouteExecCapacity);
              Assert.IsNull(runtime.Threading.ThreadPoolTimerExecCapacity);
              Assert.IsFalse(runtime.Threading.IsRuntimeFairlock);
              Assert.IsFalse(runtime.MetricsReporting.IsRuntimeMetrics);
              Assert.IsTrue(runtime.Threading.IsNamedWindowConsumerDispatchPreserveOrder);
              Assert.AreEqual(Int32.MaxValue, runtime.Threading.NamedWindowConsumerDispatchTimeout);
              Assert.AreEqual(Locking.SPIN, runtime.Threading.NamedWindowConsumerDispatchLocking);
              Assert.IsFalse(runtime.Logging.IsEnableExecutionDebug);
              Assert.IsTrue(runtime.Logging.IsEnableTimerDebug);
              Assert.IsNull(runtime.Logging.AuditPattern);
              Assert.AreEqual(15000, runtime.Variables.MsecVersionRelease);
              Assert.IsNull(runtime.Patterns.MaxSubexpressions);
              Assert.IsTrue(runtime.Patterns.IsMaxSubexpressionPreventStart);
              Assert.IsNull(runtime.MatchRecognize.MaxStates);
              Assert.IsTrue(runtime.MatchRecognize.IsMaxStatesPreventStart);
              Assert.AreEqual(TimeSourceType.MILLI, runtime.TimeSource.TimeSourceType);
              Assert.IsFalse(runtime.Execution.IsPrioritized);
              Assert.IsFalse(runtime.Execution.IsDisableLocking);
              Assert.AreEqual(FilterServiceProfile.READMOSTLY, runtime.Execution.FilterServiceProfile);
              Assert.AreEqual(1, runtime.Execution.DeclaredExprValueCacheSize);
              Assert.IsTrue(runtime.Expression.IsSelfSubselectPreeval);
              Assert.AreEqual(TimeZoneInfo.Utc, runtime.Expression.TimeZone);
              Assert.IsNull(runtime.ExceptionHandling.HandlerFactories);
              Assert.AreEqual(UndeployRethrowPolicy.WARN, runtime.ExceptionHandling.UndeployRethrowPolicy);
              Assert.IsNull(runtime.ConditionHandling.HandlerFactories);
  
              var domType = new ConfigurationCommonEventTypeXMLDOM();
              Assert.IsFalse(domType.IsXPathPropertyExpr);
              Assert.IsTrue(domType.IsXPathResolvePropertiesAbsolute);
              Assert.IsTrue(domType.IsEventSenderValidatesRoot);
              Assert.IsTrue(domType.IsAutoFragment);
          }
  
          internal static void AssertFileConfig(Configuration config)
          {
              var container = config.Container;
              var common = config.Common;
              var compiler = config.Compiler;
              var runtime = config.Runtime;
  
              /*
               * COMMON
               *
               */
  
              // assert name for class
              Assert.AreEqual(3, common.EventTypeNames.Count);
              Assert.AreEqual("com.mycompany.myapp.MySampleEventOne", common.EventTypeNames.Get("MySampleEventOne"));
              Assert.AreEqual("com.mycompany.myapp.MySampleEventTwo", common.EventTypeNames.Get("MySampleEventTwo"));
              Assert.AreEqual("com.mycompany.package.MyLegacyTypeEvent", common.EventTypeNames.Get("MyLegacyTypeEvent"));
  
              // need the assembly for commons - to be certain, we are using a class that is not in any of the
              // namespaces listed below, but is in the NEsper.Commons assembly.
              var commonsAssembly = typeof(BeanEventBean).Assembly;
              
              // assert auto imports
              Assert.AreEqual(9, common.Imports.Count);
              CollectionAssert.AreEquivalent(
                  new Import[] {
                      new ImportNamespace("System"),
                      new ImportNamespace("System.Text"),
                      new ImportNamespace("com.espertech.esper.common.internal.epl.dataflow.ops", commonsAssembly.FullName),
                      new ImportNamespace("com.mycompany.myapp"),
                      new ImportNamespace("com.mycompany.myapp", "AssemblyA"),
                      new ImportNamespace("com.mycompany.myapp", "AssemblyB.dll"),
                      new ImportType("com.mycompany.myapp.ClassOne"),
                      new ImportType("com.mycompany.myapp.ClassTwo", "AssemblyB.dll"),
                      ImportBuiltinAnnotations.Instance
                  },
                  common.Imports);
  
              // assert XML DOM - no schema
              Assert.AreEqual(2, common.EventTypesXMLDOM.Count);
              var noSchemaDesc = common.EventTypesXMLDOM.Get("MyNoSchemaXMLEventName");
              Assert.AreEqual("MyNoSchemaEvent", noSchemaDesc.RootElementName);
              Assert.AreEqual("/myevent/element1", noSchemaDesc.XPathProperties.Get("element1").XPath);
              Assert.AreEqual(XPathResultType.Number, noSchemaDesc.XPathProperties.Get("element1").Type);
              Assert.IsNull(noSchemaDesc.XPathProperties.Get("element1").OptionalCastToType);
              Assert.IsNull(noSchemaDesc.XPathFunctionResolver);
              Assert.IsNull(noSchemaDesc.XPathVariableResolver);
              Assert.IsFalse(noSchemaDesc.IsXPathPropertyExpr);
  
              // assert XML DOM - with schema
              var schemaDesc = common.EventTypesXMLDOM.Get("MySchemaXMLEventName");
              Assert.AreEqual("MySchemaEvent", schemaDesc.RootElementName);
              Assert.AreEqual("MySchemaXMLEvent.xsd", schemaDesc.SchemaResource);
              Assert.AreEqual("actual-xsd-text-here", schemaDesc.SchemaText);
              Assert.AreEqual("samples:schemas:simpleSchema", schemaDesc.RootElementNamespace);
              Assert.AreEqual("default-name-space", schemaDesc.DefaultNamespace);
              Assert.AreEqual("/myevent/element2", schemaDesc.XPathProperties.Get("element2").XPath);
              Assert.AreEqual(XPathResultType.String, schemaDesc.XPathProperties.Get("element2").Type);
              Assert.AreEqual(typeof(long), schemaDesc.XPathProperties.Get("element2").OptionalCastToType);
              Assert.AreEqual("/bookstore/book", schemaDesc.XPathProperties.Get("element3").XPath);
              Assert.AreEqual(XPathResultType.NodeSet, schemaDesc.XPathProperties.Get("element3").Type);
              Assert.IsNull(schemaDesc.XPathProperties.Get("element3").OptionalCastToType);
              Assert.AreEqual("MyOtherXMLNodeEvent", schemaDesc.XPathProperties.Get("element3").OptionalEventTypeName);
              Assert.AreEqual(1, schemaDesc.NamespacePrefixes.Count);
              Assert.AreEqual("samples:schemas:simpleSchema", schemaDesc.NamespacePrefixes.Get("ss"));
              Assert.IsFalse(schemaDesc.IsXPathResolvePropertiesAbsolute);
              Assert.AreEqual("com.mycompany.OptionalFunctionResolver", schemaDesc.XPathFunctionResolver);
              Assert.AreEqual("com.mycompany.OptionalVariableResolver", schemaDesc.XPathVariableResolver);
              Assert.IsTrue(schemaDesc.IsXPathPropertyExpr);
              Assert.IsFalse(schemaDesc.IsEventSenderValidatesRoot);
              Assert.IsFalse(schemaDesc.IsAutoFragment);
              Assert.AreEqual("startts", schemaDesc.StartTimestampPropertyName);
              Assert.AreEqual("endts", schemaDesc.EndTimestampPropertyName);
  
              // assert mapped events
              Assert.AreEqual(1, common.EventTypesMapEvents.Count);
              Assert.IsTrue(common.EventTypesMapEvents.Keys.Contains("MyMapEvent"));
              var expectedProps = new HashMap<string, string>();
              expectedProps.Put("myInt", "int");
              expectedProps.Put("myString", "string");
              Assert.AreEqual(expectedProps, common.EventTypesMapEvents.Get("MyMapEvent"));
              Assert.AreEqual(1, common.MapTypeConfigurations.Count);
              var superTypes = common.MapTypeConfigurations.Get("MyMapEvent").SuperTypes;
              EPAssertionUtil.AssertEqualsExactOrder(new object[] { "MyMapSuperType1", "MyMapSuperType2" }, superTypes.ToArray());
              Assert.AreEqual("startts", common.MapTypeConfigurations.Get("MyMapEvent").StartTimestampPropertyName);
              Assert.AreEqual("endts", common.MapTypeConfigurations.Get("MyMapEvent").EndTimestampPropertyName);
  
              // assert objectarray events
              Assert.AreEqual(1, common.EventTypesNestableObjectArrayEvents.Count);
              Assert.IsTrue(common.EventTypesNestableObjectArrayEvents.ContainsKey("MyObjectArrayEvent"));
              var expectedPropsObjectArray = new HashMap<string, string>();
              expectedPropsObjectArray.Put("myInt", "int");
              expectedPropsObjectArray.Put("myString", "string");
              Assert.AreEqual(expectedPropsObjectArray, common.EventTypesNestableObjectArrayEvents.Get("MyObjectArrayEvent"));
              Assert.AreEqual(1, common.ObjectArrayTypeConfigurations.Count);
              var superTypesOA = common.ObjectArrayTypeConfigurations.Get("MyObjectArrayEvent").SuperTypes;
              EPAssertionUtil.AssertEqualsExactOrder(new object[] { "MyObjectArraySuperType1", "MyObjectArraySuperType2" }, superTypesOA.ToArray());
              Assert.AreEqual("startts", common.ObjectArrayTypeConfigurations.Get("MyObjectArrayEvent").StartTimestampPropertyName);
              Assert.AreEqual("endts", common.ObjectArrayTypeConfigurations.Get("MyObjectArrayEvent").EndTimestampPropertyName);
  
              // assert avro events
              Assert.AreEqual(2, common.EventTypesAvro.Count);
              var avroOne = common.EventTypesAvro.Get("MyAvroEvent");
              Assert.AreEqual(
                  "{\"type\":\"record\",\"name\":\"typename\",\"fields\":[{\"name\":\"num\",\"type\":\"int\"}]}", avroOne.AvroSchemaText);
              Assert.IsNull(avroOne.AvroSchema);
              Assert.IsNull(avroOne.StartTimestampPropertyName);
              Assert.IsNull(avroOne.EndTimestampPropertyName);
              Assert.IsTrue(avroOne.SuperTypes.IsEmpty());
              var avroTwo = common.EventTypesAvro.Get("MyAvroEventTwo");
              Assert.AreEqual(
                  "{\"type\":\"record\",\"name\":\"MyAvroEvent\",\"fields\":[{\"name\":\"carId\",\"type\":\"int\"},{\"name\":\"carType\",\"type\":{\"type\":\"string\",\"avro.string\":\"string\"}}]}",
                  avroTwo.AvroSchemaText);
              Assert.AreEqual("startts", avroTwo.StartTimestampPropertyName);
              Assert.AreEqual("endts", avroTwo.EndTimestampPropertyName);
              Assert.AreEqual("[\"SomeSuperAvro\", \"SomeSuperAvroTwo\"]", avroTwo.SuperTypes.RenderAny());
  
              // assert legacy type declaration
              Assert.AreEqual(1, common.EventTypesBean.Count);
              var legacy = common.EventTypesBean.Get("MyLegacyTypeEvent");
              Assert.AreEqual(AccessorStyle.PUBLIC, legacy.AccessorStyle);
              Assert.AreEqual(1, legacy.FieldProperties.Count);
              Assert.AreEqual("myFieldName", legacy.FieldProperties[0].AccessorFieldName);
              Assert.AreEqual("myfieldprop", legacy.FieldProperties[0].Name);
              Assert.AreEqual(1, legacy.MethodProperties.Count);
              Assert.AreEqual("myAccessorMethod", legacy.MethodProperties[0].AccessorMethodName);
              Assert.AreEqual("mymethodprop", legacy.MethodProperties[0].Name);
              Assert.AreEqual(PropertyResolutionStyle.CASE_INSENSITIVE, legacy.PropertyResolutionStyle);
              Assert.AreEqual("com.mycompany.myapp.MySampleEventFactory.createMyLegacyTypeEvent", legacy.FactoryMethod);
              Assert.AreEqual("myCopyMethod", legacy.CopyMethod);
              Assert.AreEqual("startts", legacy.StartTimestampPropertyName);
              Assert.AreEqual("endts", legacy.EndTimestampPropertyName);
  
              // assert database reference - data source config
              Assert.AreEqual(2, common.DatabaseReferences.Count);
              var configDBRef = common.DatabaseReferences.Get("mydb1");
              var dbDef = (DriverConnectionFactoryDesc) configDBRef.ConnectionFactoryDesc;
              var dbDriver = DbDriverConnectionHelper.ResolveDriver(container, dbDef);
  
              Assert.AreEqual("com.espertech.esper.epl.db.drivers.DbDriverPgSQL", dbDriver.GetType().FullName);
              Assert.AreEqual("Host=nesper-pgsql-integ.local;Database=test;Username=esper;Password=3sp3rP@ssw0rd;", dbDriver.ConnectionString);
              Assert.AreEqual(ConnectionLifecycleEnum.POOLED, configDBRef.ConnectionLifecycleEnum);
              Assert.IsNull(configDBRef.ConnectionSettings.AutoCommit);
              Assert.IsNull(configDBRef.ConnectionSettings.Catalog);
              Assert.IsNull(configDBRef.ConnectionSettings.TransactionIsolation);
  
              var lruCache = (ConfigurationCommonCacheLRU) configDBRef.DataCacheDesc;
              Assert.AreEqual(10, lruCache.Size);
              Assert.AreEqual(ColumnChangeCaseEnum.LOWERCASE, configDBRef.ColumnChangeCase);
              Assert.AreEqual(MetadataOriginEnum.SAMPLE, configDBRef.MetadataRetrievalEnum);
              //Assert.AreEqual(2, configDBRef.DataTypesMapping.Count);
              //Assert.AreEqual("int", configDBRef.DataTypesMapping[2]);
              //Assert.AreEqual("float", configDBRef.DataTypesMapping[6]);
  
              // assert database reference - driver manager config
              configDBRef = common.DatabaseReferences.Get("mydb2");
  
              var dmDef = (DriverConnectionFactoryDesc) configDBRef.ConnectionFactoryDesc;
              var dmDriver = DbDriverConnectionHelper.ResolveDriver(container, dmDef);
              Assert.AreEqual("com.espertech.esper.epl.db.drivers.DbDriverPgSQL", dmDriver.GetType().FullName);
              Assert.AreEqual("Host=nesper-pgsql-integ.local;Database=test;Username=esper;Password=3sp3rP@ssw0rd;", dmDriver.ConnectionString);
  
              Assert.AreEqual(ConnectionLifecycleEnum.RETAIN, configDBRef.ConnectionLifecycleEnum);
              Assert.AreEqual(false, configDBRef.ConnectionSettings.AutoCommit);
              Assert.AreEqual("test", configDBRef.ConnectionSettings.Catalog);
              Assert.AreEqual(IsolationLevel.ReadCommitted, configDBRef.ConnectionSettings.TransactionIsolation);
              var expCache = (ConfigurationCommonCacheExpiryTime) configDBRef.DataCacheDesc;
  
              Assert.AreEqual(60.5, expCache.MaxAgeSeconds);
              Assert.AreEqual(120.1, expCache.PurgeIntervalSeconds);
              Assert.AreEqual(CacheReferenceType.HARD, expCache.CacheReferenceType);
              Assert.AreEqual(ColumnChangeCaseEnum.UPPERCASE, configDBRef.ColumnChangeCase);
              Assert.AreEqual(MetadataOriginEnum.METADATA, configDBRef.MetadataRetrievalEnum);
              //Assert.AreEqual(1, configDBRef.DataTypesMapping.Count);
              //Assert.AreEqual("System.String", configDBRef.DataTypesMapping[99]);
  
              Assert.AreEqual(PropertyResolutionStyle.DISTINCT_CASE_INSENSITIVE, common.EventMeta.ClassPropertyResolutionStyle);
              Assert.AreEqual(AccessorStyle.PUBLIC, common.EventMeta.DefaultAccessorStyle);
              Assert.AreEqual(EventUnderlyingType.MAP, common.EventMeta.DefaultEventRepresentation);
              Assert.IsFalse(common.EventMeta.AvroSettings.IsEnableAvro);
              Assert.IsFalse(common.EventMeta.AvroSettings.IsEnableNativeString);
              Assert.IsFalse(common.EventMeta.AvroSettings.IsEnableSchemaDefaultNonNull);
              Assert.AreEqual("myObjectValueTypeWidenerFactoryClass", common.EventMeta.AvroSettings.ObjectValueTypeWidenerFactoryClass);
              Assert.AreEqual("myTypeToRepresentationMapperClass", common.EventMeta.AvroSettings.TypeRepresentationMapperClass);
  
              Assert.IsTrue(common.Logging.IsEnableQueryPlan);
              Assert.IsTrue(common.Logging.IsEnableADO);
  
              Assert.AreEqual(TimeUnit.MICROSECONDS, common.TimeSource.TimeUnit);
  
              // variables
              Assert.AreEqual(3, common.Variables.Count);
              var variable = common.Variables.Get("var1");
              Assert.AreEqual(typeof(int).FullName, variable.VariableType);
              Assert.AreEqual("1", variable.InitializationValue);
              Assert.IsFalse(variable.IsConstant);
              variable = common.Variables.Get("var2");
              Assert.AreEqual(typeof(string).FullName, variable.VariableType);
              Assert.IsNull(variable.InitializationValue);
              Assert.IsFalse(variable.IsConstant);
              variable = common.Variables.Get("var3");
              Assert.IsTrue(variable.IsConstant);
  
              // method references
              Assert.AreEqual(2, common.MethodInvocationReferences.Count);
              var methodRef = common.MethodInvocationReferences.Get("abc");
              expCache = (ConfigurationCommonCacheExpiryTime) methodRef.DataCacheDesc;
              Assert.AreEqual(91.0, expCache.MaxAgeSeconds);
              Assert.AreEqual(92.2, expCache.PurgeIntervalSeconds);
              Assert.AreEqual(CacheReferenceType.WEAK, expCache.CacheReferenceType);
  
              methodRef = common.MethodInvocationReferences.Get("def");
              lruCache = (ConfigurationCommonCacheLRU) methodRef.DataCacheDesc;
              Assert.AreEqual(20, lruCache.Size);
  
              // variance types
              Assert.AreEqual(1, common.VariantStreams.Count);
              var configVStream = common.VariantStreams.Get("MyVariantStream");
              Assert.AreEqual(2, configVStream.VariantTypeNames.Count);
              Assert.IsTrue(configVStream.VariantTypeNames.Contains("MyEvenTypetNameOne"));
              Assert.IsTrue(configVStream.VariantTypeNames.Contains("MyEvenTypetNameTwo"));
              Assert.AreEqual(TypeVariance.ANY, configVStream.TypeVariance);
  
              Assert.AreEqual(ThreadingProfile.LARGE, common.Execution.ThreadingProfile);
  
              Assert.AreEqual(2, common.EventTypeAutoNameNamespaces.Count);
              Assert.AreEqual("com.mycompany.eventsone", common.EventTypeAutoNameNamespaces.ToArray()[0]);
              Assert.AreEqual("com.mycompany.eventstwo", common.EventTypeAutoNameNamespaces.ToArray()[1]);
  
              /*
               * COMPILER
               *
               */
  
              // assert custom view implementations
              var configViews = compiler.PlugInViews;
              Assert.AreEqual(2, configViews.Count);
              for (var i = 0; i < configViews.Count; i++)
              {
  
gt:                 var entry = configViews[i];