U4-10006 - adjust projects to new build
This commit is contained in:
+5
-11
@@ -46,13 +46,7 @@ src/Umbraco.Web.UI/Web.*.config.transformed
|
||||
|
||||
umbraco/presentation/umbraco/plugins/uComponents/uComponentsInstaller.ascx
|
||||
umbraco/presentation/packages/uComponents/MultiNodePicker/CustomTreeService.asmx
|
||||
_BuildOutput/*
|
||||
*.ncrunchsolution
|
||||
build/UmbracoCms.AllBinaries*zip
|
||||
build/UmbracoCms.WebPI*zip
|
||||
build/UmbracoCms*zip
|
||||
build/UmbracoExamine.PDF*zip
|
||||
build/*.nupkg
|
||||
src/Umbraco.Tests/config/applications.config
|
||||
src/Umbraco.Tests/config/trees.config
|
||||
src/Umbraco.Web.UI/web.config
|
||||
@@ -68,7 +62,6 @@ src/packages/repositories.config
|
||||
|
||||
src/Umbraco.Web.UI/[Ww]eb.config
|
||||
*.transformed
|
||||
webpihash.txt
|
||||
|
||||
node_modules
|
||||
|
||||
@@ -95,7 +88,6 @@ src/Umbraco.Web.UI/[Uu]mbraco/[Aa]ssets/*
|
||||
src/Umbraco.Web.UI.Client/[Bb]uild/*
|
||||
src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
|
||||
src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/
|
||||
build/_BuildOutput/
|
||||
src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
|
||||
tools/NDepend/
|
||||
|
||||
@@ -130,7 +122,6 @@ src/*.boltdata/
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.config.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.front.js
|
||||
src/umbraco.sln.ide/*
|
||||
build/UmbracoCms.*/
|
||||
src/.vs/
|
||||
src/Umbraco.Web.UI/umbraco/js/install.loader.js
|
||||
src/Umbraco.Tests/media
|
||||
@@ -140,8 +131,11 @@ apidocs/api/*
|
||||
build/docs.zip
|
||||
build/ui-docs.zip
|
||||
build/csharp-docs.zip
|
||||
build/msbuild.log
|
||||
.vs/
|
||||
src/packages/
|
||||
build/tools/
|
||||
src/PrecompiledWeb/*
|
||||
|
||||
|
||||
build.out/
|
||||
build.tmp/
|
||||
build/Modules/*/temp/
|
||||
@@ -44,65 +44,65 @@
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\_BuildOutput\WebApp\bin\businesslogic.dll" target="lib\net45\businesslogic.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\businesslogic.xml" target="lib\net45\businesslogic.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\cms.dll" target="lib\net45\cms.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\cms.xml" target="lib\net45\cms.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\controls.dll" target="lib\net45\controls.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\controls.xml" target="lib\net45\controls.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\interfaces.dll" target="lib\net45\interfaces.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\interfaces.xml" target="lib\net45\interfaces.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\net45\log4net.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\net45\Microsoft.ApplicationBlocks.Data.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.dll" target="lib\net45\SQLCE4Umbraco.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.xml" target="lib\net45\SQLCE4Umbraco.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.dll" target="lib\net45\System.Data.SqlServerCe.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.Entity.dll" target="lib\net45\System.Data.SqlServerCe.Entity.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\TidyNet.dll" target="lib\net45\TidyNet.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.dll" target="lib\net45\Umbraco.Core.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.xml" target="lib\net45\Umbraco.Core.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.dll" target="lib\net45\umbraco.DataLayer.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.xml" target="lib\net45\umbraco.DataLayer.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.dll" target="lib\net45\umbraco.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.xml" target="lib\net45\umbraco.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.dll" target="lib\net45\umbraco.editorControls.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.xml" target="lib\net45\umbraco.editorControls.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.dll" target="lib\net45\umbraco.MacroEngines.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.xml" target="lib\net45\umbraco.MacroEngines.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\net45\umbraco.providers.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.xml" target="lib\net45\umbraco.providers.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.dll" target="lib\net45\Umbraco.Web.UI.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.xml" target="lib\net45\Umbraco.Web.UI.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\net45\UmbracoExamine.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.xml" target="lib\net45\UmbracoExamine.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\businesslogic.dll" target="lib\net45\businesslogic.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\businesslogic.xml" target="lib\net45\businesslogic.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\cms.dll" target="lib\net45\cms.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\cms.xml" target="lib\net45\cms.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\controls.dll" target="lib\net45\controls.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\controls.xml" target="lib\net45\controls.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\interfaces.dll" target="lib\net45\interfaces.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\interfaces.xml" target="lib\net45\interfaces.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\log4net.dll" target="lib\net45\log4net.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\net45\Microsoft.ApplicationBlocks.Data.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\SQLCE4Umbraco.dll" target="lib\net45\SQLCE4Umbraco.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\SQLCE4Umbraco.xml" target="lib\net45\SQLCE4Umbraco.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\System.Data.SqlServerCe.dll" target="lib\net45\System.Data.SqlServerCe.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\System.Data.SqlServerCe.Entity.dll" target="lib\net45\System.Data.SqlServerCe.Entity.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\TidyNet.dll" target="lib\net45\TidyNet.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Core.dll" target="lib\net45\Umbraco.Core.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Core.xml" target="lib\net45\Umbraco.Core.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.DataLayer.dll" target="lib\net45\umbraco.DataLayer.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.DataLayer.xml" target="lib\net45\umbraco.DataLayer.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.dll" target="lib\net45\umbraco.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.xml" target="lib\net45\umbraco.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.editorControls.dll" target="lib\net45\umbraco.editorControls.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.editorControls.xml" target="lib\net45\umbraco.editorControls.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.MacroEngines.dll" target="lib\net45\umbraco.MacroEngines.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.MacroEngines.xml" target="lib\net45\umbraco.MacroEngines.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.providers.dll" target="lib\net45\umbraco.providers.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\umbraco.providers.xml" target="lib\net45\umbraco.providers.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.UI.dll" target="lib\net45\Umbraco.Web.UI.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.UI.xml" target="lib\net45\Umbraco.Web.UI.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\UmbracoExamine.dll" target="lib\net45\UmbracoExamine.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\UmbracoExamine.xml" target="lib\net45\UmbracoExamine.xml" />
|
||||
<file src="tools\install.core.ps1" target="tools\install.ps1" />
|
||||
|
||||
<!-- Added to be able to produce a symbols package -->
|
||||
<file src="..\_BuildOutput\bin\SQLCE4Umbraco.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\SQLCE4Umbraco.pdb" target="lib" />
|
||||
<file src="..\..\src\SQLCE4Umbraco\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\SQLCE4Umbraco" />
|
||||
<file src="..\_BuildOutput\bin\businesslogic.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\businesslogic.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.businesslogic\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.businesslogic" />
|
||||
<file src="..\_BuildOutput\bin\cms.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\cms.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.cms\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.cms" />
|
||||
<file src="..\_BuildOutput\bin\controls.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\controls.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.controls\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.controls" />
|
||||
<file src="..\_BuildOutput\bin\interfaces.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\interfaces.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.interfaces\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.interfaces" />
|
||||
<file src="..\_BuildOutput\bin\Umbraco.Core.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\Umbraco.Core.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Core\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Core" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.DataLayer.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\umbraco.DataLayer.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.datalayer\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.datalayer" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.editorControls.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\umbraco.editorControls.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.editorControls\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.editorControls" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.MacroEngines.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\umbraco.MacroEngines.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.MacroEngines\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.MacroEngines" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.providers.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\umbraco.providers.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.providers\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.providers" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\umbraco.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Web" />
|
||||
<file src="..\_BuildOutput\bin\Umbraco.Web.UI.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\Umbraco.Web.UI.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web.UI\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Web.UI" />
|
||||
<file src="..\_BuildOutput\bin\UmbracoExamine.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\bin\UmbracoExamine.pdb" target="lib" />
|
||||
<file src="..\..\src\UmbracoExamine\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\UmbracoExamine" />
|
||||
</files>
|
||||
</package>
|
||||
|
||||
@@ -19,22 +19,22 @@
|
||||
<dependency id="Newtonsoft.Json" version="[10.0.2, 11.0.0)" />
|
||||
<dependency id="Umbraco.ModelsBuilder" version="[3.0.7, 4.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.2.1, 3.0.0)" />
|
||||
<dependency id="ImageProcessor.Web.Config" version="[2.3.0, 3.0.0)" />
|
||||
<dependency id="ImageProcessor.Web.Config" version="[2.3.0, 3.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\_BuildOutput\Configs\**" target="Content\Config" exclude="..\_BuildOutput\Configs\Web.config.transform" />
|
||||
<file src="..\_BuildOutput\WebApp\Views\**" target="Content\Views" exclude="..\_BuildOutput\WebApp\Views\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\default.aspx" target="Content\default.aspx" />
|
||||
<file src="..\_BuildOutput\WebApp\Global.asax" target="Content\Global.asax" />
|
||||
<file src="..\_BuildOutput\WebApp\Web.config" target="UmbracoFiles\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\amd64\**" target="UmbracoFiles\bin\amd64" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\x86\**" target="UmbracoFiles\bin\x86" />
|
||||
<file src="..\_BuildOutput\WebApp\config\splashes\**" target="UmbracoFiles\Config\splashes" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
|
||||
<file src="..\_BuildOutput\WebApp\Media\Web.config" target="Content\Media\Web.config" />
|
||||
<file src="$BuildTmp$\Configs\**" target="Content\Config" exclude="$BuildTmp$\Configs\Web.config.transform" />
|
||||
<file src="$BuildTmp$\WebApp\Views\**" target="Content\Views" exclude="$BuildTmp$\WebApp\Views\Web.config" />
|
||||
<file src="$BuildTmp$\WebApp\default.aspx" target="Content\default.aspx" />
|
||||
<file src="$BuildTmp$\WebApp\Global.asax" target="Content\Global.asax" />
|
||||
<file src="$BuildTmp$\WebApp\Web.config" target="UmbracoFiles\Web.config" />
|
||||
<file src="$BuildTmp$\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
|
||||
<file src="$BuildTmp$\WebApp\bin\amd64\**" target="UmbracoFiles\bin\amd64" />
|
||||
<file src="$BuildTmp$\WebApp\bin\x86\**" target="UmbracoFiles\bin\x86" />
|
||||
<file src="$BuildTmp$\WebApp\config\splashes\**" target="UmbracoFiles\Config\splashes" />
|
||||
<file src="$BuildTmp$\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
|
||||
<file src="$BuildTmp$\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
|
||||
<file src="$BuildTmp$\WebApp\Media\Web.config" target="Content\Media\Web.config" />
|
||||
<file src="tools\install.ps1" target="tools\install.ps1" />
|
||||
<file src="tools\Readme.txt" target="tools\Readme.txt" />
|
||||
<file src="tools\ReadmeUpgrade.txt" target="tools\ReadmeUpgrade.txt" />
|
||||
|
||||
@@ -93,7 +93,6 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- 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">
|
||||
|
||||
@@ -50,6 +50,33 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
|
||||
public bool EnsureUniqueNaming { get; set; }
|
||||
|
||||
public IContent Get(Guid id)
|
||||
{
|
||||
// cannot use cache policy because, <int, IContent>, so what?
|
||||
|
||||
var sql = GetBaseQuery(BaseQueryType.FullSingle)
|
||||
.Where("umbracoNode.uniqueId = @id", new { id })
|
||||
.Where<DocumentDto>(x => x.Newest, SqlSyntax)
|
||||
.OrderByDescending<ContentVersionDto>(x => x.VersionDate, SqlSyntax);
|
||||
|
||||
var dto = Database.Fetch<DocumentDto, ContentVersionDto, ContentDto, NodeDto, DocumentPublishedReadOnlyDto>(SqlSyntax.SelectTop(sql, 1)).FirstOrDefault();
|
||||
|
||||
if (dto == null)
|
||||
return null;
|
||||
|
||||
var content = CreateContentFromDto(dto, sql);
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
public IContent Get2(Guid id)
|
||||
{
|
||||
// cannot use cache policy because, <int, IContent>, so what?
|
||||
|
||||
var a = ApplicationContext.Current.Services.EntityService.GetIdForKey(id, UmbracoObjectTypes.Document);
|
||||
return a.Success ? Get(a.Result) : null;
|
||||
}
|
||||
|
||||
#region Overrides of RepositoryBase<IContent>
|
||||
|
||||
protected override IContent PerformGet(int id)
|
||||
|
||||
@@ -1575,7 +1575,6 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
||||
<!-- 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.
|
||||
|
||||
@@ -12,6 +12,17 @@ namespace Umbraco.Tests.Dependencies
|
||||
[TestFixture]
|
||||
public class NuGet
|
||||
{
|
||||
// note
|
||||
// these tests assume that the test suite runs from the project's ~/bin directory
|
||||
// instead, we want to be able to pass the required paths as parameters
|
||||
// NUnit 3.x supports TestContext.TestParameters, alas we are still running 2.x
|
||||
//
|
||||
// so instead
|
||||
//
|
||||
// furthermore, all these tests should be parts of the build and fail the build
|
||||
// in case the NuGet things are not consisted. Also, v8 uses <PackageReference>
|
||||
// wherever possible so we will also have to deal with it eventually.
|
||||
|
||||
[Test]
|
||||
public void NuGet_Package_Versions_Are_The_Same_In_All_Package_Config_Files()
|
||||
{
|
||||
@@ -40,21 +51,20 @@ namespace Umbraco.Tests.Dependencies
|
||||
[Test]
|
||||
public void NuSpec_File_Matches_Installed_Dependencies()
|
||||
{
|
||||
var solutionDirectory = GetSolutionDirectory();
|
||||
Assert.NotNull(solutionDirectory);
|
||||
Assert.NotNull(solutionDirectory.Parent);
|
||||
|
||||
var nuSpecPath = solutionDirectory.Parent.FullName + "\\build\\NuSpecs\\";
|
||||
Assert.IsTrue(Directory.Exists(nuSpecPath));
|
||||
var nuspecsDirectory = NuSpecsDirectory;
|
||||
Assert.IsNotNull(nuspecsDirectory);
|
||||
|
||||
var packagesAndVersions = GetNuGetPackagesInSolution();
|
||||
var failTest = false;
|
||||
Assert.IsTrue(packagesAndVersions.Any());
|
||||
|
||||
var nuSpecFiles = Directory.GetFiles(nuSpecPath);
|
||||
foreach (var fileName in nuSpecFiles.Where(x => x.EndsWith("nuspec")))
|
||||
Console.WriteLine("NuSpecs: " + nuspecsDirectory.FullName);
|
||||
|
||||
var failTest = false;
|
||||
var nuspecFiles = nuspecsDirectory.GetFiles().Where(x => x.Extension == ".nuspec").Select(x => x.FullName);
|
||||
foreach (var filename in nuspecFiles)
|
||||
{
|
||||
var serializer = new XmlSerializer(typeof(NuSpec));
|
||||
using (var reader = new StreamReader(fileName))
|
||||
using (var reader = new StreamReader(filename))
|
||||
{
|
||||
var nuspec = (NuSpec)serializer.Deserialize(reader);
|
||||
var dependencies = nuspec.MetaData.dependencies;
|
||||
@@ -64,13 +74,13 @@ namespace Umbraco.Tests.Dependencies
|
||||
{
|
||||
var dependencyVersionRange = dependency.Version.Replace("[", string.Empty).Replace("(", string.Empty).Split(',');
|
||||
var dependencyMinimumVersion = dependencyVersionRange.First().Trim();
|
||||
|
||||
|
||||
var matchingPackages = packagesAndVersions.Where(x => string.Equals(x.PackageName, dependency.Id,
|
||||
StringComparison.InvariantCultureIgnoreCase)).ToList();
|
||||
if (matchingPackages.Any() == false)
|
||||
continue;
|
||||
|
||||
// NuGet_Package_Versions_Are_The_Same_In_All_Package_Config_Files test
|
||||
// NuGet_Package_Versions_Are_The_Same_In_All_Package_Config_Files test
|
||||
// guarantees that all packages have one version, solutionwide, so it's okay to take First() here
|
||||
if (dependencyMinimumVersion != matchingPackages.First().PackageVersion)
|
||||
{
|
||||
@@ -88,13 +98,12 @@ namespace Umbraco.Tests.Dependencies
|
||||
private List<PackageVersionMatcher> GetNuGetPackagesInSolution()
|
||||
{
|
||||
var packagesAndVersions = new List<PackageVersionMatcher>();
|
||||
var solutionDirectory = GetSolutionDirectory();
|
||||
if (solutionDirectory == null)
|
||||
return packagesAndVersions;
|
||||
var sourceDirectory = SourceDirectory;
|
||||
if (sourceDirectory == null) return packagesAndVersions;
|
||||
|
||||
var packageConfigFiles = new List<FileInfo>();
|
||||
var packageDirectories =
|
||||
solutionDirectory.GetDirectories().Where(x =>
|
||||
sourceDirectory.GetDirectories().Where(x =>
|
||||
x.Name.StartsWith("Umbraco.Tests") == false &&
|
||||
x.Name.StartsWith("Umbraco.MSBuild.Tasks") == false).ToArray();
|
||||
|
||||
@@ -123,15 +132,53 @@ namespace Umbraco.Tests.Dependencies
|
||||
return packagesAndVersions;
|
||||
}
|
||||
|
||||
private DirectoryInfo GetSolutionDirectory()
|
||||
private DirectoryInfo SourceDirectory
|
||||
{
|
||||
var testsDirectory = new FileInfo(TestHelper.MapPathForTest("~/"));
|
||||
if (testsDirectory.Directory == null)
|
||||
return null;
|
||||
if (testsDirectory.Directory.Parent == null || testsDirectory.Directory.Parent.Parent == null)
|
||||
return null;
|
||||
var solutionDirectory = testsDirectory.Directory.Parent.Parent.Parent;
|
||||
return solutionDirectory;
|
||||
get
|
||||
{
|
||||
// UMBRACO_TMP is set by VSTS and points to build.tmp
|
||||
var tmp = Environment.GetEnvironmentVariable("UMBRACO_TMP");
|
||||
if (tmp == null) return SolutionDirectory;
|
||||
|
||||
var path = Path.Combine(tmp, "..\\src");
|
||||
path = Path.GetFullPath(path); // sanitize
|
||||
var dir = new DirectoryInfo(path);
|
||||
return dir.Exists ? dir : null;
|
||||
}
|
||||
}
|
||||
|
||||
private DirectoryInfo NuSpecsDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
// UMBRACO_TMP is set by VSTS and points to build.tmp
|
||||
var tmp = Environment.GetEnvironmentVariable("UMBRACO_TMP");
|
||||
if (tmp == null)
|
||||
{
|
||||
var solutionDirectory = SolutionDirectory;
|
||||
if (solutionDirectory == null) return null;
|
||||
return new DirectoryInfo(Path.Combine(solutionDirectory.FullName, "..\\build\\NuSpecs"));
|
||||
}
|
||||
|
||||
var path = Path.Combine(tmp, "..\\build\\NuSpecs");
|
||||
path = Path.GetFullPath(path); // sanitize
|
||||
var dir = new DirectoryInfo(path);
|
||||
return dir.Exists ? dir : null;
|
||||
}
|
||||
}
|
||||
|
||||
private DirectoryInfo SolutionDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
var testsDirectory = new FileInfo(TestHelper.MapPathForTest("~/"));
|
||||
if (testsDirectory.Directory == null)
|
||||
return null;
|
||||
if (testsDirectory.Directory.Parent == null || testsDirectory.Directory.Parent.Parent == null)
|
||||
return null;
|
||||
var solutionDirectory = testsDirectory.Directory.Parent.Parent.Parent;
|
||||
return solutionDirectory;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +206,7 @@ namespace Umbraco.Tests.Dependencies
|
||||
[XmlAttribute(AttributeName = "version")]
|
||||
public string Version { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
[XmlType(AnonymousType = true, Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")]
|
||||
[XmlRoot(Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", IsNullable = false, ElementName = "package")]
|
||||
@@ -168,7 +215,7 @@ namespace Umbraco.Tests.Dependencies
|
||||
[XmlElement("metadata")]
|
||||
public Metadata MetaData { get; set; }
|
||||
}
|
||||
|
||||
|
||||
[XmlType(AnonymousType = true, Namespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd", TypeName = "metadata")]
|
||||
public class Metadata
|
||||
{
|
||||
@@ -182,9 +229,8 @@ namespace Umbraco.Tests.Dependencies
|
||||
{
|
||||
[XmlAttribute(AttributeName = "id")]
|
||||
public string Id { get; set; }
|
||||
|
||||
|
||||
[XmlAttribute(AttributeName = "version")]
|
||||
public string Version { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,27 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
using Umbraco.Core.Persistence.Mappers;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Tests.TestHelpers.Entities;
|
||||
using umbraco.editorControls.tinyMCE3;
|
||||
using umbraco.interfaces;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
|
||||
namespace Umbraco.Tests.Persistence.Repositories
|
||||
@@ -71,6 +66,83 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
return repository;
|
||||
}
|
||||
|
||||
protected override CacheHelper CreateCacheHelper()
|
||||
{
|
||||
return new CacheHelper(
|
||||
new ObjectCacheRuntimeCacheProvider(),
|
||||
new StaticCacheProvider(),
|
||||
new NullCacheProvider(),
|
||||
new IsolatedRuntimeCache(type => new ObjectCacheRuntimeCacheProvider()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bench()
|
||||
{
|
||||
var provider = new PetaPocoUnitOfWorkProvider(Logger);
|
||||
var unitOfWork = provider.GetUnitOfWork();
|
||||
ContentTypeRepository contentTypeRepository;
|
||||
IContent content1;
|
||||
|
||||
var versions = new List<Guid>();
|
||||
using (var repository = CreateRepository(unitOfWork, out contentTypeRepository))
|
||||
{
|
||||
var hasPropertiesContentType = MockedContentTypes.CreateSimpleContentType("umbTextpage1", "Textpage");
|
||||
content1 = MockedContent.CreateSimpleContent(hasPropertiesContentType);
|
||||
|
||||
//save version
|
||||
contentTypeRepository.AddOrUpdate(hasPropertiesContentType);
|
||||
repository.AddOrUpdate(content1);
|
||||
unitOfWork.Commit();
|
||||
versions.Add(content1.Version);
|
||||
|
||||
//publish version
|
||||
content1.ChangePublishedState(PublishedState.Published);
|
||||
repository.AddOrUpdate(content1);
|
||||
unitOfWork.Commit();
|
||||
versions.Add(content1.Version);
|
||||
|
||||
//change something and make a pending version
|
||||
content1.Name = "new name";
|
||||
content1.ChangePublishedState(PublishedState.Saved);
|
||||
repository.AddOrUpdate(content1);
|
||||
unitOfWork.Commit();
|
||||
versions.Add(content1.Version);
|
||||
|
||||
|
||||
var unused1 = repository.Get(content1.Id);
|
||||
|
||||
var sw = Stopwatch.StartNew();
|
||||
for (var i = 0; i < 1000; i++)
|
||||
{
|
||||
var unused = repository.Get(content1.Id);
|
||||
}
|
||||
sw.Stop();
|
||||
Console.WriteLine(sw.Elapsed);
|
||||
sw.Restart();
|
||||
for (var i = 0; i < 1000; i++)
|
||||
{
|
||||
var unused = repository.Get(content1.Key);
|
||||
}
|
||||
sw.Stop();
|
||||
Console.WriteLine(sw.Elapsed);
|
||||
sw.Restart();
|
||||
for (var i = 0; i < 1000; i++)
|
||||
{
|
||||
var unused = repository.Get2(content1.Key);
|
||||
}
|
||||
sw.Stop();
|
||||
Console.WriteLine(sw.Elapsed);
|
||||
sw.Restart();
|
||||
for (var i = 0; i < 1000; i++)
|
||||
{
|
||||
var query = Query<IContent>.Builder.Where(x => x.Key == content1.Key);
|
||||
var unused = repository.GetByQuery(query).SingleOrDefault();
|
||||
}
|
||||
sw.Stop();
|
||||
Console.WriteLine(sw.Elapsed);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Get_Always_Returns_Latest_Version()
|
||||
{
|
||||
@@ -138,10 +210,10 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
{
|
||||
var hasPropertiesContentType = MockedContentTypes.CreateSimpleContentType("umbTextpage1", "Textpage");
|
||||
content1 = MockedContent.CreateSimpleContent(hasPropertiesContentType);
|
||||
|
||||
|
||||
contentTypeRepository.AddOrUpdate(hasPropertiesContentType);
|
||||
repository.AddOrUpdate(content1);
|
||||
unitOfWork.Commit();
|
||||
repository.AddOrUpdate(content1);
|
||||
unitOfWork.Commit();
|
||||
}
|
||||
|
||||
var versionDtos = new List<ContentVersionDto>();
|
||||
@@ -237,7 +309,7 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
// Assert
|
||||
using (var repository = CreateRepository(unitOfWork, out contentTypeRepository))
|
||||
{
|
||||
//this will cause the GetPropertyCollection to execute and we need to ensure that
|
||||
//this will cause the GetPropertyCollection to execute and we need to ensure that
|
||||
// all of the properties and property types are all correct
|
||||
var result = repository.GetAll(allContent.Select(x => x.Id).ToArray()).ToArray();
|
||||
|
||||
@@ -246,7 +318,7 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
foreach (var contentProperty in content.Properties)
|
||||
{
|
||||
//prior to the fix, the 2nd document iteration in the GetPropertyCollection would have caused
|
||||
//the enumerator to move forward past the first property of the 3rd document which would have
|
||||
//the enumerator to move forward past the first property of the 3rd document which would have
|
||||
//ended up not assiging a property to the 3rd document. This would have ended up with the 3rd
|
||||
//document still having 3 properties but the last one would not have been assigned an identity
|
||||
//because the property data would not have been assigned.
|
||||
|
||||
@@ -6,12 +6,25 @@ using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Scoping;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Tests.TestHelpers.Entities;
|
||||
|
||||
namespace Umbraco.Tests.Services
|
||||
{
|
||||
// these tests tend to fail from time to time esp. on VSTS
|
||||
//
|
||||
// read
|
||||
// Lock Time-out: https://technet.microsoft.com/en-us/library/ms172402.aspx?f=255&MSPPError=-2147217396
|
||||
// http://support.x-tensive.com/question/5242/strange-locking-exceptions-with-sqlserverce
|
||||
// http://debuggingblog.com/wp/2009/05/07/high-cpu-usage-and-windows-forms-application-hang-with-sqlce-database-and-the-sqlcelocktimeoutexception/
|
||||
//
|
||||
// tried to increase it via connection string or via SET LOCK_TIMEOUT
|
||||
// but still, the test fails on VSTS in most cases, so now ignoring it,
|
||||
// as I could not figure out _why_ and it does not look like we are
|
||||
// causing it, getting into __sysObjects locks, no idea why
|
||||
|
||||
[DatabaseTestBehavior(DatabaseBehavior.NewDbFileAndSchemaPerTest)]
|
||||
[TestFixture, RequiresSTA]
|
||||
public class ThreadSafetyServiceTest : BaseDatabaseFactoryTest
|
||||
@@ -32,23 +45,82 @@ namespace Umbraco.Tests.Services
|
||||
base.TearDown();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to track exceptions during multi-threaded tests, volatile so that it is not locked in CPU registers.
|
||||
/// </summary>
|
||||
private volatile Exception _error = null;
|
||||
// not sure this is doing anything really
|
||||
protected override string GetDbConnectionString()
|
||||
{
|
||||
// need a longer timeout for tests?
|
||||
return base.GetDbConnectionString() + "default lock timeout=60000;";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to track exceptions during multi-threaded tests, volatile so that it is not locked in CPU registers.
|
||||
/// </summary>
|
||||
private volatile Exception _error;
|
||||
|
||||
private const int MaxThreadCount = 20;
|
||||
|
||||
[Test]
|
||||
private IScopeProvider ScopeProvider { get { return ApplicationContext.Current.ScopeProvider; } }
|
||||
|
||||
private void Save(ContentService service, IContent content)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
scope.Database.Execute("SET LOCK_TIMEOUT 60000");
|
||||
service.Save(content);
|
||||
scope.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
private void Save(MediaService service, IMedia media)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
scope.Database.Execute("SET LOCK_TIMEOUT 60000");
|
||||
service.Save(media);
|
||||
scope.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
private ManualResetEventSlim TraceLocks()
|
||||
{
|
||||
var done = new ManualResetEventSlim(false);
|
||||
|
||||
// comment out to trace locks
|
||||
return done;
|
||||
|
||||
new Thread(() =>
|
||||
{
|
||||
while (done.IsSet == false)
|
||||
{
|
||||
var db = ApplicationContext.Current.DatabaseContext.Database;
|
||||
var info = db.Query<dynamic>("SELECT * FROM sys.lock_information;");
|
||||
Console.WriteLine("LOCKS:");
|
||||
foreach (var row in info)
|
||||
{
|
||||
Console.WriteLine("> " + row.request_spid + " " + row.resource_type + " " + row.resource_description + " " + row.request_mode + " " + row.resource_table + " " + row.resource_table_id + " " + row.request_status);
|
||||
}
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}).Start();
|
||||
return done;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Ensure_All_Threads_Execute_Successfully_Content_Service()
|
||||
{
|
||||
//we will mimick the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton
|
||||
if (Environment.GetEnvironmentVariable("UMBRACO_TMP") != null)
|
||||
Assert.Ignore("Do not run on VSTS.");
|
||||
|
||||
// the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton
|
||||
var contentService = (ContentService)ServiceContext.ContentService;
|
||||
|
||||
var threads = new List<Thread>();
|
||||
|
||||
Debug.WriteLine("Starting...");
|
||||
|
||||
var done = TraceLocks();
|
||||
|
||||
_error = null;
|
||||
for (var i = 0; i < MaxThreadCount; i++)
|
||||
{
|
||||
var t = new Thread(() =>
|
||||
@@ -57,26 +129,17 @@ namespace Umbraco.Tests.Services
|
||||
{
|
||||
Debug.WriteLine("[{0}] Running...", Thread.CurrentThread.ManagedThreadId);
|
||||
|
||||
using (var scope = ApplicationContext.Current.ScopeProvider.CreateScope())
|
||||
{
|
||||
var database = scope.Database;
|
||||
Debug.WriteLine("[{0}] Database {1}.", Thread.CurrentThread.ManagedThreadId, database.InstanceSid);
|
||||
}
|
||||
|
||||
//create 2 content items
|
||||
|
||||
string name1 = "test" + Guid.NewGuid();
|
||||
var content1 = contentService.CreateContent(name1, -1, "umbTextpage", 0);
|
||||
|
||||
var name1 = "test-" + Guid.NewGuid();
|
||||
var content1 = contentService.CreateContent(name1, -1, "umbTextpage");
|
||||
Debug.WriteLine("[{0}] Saving content #1.", Thread.CurrentThread.ManagedThreadId);
|
||||
contentService.Save(content1);
|
||||
Save(contentService, content1);
|
||||
|
||||
Thread.Sleep(100); //quick pause for maximum overlap!
|
||||
Thread.Sleep(100); // quick pause for maximum overlap
|
||||
|
||||
string name2 = "test" + Guid.NewGuid();
|
||||
var content2 = contentService.CreateContent(name2, -1, "umbTextpage", 0);
|
||||
var name2 = "test-" + Guid.NewGuid();
|
||||
var content2 = contentService.CreateContent(name2, -1, "umbTextpage");
|
||||
Debug.WriteLine("[{0}] Saving content #2.", Thread.CurrentThread.ManagedThreadId);
|
||||
contentService.Save(content2);
|
||||
Save(contentService, content2);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@@ -86,39 +149,43 @@ namespace Umbraco.Tests.Services
|
||||
threads.Add(t);
|
||||
}
|
||||
|
||||
//start all threads
|
||||
// start all threads
|
||||
threads.ForEach(x => x.Start());
|
||||
|
||||
//wait for all to complete
|
||||
// wait for all to complete
|
||||
threads.ForEach(x => x.Join());
|
||||
|
||||
//kill them all
|
||||
threads.ForEach(x => x.Abort());
|
||||
done.Set();
|
||||
|
||||
if (_error == null)
|
||||
{
|
||||
//now look up all items, there should be 40!
|
||||
// now look up all items, there should be 40!
|
||||
var items = contentService.GetRootContent();
|
||||
Assert.AreEqual(40, items.Count());
|
||||
Assert.AreEqual(2 * MaxThreadCount, items.Count());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Error!", _error);
|
||||
}
|
||||
|
||||
Assert.Fail("ERROR! " + _error);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Ensure_All_Threads_Execute_Successfully_Media_Service()
|
||||
{
|
||||
//we will mimick the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton
|
||||
var mediaService = (MediaService)ServiceContext.MediaService;
|
||||
if (Environment.GetEnvironmentVariable("UMBRACO_TMP") != null)
|
||||
Assert.Ignore("Do not run on VSTS.");
|
||||
|
||||
// mimick the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton
|
||||
var mediaService = (MediaService) ServiceContext.MediaService;
|
||||
|
||||
var threads = new List<Thread>();
|
||||
|
||||
Debug.WriteLine("Starting...");
|
||||
|
||||
for (var i = 0; i < MaxThreadCount; i++)
|
||||
var done = TraceLocks();
|
||||
|
||||
_error = null;
|
||||
for (var i = 0; i < MaxThreadCount; i++)
|
||||
{
|
||||
var t = new Thread(() =>
|
||||
{
|
||||
@@ -126,25 +193,17 @@ namespace Umbraco.Tests.Services
|
||||
{
|
||||
Debug.WriteLine("[{0}] Running...", Thread.CurrentThread.ManagedThreadId);
|
||||
|
||||
using (var scope = ApplicationContext.Current.ScopeProvider.CreateScope())
|
||||
{
|
||||
var database = scope.Database;
|
||||
Debug.WriteLine("[{0}] Database {1}.", Thread.CurrentThread.ManagedThreadId, database.InstanceSid);
|
||||
}
|
||||
var name1 = "test-" + Guid.NewGuid();
|
||||
var media1 = mediaService.CreateMedia(name1, -1, Constants.Conventions.MediaTypes.Folder);
|
||||
Debug.WriteLine("[{0}] Saving media #1.", Thread.CurrentThread.ManagedThreadId);
|
||||
Save(mediaService, media1);
|
||||
|
||||
//create 2 content items
|
||||
Thread.Sleep(100); // quick pause for maximum overlap
|
||||
|
||||
string name1 = "test" + Guid.NewGuid();
|
||||
var folder1 = mediaService.CreateMedia(name1, -1, Constants.Conventions.MediaTypes.Folder, 0);
|
||||
Debug.WriteLine("[{0}] Saving content #1.", Thread.CurrentThread.ManagedThreadId);
|
||||
mediaService.Save(folder1, 0);
|
||||
|
||||
Thread.Sleep(100); //quick pause for maximum overlap!
|
||||
|
||||
string name = "test" + Guid.NewGuid();
|
||||
var folder2 = mediaService.CreateMedia(name, -1, Constants.Conventions.MediaTypes.Folder, 0);
|
||||
Debug.WriteLine("[{0}] Saving content #2.", Thread.CurrentThread.ManagedThreadId);
|
||||
mediaService.Save(folder2, 0);
|
||||
var name2 = "test-" + Guid.NewGuid();
|
||||
var media2 = mediaService.CreateMedia(name2, -1, Constants.Conventions.MediaTypes.Folder);
|
||||
Debug.WriteLine("[{0}] Saving media #2.", Thread.CurrentThread.ManagedThreadId);
|
||||
Save(mediaService, media2);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -154,32 +213,30 @@ namespace Umbraco.Tests.Services
|
||||
threads.Add(t);
|
||||
}
|
||||
|
||||
//start all threads
|
||||
// start all threads
|
||||
threads.ForEach(x => x.Start());
|
||||
|
||||
//wait for all to complete
|
||||
// wait for all to complete
|
||||
threads.ForEach(x => x.Join());
|
||||
|
||||
//kill them all
|
||||
threads.ForEach(x => x.Abort());
|
||||
done.Set();
|
||||
|
||||
if (_error == null)
|
||||
{
|
||||
//now look up all items, there should be 40!
|
||||
// now look up all items, there should be 40
|
||||
var items = mediaService.GetRootMedia();
|
||||
Assert.AreEqual(40, items.Count());
|
||||
Assert.AreEqual(2 * MaxThreadCount, items.Count());
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Fail("ERROR! " + _error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void CreateTestData()
|
||||
{
|
||||
//Create and Save ContentType "umbTextpage" -> 1045
|
||||
ContentType contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage", "Textpage");
|
||||
// Create and Save ContentType "umbTextpage" -> 1045
|
||||
var contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage", "Textpage");
|
||||
contentType.Key = new Guid("1D3A8E6E-2EA9-4CC1-B229-1AEE19821522");
|
||||
ServiceContext.ContentTypeService.Save(contentType);
|
||||
}
|
||||
|
||||
@@ -770,12 +770,10 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /I /C /D
|
||||
xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\" /Y /F /E /I /C /D</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
||||
<!-- 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.
|
||||
|
||||
@@ -2371,6 +2371,7 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
@@ -2389,33 +2390,33 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
|
||||
<Import Project="$(MSBuildProjectDirectory)\..\umbraco.presentation.targets" Condition="$(BuildingInsideVisualStudio) != true" />
|
||||
<Import Project="$(SolutionDir)umbraco.presentation.targets" Condition="$(BuildingInsideVisualStudio) == true" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
|
||||
<PropertyGroup Condition="$(WebPublishingTasks) == '' and Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(WebPublishingTasks) == '' and Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(WebPublishingTasks) == '' and Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(WebPublishingTasks) == '' and Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(WebPublishingTasks) == '' and Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll')">
|
||||
<WebPublishingTasks>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll</WebPublishingTasks>
|
||||
</PropertyGroup>
|
||||
|
||||
<UsingTask TaskName="TransformXml" AssemblyFile="$(WebPublishingTasks)" Condition="'$(WebPublishingTasks)' != ''" />
|
||||
<UsingTask TaskName="TransformXml" AssemblyFile="$(VSWherePath)\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.Tasks.dll" Condition="'$(VSWherePath)' != ''" />
|
||||
|
||||
<Target Name="BeforeBuild">
|
||||
<Message Text="WebPublishingTasks: $(WebPublishingTasks)" Importance="high" />
|
||||
<Message Text="VSWherePath: $(VSWherePath)" Importance="high" />
|
||||
|
||||
<!-- Create web.config file from Template if it doesn't exist -->
|
||||
<Copy SourceFiles="$(ProjectDir)web.Template.config" DestinationFiles="$(ProjectDir)Web.config" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="false" Condition="!Exists('$(ProjectDir)Web.config')" />
|
||||
<!-- Transform the local Web.config file in Visual Studio -->
|
||||
@@ -2424,18 +2425,19 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
|
||||
<TransformXml Source="$(ProjectDir)Web.Template.config" Transform="$(ProjectDir)web.Template.$(Configuration).config" Destination="Web.$(Configuration).config.transformed" Condition="$(BuildingInsideVisualStudio) != true" />
|
||||
<!-- Create ClientDependency.config file from Template if it doesn't exist -->
|
||||
<Copy SourceFiles="$(ProjectDir)Config\ClientDependency.Release.config" DestinationFiles="$(ProjectDir)Config\ClientDependency.config" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="false" Condition="!Exists('$(ProjectDir)Config\ClientDependency.config')" />
|
||||
|
||||
<!-- Only runs if the Belle build folder doesn't yet exist -->
|
||||
<CallTarget Targets="BelleBuild" Condition="!Exists('$(ProjectDir)\..\Umbraco.Web.UI.Client\build')" />
|
||||
<Message Text="UmbracoBuild, skipping BelleBuild" Importance="High" Condition=" '$(UmbracoBuild)' != '' " />
|
||||
<CallTarget Targets="BelleBuild" Condition="!Exists('$(ProjectDir)\..\Umbraco.Web.UI.Client\build') and '$(UmbracoBuild)' == ''" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AfterBuild">
|
||||
<Copy SourceFiles="$(ProjectDir)Web.$(Configuration).config.transformed" DestinationFiles="$(ProjectDir)Web.config" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="false" Condition="$(BuildingInsideVisualStudio) == true" />
|
||||
</Target>
|
||||
<Target Name="BelleBuild" BeforeTargets="Rebuild">
|
||||
<!-- Only runs when a Rebuild is requested -->
|
||||
<ReadLinesFromFile File="$(ProjectDir)\..\..\build\UmbracoVersion.txt">
|
||||
<Output TaskParameter="Lines" PropertyName="VersionNumber" />
|
||||
</ReadLinesFromFile>
|
||||
<Exec WorkingDirectory="$(ProjectDir)\..\..\build\" Command="BuildBelle.bat $(VersionNumber)" ConsoleToMSBuild="true" IgnoreExitCode="true" ContinueOnError="WarnAndContinue" />
|
||||
|
||||
<Target Name="BelleBuild" BeforeTargets="Rebuild" Condition=" '$(UmbracoBuild)' == '' ">
|
||||
<Exec WorkingDirectory="$(ProjectDir)\..\..\" Command="powershell -ExecutionPolicy RemoteSigned -Command "&{ $env:PSModulePath = \"$pwd\build\Modules\;$env:PSModulePath\" ; Import-Module Umbraco.Build -Force -DisableNameChecking ; build-umbraco compile-belle }"" />
|
||||
</Target>
|
||||
|
||||
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
||||
</Project>
|
||||
@@ -41,4 +41,5 @@
|
||||
<add initialize="true" sortOrder="0" alias="form" application="forms" title="Forms" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.FormTreeController, Umbraco.Forms.Web" />
|
||||
<add initialize="true" sortOrder="3" alias="prevaluesource" application="forms" title="Prevalue sources" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.PreValueSourceTreeController, Umbraco.Forms.Web" />
|
||||
<add initialize="true" sortOrder="3" alias="formsecurity" application="users" title="Forms Security" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.FormSecurityTreeController, Umbraco.Forms.Web" />
|
||||
<add initialize="false" sortOrder="0" alias="emailTemplates" application="forms" title="Email Templates" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.EmailTemplateTreeController, Umbraco.Forms.Web" />
|
||||
</trees>
|
||||
@@ -2253,6 +2253,5 @@
|
||||
<PropertyGroup>
|
||||
<!--<PostBuildEvent>xcopy "$(ProjectDir)..\..\lib\*.dll" "$(TargetDir)*.dll" /Y</PostBuildEvent>-->
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
||||
</Project>
|
||||
@@ -189,7 +189,6 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- 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">
|
||||
|
||||
@@ -234,7 +234,6 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- 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">
|
||||
|
||||
@@ -295,6 +295,5 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
||||
</Project>
|
||||
@@ -443,5 +443,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
</Project>
|
||||
@@ -175,7 +175,6 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- 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">
|
||||
|
||||
@@ -164,7 +164,6 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- 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">
|
||||
|
||||
@@ -495,5 +495,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user