public void SetUp() { var connectionFactory = TestUtilities.GetIntegrationConnectionFactory(); var sql = new SqlServerRepository(connectionFactory); var hashConverter = new LegacyHashConversionService(); var tabService = new TabService(new TabRepository(connectionFactory), new RelativityOneService(sql.ConfigurationRepository)); this.textLogger = new TextLogger(); var dbDeployer = new DatabaseDeployer( new DatabaseMigratorFactory(connectionFactory), new ErrorOnlyMigrationResultHandler(this.textLogger)); this.applicationInstallationService = new ApplicationInstallationService(connectionFactory, sql, hashConverter, tabService, dbDeployer, this.textLogger); }
public void SetUp() { this.connectionFactoryMock = new Mock <IConnectionFactory>(); this.sqlServerRepositoryMock = new Mock <ISqlServerRepository>(); this.hashConverterMock = new Mock <IHashConversionService>(); this.tabServiceMock = new Mock <ITabService>(); this.databaseDeployerMock = new Mock <IDatabaseDeployer>(); this.textLogger = new TextLogger(); this.applicationInstallationService = new ApplicationInstallationService( this.connectionFactoryMock.Object, this.sqlServerRepositoryMock.Object, this.hashConverterMock.Object, this.tabServiceMock.Object, this.databaseDeployerMock.Object, this.textLogger); }
public override Response Execute() { // Initialize application install service -- TODO -- use DI to create kernel and get correct implementation if (this.parallelizationInstallationService == null) { // Build up application installation service var logger = new TextLogger(); var connectionFactory = new HelperConnectionFactory(this.Helper); var sqlRepo = new SqlServerRepository(connectionFactory); var hashConverter = new LegacyHashConversionService(); var tabRepository = new TabRepository(connectionFactory); var relativityOneService = new RelativityOneService(sqlRepo.ConfigurationRepository); var tabService = new TabService(tabRepository, relativityOneService); var databaseMigratorFactory = new DatabaseMigratorFactory(connectionFactory); var databaseDeployer = new DatabaseDeployer(databaseMigratorFactory, new ErrorOnlyMigrationResultHandler(logger)); var applicationInstallationService = new ApplicationInstallationService(connectionFactory, sqlRepo, hashConverter, tabService, databaseDeployer, logger); var toggleProvider = new PdbSqlToggleProvider(connectionFactory); var forceDeparallelization = toggleProvider.IsEnabled <DatabaseDeploymentDeparallelizationToggle>(); if (forceDeparallelization) { // Build up the service that checks for version var versionCheckService = new VersionCheckService(new PdbVersionRepository(connectionFactory), logger); this.parallelizationInstallationService = new SingletonDatabaseInstallationService(applicationInstallationService, versionCheckService, new TimeService(), logger); } else { // Build up the service that actually runs the install process this.parallelizationInstallationService = new DefaultDatabaseInstallationService(applicationInstallationService); } } // Install the application var appInstallResponse = this.parallelizationInstallationService.InstallApplication(this.Helper.GetActiveCaseID()).GetAwaiter().GetResult(); // Return response return(new Response { Message = appInstallResponse.Message, Success = appInstallResponse.Success }); }