Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ _ReSharper*
*ReSharper.*
*.suo
*.cache
* Thumbs.db
* Thumbs.db
*.user
**/packages/**
30 changes: 22 additions & 8 deletions src/Castle.ActiveRecord.Framework.Internal.Tests/App.config
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>

<configuration>

<configSections>
<section name="activerecord"
type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" />
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>

<activerecord>

<config>
<add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<add key="dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
<add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="connection.connection_string" value="Initial Catalog=test;Data Source=.;Integrated Security=True;" />
<add key="dialect" value="NHibernate.Dialect.MsSql2012Dialect" />
<add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="connection.connection_string" value="Initial Catalog=Test;Data Source=.;Integrated Security=True;" />
<add key="proxyfactory.factory_class" value="Castle.ActiveRecord.ByteCode.ProxyFactoryFactory, Castle.ActiveRecord" />
<add key="query.factory_class" value="NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory, NHibernate" />
<!--add key="connection.connection_string" value="Data Source=.;Initial Catalog=ActiverRecordTest;Integrated Security=True;Pooling=False" /-->
Expand Down Expand Up @@ -46,4 +44,20 @@
-->
</log4net>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>

<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />

<bindingRedirect oldVersion="0.0.0.0-3.1.0.4000" newVersion="3.1.0.4000" />

</dependentAssembly>

</assemblyBinding>

</runtime>

</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,9 @@ public void CanGetCustomValueFromRawXmlDerivedAttribute()
public void WillUseRegisteredAssembliesToLookForRawMappingXmlEvenIfThereAreNoActiveRecordTypesInThatAssembly()
{
ActiveRecordStarter.ResetInitializationFlag();
ActiveRecordStarter.Initialize(
typeof(RegisterNHibernateClassMapping).Assembly,
GetConfigSource()
);
ISessionFactory factory = ActiveRecordMediator.GetSessionFactoryHolder()
.GetSessionFactory(typeof(ActiveRecordBase));
IClassMetadata metadata = factory
.GetClassMetadata(typeof(NHibernateClass));
ActiveRecordStarter.Initialize(typeof(RegisterNHibernateClassMapping).Assembly, GetConfigSource());
ISessionFactory factory = ActiveRecordMediator.GetSessionFactoryHolder().GetSessionFactory(typeof(ActiveRecordBase));
IClassMetadata metadata = factory.GetClassMetadata(typeof(NHibernateClass));
Assert.IsNotNull(metadata);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<Configuration Condition=" '$(Configuration)' == '' ">NET40-Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<NuGetPackageImportStamp>2b20b678</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup>
<ProjectType>Local</ProjectType>
Expand Down Expand Up @@ -100,17 +101,17 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\$(BuildConfigKey)\Castle.Components.Validator.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\$(BuildConfigKey)\Castle.Core.dll</HintPath>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\..\packages\Castle.Core.3.3.3\lib\net40-client\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Iesi.Collections.dll</HintPath>
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NHibernate, Version=2.1.0.2002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NHibernate.dll</HintPath>
<Reference Include="NHibernate, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework">
<Name>nunit.framework</Name>
Expand All @@ -126,6 +127,10 @@
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Data.SQLite, Version=1.0.96.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.96.0\lib\net40\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml">
<Name>System.XML</Name>
Expand Down Expand Up @@ -247,6 +252,7 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
Expand Down Expand Up @@ -291,4 +297,11 @@
<PostBuildEvent>xcopy "$(ProjectDir)App.config" "$(TargetDir)" /y/c
move /y "$(TargetDir)App.config" "$(TargetDir)$(TargetFileName).config"</PostBuildEvent>
</PropertyGroup>
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Castle.ActiveRecord.Framework.Internal.Tests.Model
/// <summary>
/// Warning: This is a wrong definition!
/// </summary>
[ActiveRecord(DiscriminatorColumn="column", DiscriminatorValue="1"), JoinedBase]
[ActiveRecord(DiscriminatorColumn = "column", DiscriminatorValue = "1"), JoinedBase]
public class Company : ActiveRecordBase
{
public Company()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net40-Client" />
<package id="Iesi.Collections" version="4.0.0.4000" targetFramework="net40-Client" />
<package id="NHibernate" version="4.0.3.4000" targetFramework="net40-Client" />
<package id="System.Data.SQLite.Core" version="1.0.96.0" targetFramework="net40-Client" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<RootPath Condition=" '$(RootPath)' == '' ">$(MSBuildProjectDirectory)\..\..</RootPath>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<Configuration Condition=" '$(Configuration)' == '' ">NET40-Debug</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">NET40-Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<NuGetPackageImportStamp>c355086d</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup>
<ProductVersion>9.0.30729</ProductVersion>
Expand All @@ -21,11 +22,10 @@
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'NET40-Debug|AnyCPU' ">
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</TargetFrameworkProfile>
<OutputPath>bin\NET40-Debug\</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand All @@ -42,7 +42,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'NET40-Release|AnyCPU' ">
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</TargetFrameworkProfile>
<OutputPath>bin\NET40-Release\</OutputPath>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
Expand Down Expand Up @@ -81,20 +81,27 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>

<ItemGroup>
<Reference Include="Castle.Components.Validator, Version=1.1.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\$(BuildConfigKey)\Castle.Components.Validator.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=2.1.0.2002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NHibernate.dll</HintPath>
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NHibernate, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.SQLite, Version=1.0.96.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.96.0\lib\net40\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
Expand Down Expand Up @@ -140,9 +147,20 @@
<Name>Castle.ActiveRecord-vs2010</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(RootPath)\Settings.proj" />
<Import Project="$(BuildScriptsPath)\Castle.Common.targets" />
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\System.Data.SQLite.Core.1.0.96.0\build\net40\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
6 changes: 6 additions & 0 deletions src/Castle.ActiveRecord.Tests.Model/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>

</runtime>
</configuration>
6 changes: 6 additions & 0 deletions src/Castle.ActiveRecord.Tests.Model/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Iesi.Collections" version="4.0.0.4000" targetFramework="net40" />
<package id="NHibernate" version="4.0.3.4000" targetFramework="net40" />
<package id="System.Data.SQLite.Core" version="1.0.96.0" targetFramework="net40" />
</packages>
32 changes: 16 additions & 16 deletions src/Castle.ActiveRecord.Tests/ActiveRecordLinqTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public void SimpleOperations()
Assert.AreEqual(0, blogs.Count());

var blog = new Blog
{
Name = "hammett's blog",
Author = "hamilton verissimo"
};
{
Name = "hammett's blog",
Author = "hamilton verissimo"
};
blog.Save();

blogs = from b in Blog.Queryable select b;
Expand Down Expand Up @@ -88,10 +88,10 @@ public void SimpleOperationsShowingBug()
Assert.AreEqual(0, blogs.Count());

var blog = new Blog
{
Name = "hammett's blog",
Author = "hamilton verissimo"
};
{
Name = "hammett's blog",
Author = "hamilton verissimo"
};
blog.Save();

blogs = from b in Blog.Queryable select b;
Expand Down Expand Up @@ -214,7 +214,7 @@ public void UsingLinqFromNonLinqBaseClass()
Assert.IsNotNull(widget);
Assert.AreEqual("Hello world", widget.Name);

var widget2 = ActiveRecordLinq.AsQueryable<Widget>().First(w => w.Name == "Hello World");
var widget2 = ActiveRecordLinq.AsQueryable<Widget>().First(w => w.Name == "Hello world");
Assert.IsNotNull(widget2);
Assert.AreEqual("Hello world", widget2.Name);

Expand All @@ -240,7 +240,7 @@ public void UsingLinqViaSessionScopeVariable()
Widget widget = new Widget { Name = "Hello world" };
widget.Save();

widgets = from w in scope.AsQueryable<Widget>() where w.Name == "Hello World" select w;
widgets = from w in scope.AsQueryable<Widget>() where w.Name == "Hello world" select w;
Assert.IsNotNull(widgets);
Assert.AreEqual(1, widgets.Count());
}
Expand Down Expand Up @@ -268,13 +268,13 @@ public void Projecting()
Recreate();
Widget.DeleteAll();

var widget = new Widget {Name = "foo"};
var widget = new Widget { Name = "foo" };
widget.Save();

var orderedQueryable = ActiveRecordLinqBase<Widget>.Queryable;
var widgets = (from w in orderedQueryable
where w.Name.StartsWith("f")
select w.Name).ToList();
where w.Name.StartsWith("f")
select w.Name).ToList();

Assert.IsNotNull(widgets);
Assert.AreEqual("foo", widgets.Single());
Expand All @@ -290,13 +290,13 @@ public void Projecting2()
Recreate();
Widget.DeleteAll();

var widget = new Widget {Name = "foo"};
var widget = new Widget { Name = "foo" };
widget.Save();

var orderedQueryable = ActiveRecordLinqBase<Widget>.Queryable;
var name = (from w in orderedQueryable
where w.Name.StartsWith("f")
select w.Name).First();
where w.Name.StartsWith("f")
select w.Name).First();

Assert.IsNotNull(name);
Assert.AreEqual("foo", name);
Expand Down
Loading