Permalink
Browse files

Completing setup as a standalone project

  • Loading branch information...
1 parent 875b14c commit d4a2323ca19d2c4bde9358465438abc371a6ed5b @ayende ayende committed May 2, 2011
Showing with 5,950 additions and 0 deletions.
  1. +116 −0 .gitignore
  2. +10 −0 How to build.txt
  3. +11 −0 Raven.Json.Tests/Class1.cs
  4. +144 −0 Raven.Json.Tests/CloningTests.cs
  5. BIN Raven.Json.Tests/Properties/AssemblyInfo.cs
  6. +67 −0 Raven.Json.Tests/Raven.Json.Tests.csproj
  7. +89 −0 Raven.Json.Tests/RavenJObjects.cs
  8. +26 −0 Raven.Json.sln
  9. BIN Raven.Json/Properties/AssemblyInfo.cs
  10. +117 −0 Tools/xUnit/HTML.xslt
  11. +121 −0 Tools/xUnit/NUnitXml.xslt
  12. BIN Tools/xUnit/xunit.console.clr4.exe
  13. +21 −0 Tools/xUnit/xunit.console.clr4.exe.config
  14. BIN Tools/xUnit/xunit.console.clr4.x86.exe
  15. +21 −0 Tools/xUnit/xunit.console.clr4.x86.exe.config
  16. BIN Tools/xUnit/xunit.console.exe
  17. +21 −0 Tools/xUnit/xunit.console.exe.config
  18. BIN Tools/xUnit/xunit.console.x86.exe
  19. +21 −0 Tools/xUnit/xunit.console.x86.exe.config
  20. BIN Tools/xUnit/xunit.dll
  21. +5 −0 Tools/xUnit/xunit.dll.tdnet
  22. BIN Tools/xUnit/xunit.extensions.dll
  23. +787 −0 Tools/xUnit/xunit.extensions.xml
  24. BIN Tools/xUnit/xunit.gui.clr4.exe
  25. BIN Tools/xUnit/xunit.gui.clr4.x86.exe
  26. BIN Tools/xUnit/xunit.gui.exe
  27. BIN Tools/xUnit/xunit.gui.x86.exe
  28. BIN Tools/xUnit/xunit.installer.exe
  29. BIN Tools/xUnit/xunit.runner.msbuild.dll
  30. BIN Tools/xUnit/xunit.runner.tdnet.dll
  31. BIN Tools/xUnit/xunit.runner.utility.dll
  32. +1,173 −0 Tools/xUnit/xunit.runner.utility.xml
  33. +2,437 −0 Tools/xUnit/xunit.xml
  34. BIN Tools/zip.exe
  35. +183 −0 agpl.txt
  36. +99 −0 default.ps1
  37. +79 −0 license.txt
  38. +7 −0 normalize-crlf.ps1
  39. +313 −0 psake.ps1
  40. +82 −0 psake_ext.ps1
View
@@ -0,0 +1,116 @@
+*resharper.user
+[Dd]ebug/
+[Rr]elease/
+build/
+[Bb]in/
+[Oo]bj/
+[Hh]elp/
+*.suo
+*.sln.cache
+_ReSharper.*/
+*.user
+/Data/Data
+/Data/IndexDefinitions/
+/Data/Index/
+/Data/logs/
+/Data/system/
+/Data/temp/
+*.InstallLog
+/Raven.Database/Raven.Database.g.csproj
+/test/storage.raven
+/Raven.Web/Data/
+/SharedLibs/Sources/Json-52373/trunk/Working/
+VERSION
+/Samples/Raven.Samples.IndexReplication/Server/Esent.Interop.dll
+/Samples/Raven.Samples.IndexReplication/Server/ICSharpCode.NRefactory.dll
+/Samples/Raven.Samples.IndexReplication/Server/Lucene.Net.dll
+/Samples/Raven.Samples.IndexReplication/Server/Newtonsoft.Json.dll
+/Samples/Raven.Samples.IndexReplication/Server/Raven.Database.dll
+/Samples/Raven.Samples.IndexReplication/Server/Raven.Server.exe
+/Samples/Raven.Samples.IndexReplication/Server/Raven.Storage.Esent.dll
+/Samples/Raven.Samples.IndexReplication/Server/Rhino.Licensing.dll
+/Samples/Raven.Samples.IndexReplication/Server/log4net.dll
+/Samples/MvcMusicStore/Server/Esent.Interop.dll
+/Samples/MvcMusicStore/Server/ICSharpCode.NRefactory.dll
+/Samples/MvcMusicStore/Server/Lucene.Net.dll
+/Samples/MvcMusicStore/Server/Newtonsoft.Json.dll
+/Samples/MvcMusicStore/Server/Raven.Database.dll
+/Samples/MvcMusicStore/Server/Raven.Server.exe
+/Samples/MvcMusicStore/Server/Raven.Storage.Esent.dll
+/Samples/MvcMusicStore/Server/Rhino.Licensing.dll
+/Samples/MvcMusicStore/Server/log4net.dll
+/Samples/MvcMusicStore/Server/Esent.Interop.dll
+/Samples/MvcMusicStore/Server/ICSharpCode.NRefactory.dll
+/Samples/MvcMusicStore/Server/Lucene.Net.dll
+/Samples/MvcMusicStore/Server/Newtonsoft.Json.dll
+/Samples/MvcMusicStore/Server/Raven.Database.dll
+/Samples/MvcMusicStore/Server/Raven.Server.exe
+/Samples/MvcMusicStore/Server/Raven.Storage.Esent.dll
+/Samples/MvcMusicStore/Server/Rhino.Licensing.dll
+/Samples/MvcMusicStore/Server/log4net.dll
+/Samples/Raven.Sample.EventSourcing/Server/Esent.Interop.dll
+/Samples/Raven.Sample.EventSourcing/Server/ICSharpCode.NRefactory.dll
+/Samples/Raven.Sample.EventSourcing/Server/Lucene.Net.dll
+/Samples/Raven.Sample.EventSourcing/Server/Newtonsoft.Json.dll
+/Samples/Raven.Sample.EventSourcing/Server/Raven.Database.dll
+/Samples/Raven.Sample.EventSourcing/Server/Raven.Server.exe
+/Samples/Raven.Sample.EventSourcing/Server/Raven.Storage.Esent.dll
+/Samples/Raven.Sample.EventSourcing/Server/Rhino.Licensing.dll
+/Samples/Raven.Sample.EventSourcing/Server/log4net.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/Esent.Interop.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/ICSharpCode.NRefactory.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/Lucene.Net.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/Newtonsoft.Json.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/Raven.Database.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/Raven.Server.exe
+/Samples/Raven.Sample.Failover/Servers/Shard1/Raven.Storage.Esent.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/Rhino.Licensing.dll
+/Samples/Raven.Sample.Failover/Servers/Shard1/log4net.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/Esent.Interop.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/ICSharpCode.NRefactory.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/Lucene.Net.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/Newtonsoft.Json.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/Raven.Database.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/Raven.Server.exe
+/Samples/Raven.Sample.Failover/Servers/Shard2/Raven.Storage.Esent.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/Rhino.Licensing.dll
+/Samples/Raven.Sample.Failover/Servers/Shard2/log4net.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/Esent.Interop.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/ICSharpCode.NRefactory.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/Lucene.Net.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/Newtonsoft.Json.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/Raven.Database.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/Raven.Server.exe
+/Samples/Raven.Sample.Replication/Servers/Shard1/Raven.Storage.Esent.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/Rhino.Licensing.dll
+/Samples/Raven.Sample.Replication/Servers/Shard1/log4net.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/Esent.Interop.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/ICSharpCode.NRefactory.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/Lucene.Net.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/Newtonsoft.Json.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/Raven.Database.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/Raven.Server.exe
+/Samples/Raven.Sample.Replication/Servers/Shard2/Raven.Storage.Esent.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/Rhino.Licensing.dll
+/Samples/Raven.Sample.Replication/Servers/Shard2/log4net.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/Esent.Interop.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/ICSharpCode.NRefactory.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/Lucene.Net.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/Newtonsoft.Json.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/Raven.Database.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/Raven.Server.exe
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/Raven.Storage.Esent.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/Rhino.Licensing.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard1/log4net.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/Esent.Interop.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/ICSharpCode.NRefactory.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/Lucene.Net.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/Newtonsoft.Json.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/Raven.Database.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/Raven.Server.exe
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/Raven.Storage.Esent.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/Rhino.Licensing.dll
+/Samples/Raven.Sample.ShardClient/Servers/Shard2/log4net.dll
+*.nupkg
+/Raven.Abstractions/Raven.Abstractions.g.3.5.csproj
+/Raven.Client.Lightweight/Raven.Client.Lightweight.g.3.5.csproj
View
@@ -0,0 +1,10 @@
+In order to build this project, you need to execute the psake build script from the PowerShell console.
+You do this using the following command from the root project directory:
+
+ .\psake.ps1 default.ps1
+
+You may need to allow script execution by running the following command as adminstrator:
+
+ Set-ExecutionPolicy unrestricted
+
+Also note that the build script assume that you have git.exe on your path.
View
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Raven.Json.Tests
+{
+ public class Class1
+ {
+ }
+}
@@ -0,0 +1,144 @@
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using Raven.Json.Linq;
+using Xunit;
+
+namespace Raven.Tests.Json
+{
+ public class CloningTests
+ {
+
+
+ public class Blog
+ {
+ public string Title
+ {
+ get;
+ set;
+ }
+
+ public string Category
+ {
+ get;
+ set;
+ }
+
+ public BlogTag[] Tags
+ {
+ get;
+ set;
+ }
+ }
+
+ public class BlogTag
+ {
+ public string Name { get; set; }
+ }
+
+ [Fact]
+ public void WhenCloningWillRetainAllValues()
+ {
+ var newBlog = new Blog()
+ {
+ Tags = new[]{
+ new BlogTag() { Name = "SuperCallaFragalisticExpealadocious" }
+ }
+ };
+
+ var expected = RavenJObject.FromObject(newBlog);
+ var actual = new RavenJObject(expected);
+
+ Assert.Equal(expected.ToString(Formatting.None), actual.ToString(Formatting.None));
+ }
+
+ [Fact]
+ public void CloningTestsStoresValues()
+ {
+ var f = new RavenJObject();
+ f.Add("test", "Test");
+ f.Add("2nd", "second");
+ Assert.True(f.Count == 2);
+ }
+
+ [Fact]
+ public void CloningTestsWorksCorrectly()
+ {
+ var f = new RavenJObject();
+ f["1"] = new RavenJValue(1);
+ f["2"] = new RavenJValue(2);
+
+ var f1 = (RavenJObject)f.CloneToken();
+ f1["2"] = new RavenJValue(3);
+
+ var val = (RavenJValue) f["2"];
+ Assert.Equal(2, val.Value);
+ val = (RavenJValue)f1["2"];
+ Assert.Equal(3, val.Value);
+
+ var f2 = (RavenJObject)f1.CloneToken();
+ val = (RavenJValue)f2["2"];
+ Assert.Equal(3, val.Value);
+
+ f["2"] = f2;
+ f1 = (RavenJObject) f.CloneToken();
+ f.Remove("2");
+ Assert.Null(f["2"]);
+ Assert.NotNull(f1["2"]);
+ }
+
+ [Fact]
+ public void ChangingValuesOfParent()
+ {
+ var obj = RavenJObject.Parse(" { 'Me': { 'ObjectID': 1} }");
+ var obj2 = obj.CloneToken();
+ var obj3 = obj.CloneToken();
+
+ var o = obj2.Value<RavenJObject>("Me");
+ o["ObjectID"] = 2;
+
+ obj3.Value<RavenJObject>("Me")["ObjectID"] = 3;
+ Assert.Equal(1, obj.Value<RavenJObject>("Me").Value<int>("ObjectID"));
+ Assert.Equal(2, obj2.Value<RavenJObject>("Me").Value<int>("ObjectID"));
+ Assert.Equal(3, obj3.Value<RavenJObject>("Me").Value<int>("ObjectID"));
+ }
+
+ public void ShouldNotFail()
+ {
+ var root = new RavenJObject();
+ var current = root;
+ for (int i = 0; i < 10000; i++)
+ {
+ var temp = new RavenJObject();
+ current.Add("Inner", temp);
+ current = temp;
+ }
+
+ var anotherRoot = (RavenJObject)root.CloneToken();
+ do
+ {
+ anotherRoot["Inner"] = 0;
+ } while ((anotherRoot = anotherRoot["Inner"] as RavenJObject) != null);
+ }
+
+ [Fact]
+ public void ShouldBehaveNicelyInMultithreaded()
+ {
+ var obj = new RavenJObject
+ {
+ {"prop1", 2},
+ {"prop2", "123"}
+ };
+
+ var copy = (RavenJObject)obj.CloneToken() ;
+ copy["@id"] = "movies/1";
+
+ Parallel.For(0, 10000, i =>
+ {
+ Assert.True(copy.ContainsKey("@id"));
+ var foo = (RavenJObject)copy.CloneToken();
+ Assert.True(foo.ContainsKey("@id"));
+ Assert.True(copy.ContainsKey("@id"));
+ });
+ }
+ }
+}
Binary file not shown.
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{3037657A-4C90-47C2-A9BD-D18B38341E32}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Raven.Json.Tests</RootNamespace>
+ <AssemblyName>Raven.Json.Tests</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\SharedLibs\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="xunit">
+ <HintPath>..\SharedLibs\xunit.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="CloningTests.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="RavenJObjects.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Raven.Json\Raven.Json.csproj">
+ <Project>{31740175-3254-489D-AD59-73EF096BA64D}</Project>
+ <Name>Raven.Json</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Oops, something went wrong.

0 comments on commit d4a2323

Please sign in to comment.