public void Should_be_possible_to_collect_a_file_item_for_unix_systems() { var fileCollector = new FileCollector() { LsCommand = CreateFakeLsCommand(true, false) }; var fileItemToCollect = CreateFakeUnixFileItem(false); var collectedItem = new FileObjectCollector(fileCollector).CollectDataForSystemItem(fileItemToCollect); ItemTypeChecker.DoBasicAssertForCollectedItems(collectedItem, 1, TypeOfUnixFileItem, true); }
protected override void ConfigureObjectCollector() { if (base.ObjectCollector == null) { var sshCommandRunner = ((SSHConnectionProvider)ConnectionProvider).SshCommandLineRunner; var newFileCollector = new FileCollector() { LsCommand = new LsCommand(sshCommandRunner) }; base.ObjectCollector = new FileObjectCollector(newFileCollector); if (base.ItemTypeGenerator == null) { var fileContentProvider = new FileContentCollector(sshCommandRunner); var unixFileProvider = new UnixFileProvider(fileContentProvider, newFileCollector); base.ItemTypeGenerator = new FileItemTypeGenerator() { SystemDataSource = ObjectCollector, FileProvider = unixFileProvider }; } } }
public UnixFileProvider(FileContentCollector unixFileContentCollector, FileCollector unixFileCollector) { this.UnixFileContentCollector = unixFileContentCollector; this.UnixFileCollector = unixFileCollector; }
public FileObjectCollector(FileCollector filesCollector) { this.FilesCollector = filesCollector; }
protected override void ConfigureObjectCollector() { if (base.ObjectCollector == null) { var sshExec = ((SSHConnectionProvider)ConnectionProvider).SSHExec; var newSSHProvider = new SSHProvider(sshExec); var newFileContentCollector = new FileContentCollector(newSSHProvider); var newFileCollector = new FileCollector() { LsCommand = new LsCommand(sshExec) }; var newUnixFileProvider = new UnixFileProvider(newFileContentCollector, newFileCollector); base.ObjectCollector = new TextFileContentObjectCollector() { FileContentProvider = newUnixFileProvider, TargetInfo = this.TargetInfo }; base.ItemTypeGenerator = new TemporaryItemTypeGenerator() { ObjectCollector = base.ObjectCollector, TargetInfo = this.TargetInfo }; } }