Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed tests

  • Loading branch information...
commit 3634089b59754268110714a8654aad4520ab30d3 1 parent 894f789
@ayende ayende authored
Showing with 89 additions and 89 deletions.
  1. +52 −52 Raven.Server/RavenDbServer.cs
  2. +3 −1 Raven.Tests.Helpers/RavenTestBase.cs
  3. +1 −1  Raven.Tests/Bugs/AttachmentsWithCredentials.cs
  4. +1 −1  Raven.Tests/Bugs/CompiledIndexes/UsingNetworkEventsToNetworkTemp.cs
  5. +1 −1  Raven.Tests/Bugs/CreateIndexesRemotely.cs
  6. +1 −1  Raven.Tests/Bugs/DtcBlues.cs
  7. +1 −1  Raven.Tests/Bugs/FindPropertyNameForIndex.cs
  8. +1 −1  Raven.Tests/Bugs/ManyDocumentWithMapReduce.cs
  9. +1 −1  Raven.Tests/Bugs/ManyDocumentsViaDTC.cs
  10. +1 −1  Raven.Tests/Bugs/MapRedue/MapReduceIndex.cs
  11. +1 −1  Raven.Tests/Bugs/MassivelyMultiTenant.cs
  12. +1 −1  Raven.Tests/Bugs/PrefetchingBug.cs
  13. +1 −1  Raven.Tests/Bugs/TenantsName.cs
  14. +1 −1  Raven.Tests/Bugs/VeryBigResultSetRemote.cs
  15. +1 −1  Raven.Tests/Bundles/IndexedProperties/Alexander.cs
  16. +1 −1  Raven.Tests/Bundles/IndexedProperties/IndexedProperties.cs
  17. +1 −1  Raven.Tests/Bundles/PeriodicBackups/PeriodicBackupTests.cs
  18. +1 −1  Raven.Tests/Bundles/SqlReplication/CanReplicate.cs
  19. +1 −1  Raven.Tests/Bundles/Versioning/Bugs/MultiTenant.cs
  20. +1 −1  Raven.Tests/IncrementalBackupTest.cs
  21. +1 −1  Raven.Tests/Indexes/OldIndexRunWhileNewIndexesAreRunning.cs
  22. +2 −4 Raven.Tests/Issues/BulkInsertAuth.cs
  23. +1 −1  Raven.Tests/Issues/RavenDB_863_2.cs
  24. +1 −1  Raven.Tests/MailingList/AccessControlHeaders.cs
  25. +1 −1  Raven.Tests/MailingList/ChrisMarisic.cs
  26. +1 −1  Raven.Tests/MailingList/DeanWard.cs
  27. +1 −1  Raven.Tests/MailingList/NestedIndexDynamic.cs
  28. +1 −1  Raven.Tests/MailingList/RavenDbRecoveryTests.cs
  29. +1 −1  Raven.Tests/MailingList/Zeitler.cs
  30. +1 −1  Raven.Tests/MultiGet/MultiGetSecurity.cs
  31. +1 −1  Raven.Tests/Notifications/SecurityOAuth.cs
  32. +1 −1  Raven.Tests/Notifications/Security_Windows.cs
  33. +1 −1  Raven.Tests/Security/OAuth/AccessTokenAuthentication.cs
  34. +1 −1  Raven.Tests/Security/OAuth/ApiKey.cs
  35. +1 −1  Raven.Tests/Security/OAuth/GrantAccessTokenClientCredentialsFlow.cs
View
104 Raven.Server/RavenDbServer.cs
@@ -1,53 +1,53 @@
-//-----------------------------------------------------------------------
-// <copyright file="RavenDbServer.cs" company="Hibernating Rhinos LTD">
-// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-using System;
-using Raven.Database;
-using Raven.Database.Config;
-using Raven.Database.Server;
-
-namespace Raven.Server
-{
- public class RavenDbServer : IDisposable
- {
- private readonly DocumentDatabase database;
- private readonly HttpServer server;
-
- public DocumentDatabase Database
- {
- get { return database; }
- }
-
- public HttpServer Server
- {
- get { return server; }
- }
-
- public RavenDbServer(RavenConfiguration settings)
- {
- database = new DocumentDatabase(settings);
-
- try
- {
- database.SpinBackgroundWorkers();
- server = new HttpServer(settings, database);
- server.StartListening();
- }
- catch (Exception)
- {
- database.Dispose();
- database = null;
-
- throw;
- }
- }
-
- public void Dispose()
- {
- server.Dispose();
- database.Dispose();
- }
- }
+//-----------------------------------------------------------------------
+// <copyright file="RavenDbServer.cs" company="Hibernating Rhinos LTD">
+// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+using System;
+using Raven.Database;
+using Raven.Database.Config;
+using Raven.Database.Server;
+
+namespace Raven.Server
+{
+ public class RavenDbServer : IDisposable
+ {
+ private readonly DocumentDatabase database;
+ private readonly HttpServer server;
+
+ public DocumentDatabase Database
+ {
+ get { return database; }
+ }
+
+ public HttpServer Server
+ {
+ get { return server; }
+ }
+
+ public RavenDbServer(InMemoryRavenConfiguration settings)
+ {
+ database = new DocumentDatabase(settings);
+
+ try
+ {
+ database.SpinBackgroundWorkers();
+ server = new HttpServer(settings, database);
+ server.StartListening();
+ }
+ catch (Exception)
+ {
+ database.Dispose();
+ database = null;
+
+ throw;
+ }
+ }
+
+ public void Dispose()
+ {
+ server.Dispose();
+ database.Dispose();
+ }
+ }
}
View
4 Raven.Tests.Helpers/RavenTestBase.cs
@@ -159,6 +159,8 @@ protected RavenDbServer GetNewServer(int port = 8079, string dataDirectory = "Da
ModifyConfiguration(ravenConfiguration);
+ ravenConfiguration.PostInit();
+
if (ravenConfiguration.RunInMemory == false && deleteDirectory)
IOExtensions.DeleteDirectory(ravenConfiguration.DataDirectory);
@@ -209,7 +211,7 @@ protected virtual void ModifyStore(EmbeddableDocumentStore documentStore)
{
}
- protected virtual void ModifyConfiguration(RavenConfiguration configuration)
+ protected virtual void ModifyConfiguration(InMemoryRavenConfiguration configuration)
{
}
View
2  Raven.Tests/Bugs/AttachmentsWithCredentials.cs
@@ -42,7 +42,7 @@ public override void Dispose()
base.Dispose();
}
- protected override void ModifyConfiguration(RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
}
View
2  Raven.Tests/Bugs/CompiledIndexes/UsingNetworkEventsToNetworkTemp.cs
@@ -36,7 +36,7 @@ public void CanGetGoodResults()
}
}
- protected override void ModifyConfiguration(RavenConfiguration configuration)
+ protected override void ModifyConfiguration(InMemoryRavenConfiguration configuration)
{
configuration.Catalog.Catalogs.Add(new TypeCatalog(typeof (NetworkEventsToNetworkTemp)));
}
View
2  Raven.Tests/Bugs/CreateIndexesRemotely.cs
@@ -11,7 +11,7 @@ namespace Raven.Tests.Bugs
{
public class CreateIndexesRemotely :RemoteClientTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.AnonymousUserAccessMode = AnonymousUserAccessMode.Get;
}
View
2  Raven.Tests/Bugs/DtcBlues.cs
@@ -79,7 +79,7 @@ public void CanQueryDtcForUncommittedItem()
public class DtcBluesRemoteAndTouchingTheDisk : RemoteClientTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.RunInMemory = false;
}
View
2  Raven.Tests/Bugs/FindPropertyNameForIndex.cs
@@ -7,7 +7,7 @@ namespace Raven.Tests.Bugs
{
public class FindPropertyNameForIndex : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
}
View
2  Raven.Tests/Bugs/ManyDocumentWithMapReduce.cs
@@ -12,7 +12,7 @@ public class TestDocument
public int Id { get; set; }
}
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.MaxPageSize = 10000;
}
View
2  Raven.Tests/Bugs/ManyDocumentsViaDTC.cs
@@ -10,7 +10,7 @@ namespace Raven.Tests.Bugs
{
public class ManyDocumentsViaDTC : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.MaxPageSize = 10000;
}
View
2  Raven.Tests/Bugs/MapRedue/MapReduceIndex.cs
@@ -26,7 +26,7 @@ public MapReduceIndex()
};
}
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.MaxNumberOfParallelIndexTasks = 1;
}
View
2  Raven.Tests/Bugs/MassivelyMultiTenant.cs
@@ -12,7 +12,7 @@ public class MassivelyMultiTenant : RemoteClientTest, IDisposable
private readonly string path;
private readonly RavenDbServer ravenDbServer;
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.DefaultStorageTypeName = "esent";
}
View
2  Raven.Tests/Bugs/PrefetchingBug.cs
@@ -5,7 +5,7 @@ namespace Raven.Tests.Bugs
{
public class PrefetchingBug : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.MaxNumberOfItemsToIndexInSingleBatch = 2;
configuration.MaxNumberOfItemsToReduceInSingleBatch = 2;
View
2  Raven.Tests/Bugs/TenantsName.cs
@@ -10,7 +10,7 @@ namespace Raven.Tests.Bugs
{
public class TenantsName : RavenTest
{
- protected override void ModifyConfiguration(RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.RunInMemory = false;
ravenConfiguration.DefaultStorageTypeName = "esent";
View
2  Raven.Tests/Bugs/VeryBigResultSetRemote.cs
@@ -7,7 +7,7 @@ namespace Raven.Tests.Bugs
{
public class VeryBigResultSetRemote : RemoteClientTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Settings["Raven/Esent/MaxVerPages"] = "512";
configuration.Settings["Raven/Esent/PreferredVerPages"] = "512";
View
2  Raven.Tests/Bundles/IndexedProperties/Alexander.cs
@@ -53,7 +53,7 @@ public IndexedPropertySource_LastAmount()
}
}
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Settings.Add("Raven/ActiveBundles", "IndexedProperties");
}
View
2  Raven.Tests/Bundles/IndexedProperties/IndexedProperties.cs
@@ -116,7 +116,7 @@ public void AverageOrderAmountShouldBeCalculatedCorrectly()
}
}
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Settings.Add("Raven/ActiveBundles", "IndexedProperties");
}
View
2  Raven.Tests/Bundles/PeriodicBackups/PeriodicBackupTests.cs
@@ -16,7 +16,7 @@ namespace Raven.Tests.Bundles.PeriodicBackups
{
public class PeriodicBackupTests : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Settings["Raven/ActiveBundles"] = "PeriodicBackup";
}
View
2  Raven.Tests/Bundles/SqlReplication/CanReplicate.cs
@@ -15,7 +15,7 @@ namespace Raven.Tests.Bundles.SqlReplication
{
public class CanReplicate : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Settings["Raven/ActiveBundles"] = "sqlReplication";
}
View
2  Raven.Tests/Bundles/Versioning/Bugs/MultiTenant.cs
@@ -14,7 +14,7 @@ public class MultiTenant : RavenTest
RavenDbServer ravenDbServer;
private string _dbid = "Test";
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Settings["Raven/ActiveBundles"] = "Versioning";
}
View
2  Raven.Tests/IncrementalBackupTest.cs
@@ -54,7 +54,7 @@ public void CreateIncrementalBackup()
}
}
- protected override void ModifyConfiguration(RavenConfiguration configuration)
+ protected override void ModifyConfiguration(InMemoryRavenConfiguration configuration)
{
configuration.Settings["Raven/Esent/CircularLog"] = "false";
configuration.RunInUnreliableYetFastModeThatIsNotSuitableForProduction = false;
View
2  Raven.Tests/Indexes/OldIndexRunWhileNewIndexesAreRunning.cs
@@ -13,7 +13,7 @@ namespace Raven.Tests.Indexes
{
public class OldIndexRunWhileNewIndexesAreRunning : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.MaxNumberOfItemsToIndexInSingleBatch = 128;
configuration.InitialNumberOfItemsToIndexInSingleBatch = 128;
View
6 Raven.Tests/Issues/BulkInsertAuth.cs
@@ -14,7 +14,7 @@ namespace Raven.Tests.Issues
{
public class BulkInsertAuth : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
}
@@ -36,7 +36,7 @@ public void CanBulkInsertWithWindowsAuth()
public class BulkInsertOAuth : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
}
@@ -70,8 +70,6 @@ public void CanBulkInsertWithApiKey()
{
using (var store = NewRemoteDocumentStore())
{
- WaitForUserToContinueTheTest();
-
using (var op = new RemoteBulkInsertOperation(new BulkInsertOptions(),
(ServerClient)store.DatabaseCommands))
{
View
2  Raven.Tests/Issues/RavenDB_863_2.cs
@@ -14,7 +14,7 @@ public class RavenDB_863_2 : RavenTest
{
public class User { public string Name { get; set; } }
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.InitialNumberOfItemsToReduceInSingleBatch = 2;
configuration.MaxNumberOfItemsToReduceInSingleBatch = 2;
View
2  Raven.Tests/MailingList/AccessControlHeaders.cs
@@ -11,7 +11,7 @@ namespace Raven.Tests.MailingList
{
public class AccessControlHeaders : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.AccessControlAllowOrigin = "*";
}
View
2  Raven.Tests/MailingList/ChrisMarisic.cs
@@ -43,7 +43,7 @@ public class ChrisMarisic : RavenTest
}
};
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.TempIndexPromotionMinimumQueryCount = 1;
}
View
2  Raven.Tests/MailingList/DeanWard.cs
@@ -20,7 +20,7 @@ public override ReadVetoResult AllowRead(string key, Raven.Json.Linq.RavenJObjec
}
}
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Catalog.Catalogs.Add(new TypeCatalog(typeof(FilterEverything)));
}
View
2  Raven.Tests/MailingList/NestedIndexDynamic.cs
@@ -85,7 +85,7 @@ private IEnumerable<IEnumerable<AbstractField>> HandleToken(RavenJToken value, s
}
}
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.Catalog.Catalogs.Add(new TypeCatalog(typeof(DynamicIndex)));
}
View
2  Raven.Tests/MailingList/RavenDbRecoveryTests.cs
@@ -16,7 +16,7 @@ namespace Raven.Tests.MailingList
{
public class RavenDbRecoveryTests : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.DefaultStorageTypeName = "esent";
}
View
2  Raven.Tests/MailingList/Zeitler.cs
@@ -18,7 +18,7 @@ public class PersistentCacheKey
public string ETag { get; set; }
public DateTimeOffset LastModified { get; set; }
}
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.RunInMemory = false;
}
View
2  Raven.Tests/MultiGet/MultiGetSecurity.cs
@@ -12,7 +12,7 @@ namespace Raven.Tests.MultiGet
{
public class MultiGetSecurity : RemoteClientTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.AnonymousUserAccessMode =AnonymousUserAccessMode.Get;
}
View
2  Raven.Tests/Notifications/SecurityOAuth.cs
@@ -18,7 +18,7 @@ namespace Raven.Tests.Notifications
{
public class SecurityOAuth : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
configuration.PostInit();
View
2  Raven.Tests/Notifications/Security_Windows.cs
@@ -16,7 +16,7 @@ namespace Raven.Tests.Notifications
{
public class Security_Windows : RavenTest
{
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
}
View
2  Raven.Tests/Security/OAuth/AccessTokenAuthentication.cs
@@ -29,7 +29,7 @@ public AccessTokenAuthentication()
NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8079);
}
- protected override void ModifyConfiguration(RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
}
View
2  Raven.Tests/Security/OAuth/ApiKey.cs
@@ -17,7 +17,7 @@ public class ApiKey : RemoteClientTest
{
private const string apiKey = "test/ThisIsMySecret";
- protected override void ModifyConfiguration(Database.Config.RavenConfiguration configuration)
+ protected override void ModifyConfiguration(Database.Config.InMemoryRavenConfiguration configuration)
{
configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
}
View
2  Raven.Tests/Security/OAuth/GrantAccessTokenClientCredentialsFlow.cs
@@ -34,7 +34,7 @@ public GrantAccessTokenClientCredentialsFlow()
}
- protected override void ModifyConfiguration(RavenConfiguration ravenConfiguration)
+ protected override void ModifyConfiguration(InMemoryRavenConfiguration ravenConfiguration)
{
ravenConfiguration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
ravenConfiguration.Catalog.Catalogs.Add(new TypeCatalog(typeof(FakeAuthenticateClient)));
Please sign in to comment.
Something went wrong with that request. Please try again.