<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="Xtensive.Orm" type="Xtensive.Orm.Configuration.Elements.ConfigurationSection, Xtensive.Orm"/>
    <section name="AppConfigTest" type="Xtensive.Orm.Configuration.Elements.ConfigurationSection, Xtensive.Orm"/>
    <section name="CustomSessionConfigurationProblem" type="Xtensive.Orm.Configuration.Elements.ConfigurationSection, Xtensive.Orm"/>
    <section name="NativeTest" type="Xtensive.IoC.Configuration.ConfigurationSection, Xtensive.Orm"/>
    <section name="UnityTest" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
  </configSections>
  <Xtensive.Orm configSource="Orm.config"/>
  <AppConfigTest>
    <domains>
      <domain name="TestDomain1" connectionUrl="memory://localhost/">
        <types>
          <add assembly="Xtensive.Orm.Tests" namespace="Xtensive.Orm.Tests"/>
          <add assembly="Xtensive.Orm"/>
          <remove assembly="Xtensive.Orm"/>
        </types>
        <namingConvention letterCasePolicy="uppercase" namingRules="UnderscorEdots" namespacePolicy="hash">
          <namespaceSynonyms>
            <synonym namespace="Xtensive.Orm" synonym="XS"/>
            <synonym namespace="Xtensive.Messaging" synonym="XM" />
            <synonym namespace="Xtensive.Indexing" synonym="XI" />
          </namespaceSynonyms>
        </namingConvention>
        <sessions>
          <session name="UserSession" cacheSize="324" password="222" />
          <session name="UserSession2" cacheType="infinite" />
          <session userName="User" cacheSize="111" isolationLevel="snapshot" />
          <session name="System" userName="dfdfdfd" password="333" />
        </sessions>
      </domain>
      <domain name="TestDomain2" connectionUrl="memory://localhost/">
        <types>
          <add assembly="Xtensive.Orm.Tests" namespace="Xtensive.Orm.Tests"/>
          <add assembly="Xtensive.Orm"/>
        </types>
        <namingConvention letterCasePolicy="Uppercase" namingRules="UnderscoreDots" namespacePolicy="Hash">
          <namespaceSynonyms>
            <synonym namespace="Xtensive.Orm" synonym="XS2"/>
            <synonym namespace="Xtensive.Messaging" synonym="XM2" />
            <synonym namespace="Xtensive.Indexing" synonym="XI2" />
          </namespaceSynonyms>
        </namingConvention>
      </domain>
      <domain name="TestDomain3" connectionUrl="sqlserver://localhost/DO40-Tests" upgradeMode="Default" foreignKeyMode="All">
        <types>
          <add type="Xtensive.Orm.Tests.Configuration.UserDefinedMappings.ArrayMappings, Xtensive.Orm.Tests"/>
        </types>
      </domain>
      <domain name="TestDomain4" connectionUrl="sqlserver://localhost/DO40-Tests">
        <sessions>
          <session name="Default" batchSize="10"/>
          <session name="MyCoolSession" batchSize="100"/>
        </sessions>
      </domain>
      <domain name="DomainWithCustomSchema"
              connectionUrl="sqlserver://localhost/DO40-Tests"
              upgradeMode="Recreate"
              defaultSchema="MyFancySchema"/>
      <domain name="DomainWithCustomChangeRegistrySize"
              connectionUrl="sqlserver://localhost/DO40-Tests"
              upgradeMode="Recreate">
        <sessions>
          <session name="Default" entityChangeRegistrySize="1000"/>
        </sessions>
      </domain>
      <domain name="DomainWithWrongConnectionInfo"
              upgradeMode="Recreate"
              connectionString="Data Source=localhost;Initial Catalog=DO40-Tests;Integrated Security=True;MultipleActiveResultSets=True" />
      <domain name="DomainWithCustomCommandTimeout"
              upgradeMode="Recreate"
              connectionUrl="sqlserver://localhost/DO40-Tests">
        <sessions>
          <session name="Default" commandTimeout="100" />
        </sessions>
      </domain>
      <domain name="DomainWithCustomConnectionInfo"
              upgradeMode="Recreate"
              connectionUrl="sqlserver://localhost/DO40-Tests">
        <sessions>
          <session name="constr" connectionString="Data Source=localhost;Initial Catalog=DO40-Tests;Integrated Security=True;" />
          <session name="conurl" connectionUrl="sqlserver://localhost/DO40-Tests" />
        </sessions>
      </domain>
      <domain name="DomainWithBriefSchemaSyncExceptions"
              upgradeMode="Validate"
              connectionUrl="sqlserver://localhost/DO40-Tests"
              schemaSyncExceptionFormat="Brief">
      </domain>
      <domain name="DomainWithoutConfiguration">
        <sessions>
          <session name="Default" />
        </sessions>
      </domain>
      <domain name="DomainWithReferencedConnectionStrings" provider="sqlserver" connectionString="#DomainConnectionString">
        <sessions>
          <session name="Default" connectionString="#SessionConnectionString" />
        </sessions>
      </domain>
      <domain name="AdvancedMappingTest"
              connectionUrl="sqlserver://localhost/"
              defaultDatabase="main"
              defaultSchema="dbo"
              allowCyclicDatabaseDependencies="true">
        <mappingRules>
          <rule namespace="Xtensive.Orm.Tests.Configuration" schema="myschema" />
          <rule assembly="Xtensive.Orm.Tests" database="other" />
        </mappingRules>
        <databases>
          <database name="main" realName="DO40-Tests" />
          <database name="other" realName="Other-DO40-Tests" />
        </databases>
      </domain>
      <domain name="DomainWithInitSql" connectionUrl="sqlserver://localhost/" connectionInitializationSql="use [OtherDb]">
      </domain>
      <domain name="IgnoreRuleConfigTest" connectionUrl="sqlserver://localhost/"
              defaultDatabase="main"
              defaultSchema="dbo"
              allowCyclicDatabaseDependencies="true">
        <mappingRules>
          <rule namespace="Xtensive.Orm.Tests.Configuration" schema="myschema" />
          <rule assembly="Xtensive.Orm.Tests" database="other" />
        </mappingRules>
        <ignoreRules>
          <rule database="Other-DO40-Tests" schema="some-schema1" table="table1"/>
          <rule database="some-database" schema="some-schema2" column="column2"/>
          <rule database="some-database" schema="some-schema3" table="table2" column="col3"/>
          <rule database="another-some-database" table="some-table" />
          <rule database="database1" column ="some-column"/>
          <rule schema="schema1" table="table1"/>
          <rule schema="schema1" column="column2"/>
          <rule schema="schema1" table="table2" column="column3"/>
          <rule table="table4" column="column3"/>
          <rule table="single-table"/>
          <rule column="single-column"/>
        </ignoreRules>
        <databases>
          <database name="main" realName="DO40-Tests" />
          <database name="other" realName="Other-DO40-Tests" />
        </databases>
      </domain>
      <domain name="MultidatabaseKeysTestDomain"
              connectionUrl = "sqlserver://localhost/"
              defaultDatabase ="main"
              defaultSchema="dbo"
              multidatabaseKeys="true">
        <keyGenerators>
          <keyGenerator name="Int32" database="main" seed="128" cacheSize="128"/>
          <keyGenerator name="Int32" database="other" seed="10000000" cacheSize="128"/>
        </keyGenerators>
        <databases>
          <database name="main" realName="DO-Tests-1"/>
          <database name="other" realName="DO-Tests-2"/>
        </databases>
        <mappingRules>
          <rule namespace="Xtensive.Orm.Tests.Model.VariousKeyGeneratorsByOneKeyEqualityIdentifierTestModel1" database="main"/>
          <rule namespace="Xtensive.Orm.Tests.Model.VariousKeyGeneratorsByOneKeyEqualityIdentifierTestModel2" database="other"/>
        </mappingRules>
      </domain>
      <domain name="MultidatabaseKeysTestDomain1"
              connectionUrl = "sqlserver://localhost/"
              defaultDatabase ="main"
              defaultSchema="dbo"
              multidatabaseKeys="true">
        <databases>
          <database name="main" realName="DO-Tests-3"/>
          <database name="other" realName="DO-Tests-4"/>
        </databases>
        <mappingRules>
          <rule namespace="Xtensive.Orm.Tests.Model.VariousKeyGeneratorsByOneKeyEqualityIdentifierTestModel1" database="main"/>
          <rule namespace="Xtensive.Orm.Tests.Model.VariousKeyGeneratorsByOneKeyEqualityIdentifierTestModel2" database="other"/>
        </mappingRules>
      </domain>
      <domain name="SharedStorageSchemaNone" connectionUrl="sqlserver://localhost/" />
      <domain name="SharedStorageSchemaOn" connectionUrl="sqlserver://localhost/" shareStorageSchemaOverNodes="true"/>
      <domain name="SharedStorageSchemaOff" connectionUrl="sqlserver://localhost/" shareStorageSchemaOverNodes="false"/>
      <domain name="EnableConnectionIsAliveNone" connectionUrl="sqlserver://localhost/" />
      <domain name="EnableConnectionIsAliveTrue" connectionUrl="sqlserver://localhost/" ensureConnectionIsAlive="true"/>
      <domain name="EnableConnectionIsAliveFalse" connectionUrl="sqlserver://localhost/" ensureConnectionIsAlive="false"/>
      <domain name="ChangeTrackingTest1"
              connectionUrl="sqlserver://localhost/"
              fullTextChangeTrackingMode="Off"></domain>
      <domain name="ChangeTrackingTest2"
              connectionUrl="sqlserver://localhost/"
              fullTextChangeTrackingMode="Auto"></domain>
      <domain name="ChangeTrackingTest3"
              connectionUrl="sqlserver://localhost/"
              fullTextChangeTrackingMode="Manual"></domain>
      <domain name="ChangeTrackingTest4"
              connectionUrl="sqlserver://localhost/"
              fullTextChangeTrackingMode="OffWithNoPopulation"></domain>
      <domain name="ChangeTrackingTest5"
              connectionUrl="sqlserver://localhost/"
              fullTextChangeTrackingMode="Default"></domain>
      <domain name="VersioningConventionTest1" connectionUrl="sqlserver://localhost/"></domain>
      <domain name="VersioningConventionTest2" connectionUrl="sqlserver://localhost/">
        <versioningConvention entityVersioningPolicy="Default"/>
      </domain>
      <domain name="VersioningConventionTest3" connectionUrl="sqlserver://localhost/">
        <versioningConvention entityVersioningPolicy="Optimistic"/>
      </domain>
      <domain name="VersioningConventionTest4" connectionUrl="sqlserver://localhost/">
        <versioningConvention entityVersioningPolicy="Pessimistic"/>
      </domain>
      <domain name="VersioningConventionTest5" connectionUrl="sqlserver://localhost/">
        <versioningConvention denyEntitySetOwnerVersionChange="true"/>
      </domain>
      <domain name="VersioningConventionTest6" connectionUrl="sqlserver://localhost/">
        <versioningConvention denyEntitySetOwnerVersionChange="false"/>
      </domain>
      <domain name="EnableConnectionIsAliveNone" connectionUrl="sqlserver://localhost/" />
      <domain name="EnableConnectionIsAliveTrue" connectionUrl="sqlserver://localhost/" ensureConnectionIsAlive="true"/>
      <domain name="EnableConnectionIsAliveFalse" connectionUrl="sqlserver://localhost/" ensureConnectionIsAlive="false"/>
    </domains>
    <logging>
      <log source="*" target="Console"/>
      <log source="SomeLogName" target="DebugOnlyConsole"/>
      <log source="FirstLogName,SecondLogName" target="d:\log.txt"/>
      <log source="LogName, AnotherLogName" target ="Console"/>
      <log source="FileLog" target="log.txt"/>
      <log source="NullLog" target="None"/>
      <log source="Trash" target="skjdhfjsdf sdfsdfksjdghj fgdfg"/>
    </logging>
  </AppConfigTest>
  <UnityTest>
    <typeAliases>
      <typeAlias alias="IMyService" type="Xtensive.Orm.Tests.Storage.IoC.Model.IMyService, Xtensive.Orm.Tests"/>
      <typeAlias alias="MyServiceImpl" type="Xtensive.Orm.Tests.Storage.IoC.Model.MyServiceImpl, Xtensive.Orm.Tests"/>
      <typeAlias alias="int" type="System.Int32, mscorlib" />
      <typeAlias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
      <typeAlias alias="transient" type="Microsoft.Practices.Unity.TransientLifetimeManager, Microsoft.Practices.Unity" />
    </typeAliases>
    <containers>
      <container name="domain">
        <types>
          <type name="singleton" type="IMyService" mapTo="MyServiceImpl">
            <lifetime type="singleton" />
          </type>
          <type name="transient" type="IMyService" mapTo="MyServiceImpl">
            <lifetime type="transient" />
          </type>
        </types>
      </container>
      <container name="session">
        <types>
          <type type="IMyService" mapTo="MyServiceImpl">
            <lifetime type="singleton" />
          </type>
        </types>
      </container>
    </containers>
  </UnityTest>
  <NativeTest>
    <containers>
      <container name="domain">
        <explicit>
          <add name="singleton" type="Xtensive.Orm.Tests.Storage.IoC.Model.IMyService, Xtensive.Orm.Tests" mapTo="Xtensive.Orm.Tests.Storage.IoC.Model.MyServiceImpl, Xtensive.Orm.Tests" singleton="true"/>
          <add name="transient" type="Xtensive.Orm.Tests.Storage.IoC.Model.IMyService, Xtensive.Orm.Tests" mapTo="Xtensive.Orm.Tests.Storage.IoC.Model.MyServiceImpl, Xtensive.Orm.Tests"/>
        </explicit>
      </container>
      <container name="session">
        <explicit>
          <add type="Xtensive.Orm.Tests.Storage.IoC.Model.IMyService, Xtensive.Orm.Tests" mapTo="Xtensive.Orm.Tests.Storage.IoC.Model.MyServiceImpl, Xtensive.Orm.Tests" singleton="true"/>
        </explicit>
      </container>
    </containers>
  </NativeTest>
  <CustomSessionConfigurationProblem>
    <domains>
      <domain name="mssql2005" connectionUrl="sqlserver://localhost/DO40-Tests" upgradeMode="Recreate">
        <sessions>
          <session cacheSize="324"/>
        </sessions>
      </domain>
    </domains>
  </CustomSessionConfigurationProblem>
  <connectionStrings>
    <add name="Entities" connectionString="metadata=res://*/Storage.Performance.EntityCrudModel.Model.csdl|res://*/Storage.Performance.EntityCrudModel.Model.ssdl|res://*/Storage.Performance.EntityCrudModel.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=DO40-Tests;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="NorthwindEntities" connectionString="metadata=res://*/ObjectModel.NothwindEF.csdl|res://*/ObjectModel.NothwindEF.ssdl|res://*/ObjectModel.NothwindEF.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.;Initial Catalog=Northwind;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="DomainConnectionString" connectionString="Data Source=localhost;Initial Catalog=DO-Tests;Integrated Security=True;MultipleActiveResultSets=False" />
    <add name="SessionConnectionString" connectionString="Data Source=localhost;Initial Catalog=DO-Tests;Integrated Security=True;MultipleActiveResultSets=True" />
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>
