示例#1
0
 protected override void Arrange()
 {
     base.Arrange();
     base.Act();
     DirectoryImpl.Stub(x => x.CreateRootDirectory()).Return(source);
     DirectoryImpl.Stub(x => x.Root()).Return(dest);
 }
示例#2
0
        public IDirectory GetTempPath()
        {
            var dir = new DirectoryImpl( this, Path.GetTempPath() );
            dir.Create();

            return dir;
        }
示例#3
0
 public StartpointSSISBatch(FileTransferExecuter fileTransferExecuter, FolderSettings folderSettings, DirectoryImpl directoryImpl, AcceptedFileExtensionFactory acceptedFileExtensionFactory, TransferInformationFactory transferInformationFactory)
 {
     _fileTransferExecuter         = fileTransferExecuter;
     _folderSettings               = folderSettings;
     _directoryImpl                = directoryImpl;
     _acceptedFileExtensionFactory = acceptedFileExtensionFactory;
     _transferInformationFactory   = transferInformationFactory;
 }
 public void Should_Get_single_file()
 {
     File.WriteAllText("a.abc", "123");
     var dir = new DirectoryImpl();
     var files = dir.GetFilesInCurrentDirectory("*.abc");
     Assert.That(files.Count, Is.EqualTo(1));
     File.Delete("a.abc");
 }
示例#5
0
 protected override void Arrange()
 {
     base.Arrange();
     base.Act();
     FolderSettings.Stub(x => x.GetDatasets()).Return(SourceDir);
     DirectoryImpl.Stub(x => x.CreateDataSetDirectory()).Return(destination);
     TransferInformationFactory.Stub(x => x.Create(SourceDir, destination)).Return(TransferInformation);
     AcceptedFileExtensionFactory.Stub(x => x.Create(Extensions)).Return(AcceptedExtensions);
 }
示例#6
0
 protected override void Arrange()
 {
     base.Arrange();
     base.Act();
     FolderSettings.Stub(x => x.GetSsis()).Return(FolderPath);
     DirectoryImpl.Stub(x => x.ReadDirectory(FolderPath)).Return(Files);
     FileInfoFactory.Stub(x => x.Create(File1)).Return(FileInfo1);
     FileInfoFactory.Stub(x => x.Create(File2)).Return(FileInfo2);
 }
示例#7
0
 public StartpointSql(FileTransferExecuter fileTransferExecuter, FolderSettings folderSettings, DirectoryImpl directoryImpl, AcceptedFileExtensionFactory acceptedFileExtensionFactory, TransferInformationFactory transferInformationFactory, SqlScriptMerger sqlScriptMerger, AcceptedFilePrefixFactory acceptedFilePrefixFactory)
 {
     _fileTransferExecuter         = fileTransferExecuter;
     _folderSettings               = folderSettings;
     _directoryImpl                = directoryImpl;
     _acceptedFileExtensionFactory = acceptedFileExtensionFactory;
     _transferInformationFactory   = transferInformationFactory;
     _sqlScriptMerger              = sqlScriptMerger;
     _acceptedFilePrefixFactory    = acceptedFilePrefixFactory;
 }
示例#8
0
 protected override void Arrange()
 {
     base.Arrange();
     base.Act();
     FolderSettings.Stub(x => x.GetSqlUpdates()).Return(sqlSourceUpdatesPath);
     FolderSettings.Stub(x => x.GetSqlMaster()).Return(sqlSourceMasterPath);
     DirectoryImpl.Stub(x => x.CreateSqlMasterDirectory()).Return(sqlDestMasterPath);
     DirectoryImpl.Stub(x => x.CreateSqlUpdatesDirectory()).Return(sqlDestUpdatesPath);
     DirectoryImpl.Stub(x => x.CreateSqlRootDirectory()).Return(sqlRootPath);
     TransferInformationFactory.Stub(x => x.Create(sqlSourceMasterPath, sqlDestMasterPath))
     .Return(TransferInformation);
     AcceptedFileExtensionFactory.Stub(x => x.Create(Extensions)).Return(AcceptedExtensions);
     AcceptedFilePrefixFactory.Stub(x => x.Create(Prefixes)).Return(AcceptedPrefix);
 }
 public ConfigRepository(IConfigReader configReader, ICache cache, ISleep sleep, ILog log,
     int errorReadingConfigSleepTime, IGenericSerializer genericSerializer)
 {
     this.configReader = configReader;
     this.cache = cache;
     this.sleep = sleep;
     ConfigRepository.log = log;
     this.errorReadingConfigSleepTime = errorReadingConfigSleepTime;
     this.genericSerializer = genericSerializer;
     clientList = new GraphiteClients();
     var dir = new DirectoryImpl();
     if (ar == null)
     {
         ar = new AssemblyResolver(dir, log);
     }
     this.masterConfig = new SqlToGraphiteConfig(ar, log);
     this.Hash = "NotSet";
 }
示例#10
0
        public static TaskManager CreateTaskManager(SqlToGraphiteSection configuration)
        {
            var cacheLength = new TimeSpan(0, configuration.ConfigCacheLengthMinutes, 0);
            var stop = new Stop();
            var directoryImpl = new DirectoryImpl();
            var assemblyResolver = new AssemblyResolver(directoryImpl, log);
            IEncryption encryption = new Encryption();
            IDataClientFactory dataClientFactory = new DataClientFactory(log, assemblyResolver, encryption);
            IGraphiteClientFactory graphiteClientFactory = new GraphiteClientFactory(log);

            var configReader = new ConfigHttpReader(configuration.ConfigUri, configuration.ConfigUsername, configuration.ConfigPassword);
            var cache = new Cache(cacheLength, log);
            var sleeper = new Sleeper();
            var genericSer = new GenericSerializer(Global.GetNameSpace());
            var cr = new ConfigRepository(configReader, cache, sleeper, log, configuration.MinutesBetweenRetryToGetConfigOnError, genericSer);
            var configMapper = new ConfigMapper(configuration.Hostname, stop, dataClientFactory, graphiteClientFactory, log, cr);
            var roleConfigFactory = new RoleConfigFactory();
            var environment = new Environment();
            var taskSetBuilder = new TaskSetBuilder();
            var configController = new ConfigController(configMapper, log, cr, roleConfigFactory, environment, taskSetBuilder);
            return new TaskManager(log, configController, configuration.ConfigUri, stop, sleeper, configuration.CheckConfigUpdatedEveryMinutes);
        }
 // *** Public Methods ***********************************************
 public FileSystem(string rootDir)
 {
     _root = new DirectoryImpl(null, rootDir, rootDir);
 }
示例#12
0
 public FileReader(FolderSettings folderSettings, DirectoryImpl directoryImpl, FileInfoFactory fileInfoFactory)
 {
     _fileInfoFactory = fileInfoFactory;
     _directoryImpl   = directoryImpl;
     _folderSettings  = folderSettings;
 }
示例#13
0
 public StartpointCompression(ZipFileImpl zipFileImpl, DirectoryImpl directoryImpl, FileImpl fileImpl)
 {
     _zipFile       = zipFileImpl;
     _directoryImpl = directoryImpl;
     _fileImpl      = fileImpl;
 }
 // *** Internal Methods *********************************************
 internal FileImpl(DirectoryImpl parent, string fullname, string localname)
 {
     _parent    = parent;
     _fullname  = fullname;
     _localname = localname;
 }
 public void Should_Get_zero_files()
 {
     var dir = new DirectoryImpl();
     var files = dir.GetFilesInCurrentDirectory("*.xyz");
     Assert.That(files.Count, Is.EqualTo(0));
 }