static Global() { CommitId = ConfigurationManager.AppSettings.Get("appharbor.commit_id"); var settings = LoadSettings(); var integrationPath = settings["DataPath"]; var contracts = Contracts.CreateStreamer(); var strategy = new DocumentStrategy(); if (integrationPath.StartsWith("file:")) { var path = integrationPath.Remove(0, 5); var config = FileStorage.CreateConfig(path); Docs = config.CreateNuclear(strategy).Container; Client = new WebEndpoint(new NuclearStorage(Docs), contracts, config.CreateQueueWriter(Topology.RouterQueue)); } else if (integrationPath.StartsWith("azure:")) { var path = integrationPath.Remove(0, 6); var config = AzureStorage.CreateConfig(path); Docs = config.CreateNuclear(strategy).Container; Client = new WebEndpoint(new NuclearStorage(Docs), contracts, config.CreateQueueWriter(Topology.RouterQueue)); } else { throw new InvalidOperationException("Unsupported environment"); } Forms = new FormsAuth(Docs.GetReader <UserId, LoginView>()); Auth = new WebAuth(Client); }
static Global() { CommitId = ConfigurationManager.AppSettings.Get("appharbor.commit_id"); var settings = LoadSettings(); var integrationPath = settings["DataPath"]; var contracts = Contracts.CreateStreamer(); var strategy = new DocumentStrategy(); if (integrationPath.StartsWith("file:")) { var path = integrationPath.Remove(0, 5); var config = FileStorage.CreateConfig(path); Docs = config.CreateNuclear(strategy).Container; Client = new WebEndpoint(new NuclearStorage(Docs), contracts, config.CreateQueueWriter(Topology.RouterQueue)); } else if (integrationPath.StartsWith("azure:")) { var path = integrationPath.Remove(0, 6); var config = AzureStorage.CreateConfig(path); Docs = config.CreateNuclear(strategy).Container; Client = new WebEndpoint(new NuclearStorage(Docs), contracts, config.CreateQueueWriter(Topology.RouterQueue)); } else { throw new InvalidOperationException("Unsupperted environment"); } Forms = new FormsAuth(Docs.GetReader<UserId, LoginView>()); Auth = new WebAuth(Client); }
public void Setup() { _name = Guid.NewGuid().ToString().ToLowerInvariant(); CloudStorageAccount cloudStorageAccount = ConnectionConfig.StorageAccount; var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); var documentStrategy = new DocumentStrategy(_name); _store = new AzureDocumentStore(documentStrategy, cloudBlobClient); }
public void create_document_store() { //GIVEN var documentStrategy = new DocumentStrategy(); var store = _config.CreateDocumentStore(documentStrategy); //WHEN Assert.IsTrue(store is FileDocumentStore); Assert.AreEqual(new Uri(Path.GetFullPath(_configPath)).AbsolutePath, store.ToString()); Assert.AreEqual(documentStrategy, store.Strategy); }
public void Setup() { var documentStrategy = new DocumentStrategy(); var concurrentDictionary = new ConcurrentDictionary<string, byte[]>(); _reader = new MemoryDocumentReaderWriter<Guid, int>(documentStrategy, concurrentDictionary); _writer = new MemoryDocumentReaderWriter<Guid, int>(documentStrategy, concurrentDictionary); _testClassReader = new MemoryDocumentReaderWriter<unit, Test1>(documentStrategy, concurrentDictionary); _testClassWtiter = new MemoryDocumentReaderWriter<unit, Test1>(documentStrategy, concurrentDictionary); _guidKeyClassReader = new MemoryDocumentReaderWriter<Guid, Test1>(documentStrategy, concurrentDictionary); _guidKeyClassWriter = new MemoryDocumentReaderWriter<Guid, Test1>(documentStrategy, concurrentDictionary); }
public void Setup() { var tmpPath = Path.GetTempPath(); var documentStrategy = new DocumentStrategy(); _reader = new FileDocumentReaderWriter<Guid, int>(tmpPath, documentStrategy); _writer = new FileDocumentReaderWriter<Guid, int>(tmpPath, documentStrategy); _testClassReader = new FileDocumentReaderWriter<unit, Test1>(tmpPath, documentStrategy); _testClassWtiter = new FileDocumentReaderWriter<unit, Test1>(tmpPath, documentStrategy); _guidKeyClassReader = new FileDocumentReaderWriter<Guid, Test1>(tmpPath, documentStrategy); _guidKeyClassWriter = new FileDocumentReaderWriter<Guid, Test1>(tmpPath, documentStrategy); }
public void Setup() { var documentStrategy = new DocumentStrategy(); var concurrentDictionary = new ConcurrentDictionary <string, byte[]>(); _reader = new MemoryDocumentReaderWriter <Guid, int>(documentStrategy, concurrentDictionary); _writer = new MemoryDocumentReaderWriter <Guid, int>(documentStrategy, concurrentDictionary); _testClassReader = new MemoryDocumentReaderWriter <unit, Test1>(documentStrategy, concurrentDictionary); _testClassWtiter = new MemoryDocumentReaderWriter <unit, Test1>(documentStrategy, concurrentDictionary); _guidKeyClassReader = new MemoryDocumentReaderWriter <Guid, Test1>(documentStrategy, concurrentDictionary); _guidKeyClassWriter = new MemoryDocumentReaderWriter <Guid, Test1>(documentStrategy, concurrentDictionary); }
public void Setup() { var tmpPath = Path.GetTempPath(); var documentStrategy = new DocumentStrategy(); _reader = new FileDocumentReaderWriter <Guid, int>(tmpPath, documentStrategy); _writer = new FileDocumentReaderWriter <Guid, int>(tmpPath, documentStrategy); _testClassReader = new FileDocumentReaderWriter <unit, Test1>(tmpPath, documentStrategy); _testClassWtiter = new FileDocumentReaderWriter <unit, Test1>(tmpPath, documentStrategy); _guidKeyClassReader = new FileDocumentReaderWriter <Guid, Test1>(tmpPath, documentStrategy); _guidKeyClassWriter = new FileDocumentReaderWriter <Guid, Test1>(tmpPath, documentStrategy); }
public void Init() { this._f = new Fixture(); this._originalView = new TestEntity(this._f.Create <string>()); this._key = new TestKey(this._f.Create <byte>()); var strategy = new DocumentStrategy(); var storage = new ConcurrentDictionary <string, byte[]>(); this._memWriter = new MemoryDocumentReaderWriter <TestKey, TestEntity>(strategy, storage); this._writer = new BufferedDocumentWriter <TestKey, TestEntity>(this._memWriter, this._memWriter, strategy); }
public void Setup() { var documentStrategy = new DocumentStrategy(); var concurrentDictionary = new ConcurrentDictionary <string, object>(); this._reader = new NonserializingMemoryDocumentReaderWriter <Guid, int>(documentStrategy, concurrentDictionary); this._writer = new NonserializingMemoryDocumentReaderWriter <Guid, int>(documentStrategy, concurrentDictionary); this._testClassReader = new NonserializingMemoryDocumentReaderWriter <unit, Test1>(documentStrategy, concurrentDictionary); this._testClassWtiter = new NonserializingMemoryDocumentReaderWriter <unit, Test1>(documentStrategy, concurrentDictionary); this._guidKeyClassReader = new NonserializingMemoryDocumentReaderWriter <Guid, Test1>(documentStrategy, concurrentDictionary); this._guidKeyClassWriter = new NonserializingMemoryDocumentReaderWriter <Guid, Test1>(documentStrategy, concurrentDictionary); }
public void Setup() { _name = Guid.NewGuid().ToString().ToLowerInvariant(); CloudStorageAccount cloudStorageAccount = ConnectionConfig.StorageAccount; var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); var documentStrategy = new DocumentStrategy(_name); _store = new AzureDocumentStore(documentStrategy, cloudBlobClient); _container = cloudBlobClient.GetBlobDirectoryReference(_name).Container; _container.CreateIfNotExist(); _sampleDocContainer = cloudBlobClient.GetBlobDirectoryReference(_name).Container; _sampleDocContainer.CreateIfNotExist(); }
public void create_document_store() { var documentStrategy = new DocumentStrategy(); var store = _config.CreateDocumentStore(documentStrategy); Assert.IsTrue(store is FileDocumentStore); Assert.AreEqual(new Uri(Path.GetFullPath(_configPath)).AbsolutePath, store.ToString()); Assert.AreEqual(documentStrategy, store.Strategy); }